Forum Discussion
saarsa
Jan 04, 2025Copper Contributor
Problem with the EDATE function
If you use EDATE(DATE(2024,12,1)-1,1) it returns 30/12/2024 but there are 31 days in that date, What should I do or who should I report about this problem?
HansVogelaar
Jan 06, 2025MVP
DATE(2024,12,1)-1 is the 30th of November.
EDATE leaves the day unchanged unless it would be after the end of the target month.
So EDATE(DATE(2024,12,1)-1,1) returns the 30th of December.
If you want to return the last day of the month, use
=EOMONTH(DATE(2024,12,1)-1,1)
or shorter
=EOMONTH(DATE(2024,12,1),0)