How to Find the First and Last Day of a Month in Excel
First and Last Day of Month is a Excel function that calculates the first and last day of the month for a given date in cell a1.. Formula Genius generates and validates this formula automatically from a plain-English prompt.
Easily determine the first and last days of any month from a given date using simple Excel formulas.
The Formula
"Find both the first day and last day of any given month from a date value"
=EOMONTH(A1,0) - DAY(EOMONTH(A1,0)) + 1 & " to " & EOMONTH(A1,0)
This formula calculates the first and last day of the month for a given date in cell A1.
Step-by-Step Breakdown
- Use EOMONTH(A1, 0) to find the last day of the month.
- Subtract DAY(EOMONTH(A1, 0)) to get the first day of the month.
- Add 1 to the result to adjust to the first day.
- Concatenate the first and last days with ' to ' in between.
Edge Cases & Warnings
- Input date is the last day of the month.
- Input date is in a leap year.
- Input date is the first day of the month.
- Input date is formatted as text instead of a date.
Examples
"2023-03-15"
2023-03-01 to 2023-03-31
"2024-02-28"
2024-02-01 to 2024-02-29
Frequently Asked Questions
What if the input date is invalid?
The formula will return an error if the input date is not valid.
Can I use this formula for any date format?
The formula works best with recognized date formats in Excel.
How does this formula handle leap years?
The formula correctly identifies February 29 for leap years.
Can't find what you need?
Describe any formula in plain English and Formula Genius will generate, explain, and validate it — instantly.