 # How to Count Days in Month in Excel Well, this is one can be done manually but when you work on excel you want automation as much as possible. In that case, for getting days in given month, we should use excel formulas. In this article, we will learn how to get number of days in given month.

Generic Formula

=DAY(EOMONTH(date,0))

Date: the number of days will be calculated of this date’s month.

Example: Get number of days in month of sum random dates.
Here, we have this list of sum random dates. We need to get number of days of respective months. If you have to tell me the number of days in each month, you will take significant time to tell months with 31 days and 30 days, and may forget to check the leap year. Excel will not do these mistakes.

Write this formula in cell B2 and drag it down.

=DAY(EOMONTH(A2,0))

This can be used to calculate salaries and to know workdays.
How it works?
The EOMONTH function of excel returns the serial number of last date of month of given date. The DAY function returns the Day from last date of month. Together they provide us number of days in month of given date.

So yeah guys, this how you can get number of days of a month in excel. Let me know if you have any doubt or query regarding this article or another excel topic. The comments section is open for you. We will be happy to help you.

Terms and Conditions of use

The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.