How to Find the Last Day of Any Month in Excel
Use the EOMONTH function to easily determine the last day of the current month or a future month by specifying the number of months to add.
Formula Genius can generate a draft from a plain-English prompt. Supported formulas can be checked with sample cases; review the coverage on the result.
The formula
"Find the last day of the current month, or the last day of a month N months from now"
=EOMONTH(TODAY(), 0)
This formula returns the last day of the current month or the last day of a month N months from now.
Step-by-step breakdown
- EOMONTH is the function used to calculate the end of the month.
- TODAY() returns the current date.
- The second argument in EOMONTH specifies how many months to add (0 for current month).
- The function calculates the last day of the month based on the provided date.
- The result is a date value representing the last day of the specified month.
Edge cases & warnings
- Using a negative number for N returns the last day of a previous month.
- If the date is at the end of a month, it still returns the last day of that month.
- Using a very large number for N may return a date far in the future.
- If the formula is used in a leap year, it correctly accounts for February 29.
- If no argument is provided, it defaults to the current month.
Examples
"EOMONTH(TODAY(), 0)"
2023-10-31
"EOMONTH(TODAY(), 2)"
2023-12-31
Frequently asked questions
What does EOMONTH stand for?
EOMONTH stands for 'End Of Month'.
Can I use EOMONTH with dates other than today?
Yes, you can replace TODAY() with any valid date.
What happens if I use a negative number?
Using a negative number will return the last day of a previous month.
Can't find what you need?
Describe a formula in plain English. Formula Genius drafts and explains it, and can check supported formulas on sample cases.