How to Calculate Days in the Year of the Date

There are 365 days in a common year and 366 days in a leap year in the Gregorian calendar. The leap year is exactly divisible by four, except for years that are exactly divisible by 100. However, these century years are leap years if they are exactly divisible by 400.

If you have a list of dates, some of them are common years and some are leap years. To know the number of days in a year based on the date, please use the formula below.

=DAYS(DATE(YEAR(A2),12,31), DATE(YEAR(A2),1,1))+1

Where A2 is the cell with the date. DATE(YEAR(A2),12,31) returns the last day of the year, and DATE(YEAR(A2),1,1) returns the first day of the year.

DAYS function returns the number of days between two dates with the syntax below:

=DAYS(end_date, start_date)

Please check how to calculate the days in a month for the days in a month.

Leave a Reply