Excel Formula to get Number of Days in a Month

It seems Excel still can’t tell me the days in a particular month.

The following formula works, though:

=DAY(DATE(YEAR(A1),MONTH(A1)+1,1)-1)

Obviously, A1 has to have a date in it.

Works like a charm:

 Update, much, much later: Looks like LibreOffice has a DAYSINMONTH function.

20 thoughts on “Excel Formula to get Number of Days in a Month

    Leave a Reply to Vicky Cancel reply

    Your email address will not be published. Required fields are marked *

    This site uses Akismet to reduce spam. Learn how your comment data is processed.