How EOMONTH works
Syntax
=EOMONTH(start_date, months)start_date- Any date in the starting month.
months- 0 = end of this month, 1 = end of next month, -1 = end of last month.
Example
You want the first day of the month for a date in A2, for monthly grouping.
=EOMONTH(A2, -1) + 1The end of the previous month plus one day is the 1st of this month.
Common mistakes
- Seeing a number like 46387. Format the cell as a date.
- Using it to group months in a pivot table when the pivot can group dates by month for you.
Questions people ask
How do I count days in a month?
=DAY(EOMONTH(A2, 0)) returns 28, 29, 30 or 31.
Practice it above: type the formula in the formula bar and press Enter to check.