Excel Formula: Count Days of Month
In this tutorial, it provides formulas to count the total days of a specific month or the current month.
Syntaxt and Arguments
|Date: the date that you want to count days of month. The date argument can be a number or date (since the date is stored as number in Excel).|
The formula returns to a numeric value.
If the date argument is a text value, the formula returns the #VALUE! error.
How this formula works
To count the total days of the specific month in each cell of B3:B6, please use below formula in cell C3:
Press Enter key and then drag autofill handle down to cell C6.
EMONTH function: gets the last day of the month in future or past. EOMONTH(B3,0) gets the last day of month in cell B3, 2/29/2020.
DAY function: gets the days as number from a date.
1) If you want to automatic return the total days of the current month when the date changes, you can change the generic formula to this:
TODAY function is used to get the current date of today.
2) If you want to get the days from a month name, you can change the generic formula to this:
Example: supposing to get the days from the month name in cell B9, please use the formula as this:
Press Enter key to get the result.
YEAR function: returns the year based on the given date.
DATEVALUE function: converts a date stored as text format to a valid date.
- Check if a date is workday
This tutorial provides a formula to to check a date if is a workday.
- Check two dates are in the same year month
To check if two dates in the same year month, you can use the formula in this tutorial.
- Create date range from two dates
This tutorial provides a formula with TEXT function to create a date range based on two dates in text format in Excel.
- Create weekly date range
In this tutorial, it provides a formula to quickly get the weekly date range in Excel.
- Excel WEEKNUM Function
Returns the week number of the given date in a year
- Excel WORKDAY Function
Adds workdays to the given start date and returns a workday
- Excel MONTH Function
The MONTH is used to get the month as integer number (1 to 12) from date
- Excel DAY Function
DAY function gets the day as a number (1 to 31) from a date
- Excel NOW Function
Get the current time and date