Home ➜ Excel Formulas ➜ **How to Get Total Days in Month in Excel**

Sometimes you need to calculate the total number of days in a month to use in further calculation. It happens specifically when you work on templates and dashboards.

Sometimes you need to calculate the total number of days in a month to use in further calculation.

It happens specifically when you work on templates and dashboards. So today, let me show you a simple formula that can do this for you.

To calculate the number of days in a given month from a date, we need to use a formula based on EOMONTH and DAY.

## Formula: Get Total Days in a Month

=DAY(EOMONTH(A2,0))

### How this Formula Works

As you see this formula is a combination of two functions. We have EOMONTH which is covered within DAY.

- First, when you refer to a date and “0” in EOMONTH it returns the last date of that month. Here the date is on cell A2.
- Second, the DAY function returns the day from the last day returned by EOMONTH.

The day of the month’s last day is always the total number of days in a month. From 31-Mar-2017, it returns 31 which is the total number of days in March month.

## Dynamic Formula

Let’s you want to get the total days in a month for the current month and you want this formula to return it automatically every time the month changes.

The formula will be:

=DAY(EOMONTH(TODAY(),0))

In this formula, instead of referring to a date, we have referred to TODAY in EOMONTH which returns the current date and then EOMONTH returns the last date from the current date’s month.

In the end, DAY returns the day number and gets the total number of days for the current month.

## Get Days in Month using Month Name

Let’s say you have entered a month’s name in a cell not a proper date and now you want to calculate a total number of days from this month.

The formula will be:

=DAY(EOMONTH(DATEVALUE(“01-“&A2&”-“&YEAR(TODAY())),0))

This formula creates a first day’s date of the month you have mentioned and then EOMONTH returns the last date and DAY returns the last day which is the total number of days in a month. You can use the month’s name both in short form and long form.

## More Formulas

- Add Month to a Date
- Add Years to Date
- Add-Subtract Week from a Date
- Calculate Age using Date of Birth
- Compare Two Dates
- Convert Date to Number
- Count Years Between Two Dates
- Create a Date Range
- DATEDIF Function in Excel
- Get Day Number of Year
- Get Month from a Date
- Get Quarter from a Date [Fiscal + Calendar]
- Get Years of Service
- Get Day Name from a Date in Excel
- Get End of the Month Date in Excel
- Highlight Dates Between Two Dates
- Quickly Concatenate Two Dates
- Random Date Generator (Excel Formula)
- 5 Custom Date Formats I Always Use and You Should Too
- Convert Text to Date
- Get First Day (Beginning) of the Month