Number of Days in a Year (DAYSINYEAR)

Syntax: DAYSINYEAR(t)

The DAYSINYEAR function returns the number of days in the given date. For example:

=DAYSINYEAR(DATE(2012; 2; 16))

returns 366 (because the year 2012 is a leap year).

images

Figure 12-11. Sample result of the DAYSINYEAR function

You can give DAYSINYEAR the date in a more natural format:

=DAYSINYEAR("2/16/2012")

returns 366 again.

Get Beginning OpenOffice Calc: From Setting Up Simple Spreadsheets to Business Forecasting now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.