EOMONTH Function (LibreOffice Calc)
The EOMONTH function returns the last day of the month that is a specified number of months before or after a given date. It is essential for financial schedules, billing cycles, and month-end calculations.
Compatibility
▾| Excel | ✔ |
| Gnumeric | ✔ |
| Google_sheets | ✔ |
| Libreoffice | ✔ |
| Numbers | ✔ |
| Onlyoffice | ✔ |
| Openoffice | ✔ |
| Wps | ✔ |
| Zoho | ✔ |
What the EOMONTH Function Does â–¾
- Returns the last day of a target month
- Adds or subtracts whole months
- Handles leap years and variable month lengths
- Works with serial dates or text dates
- Returns a serial date number formatted as a date
It is designed to be precise, predictable, and ideal for month-end calculations.
Syntax â–¾
EOMONTH(start_date; months)
Arguments
-
start_date:
The reference date. -
months:
Number of months to offset (positive or negative).
Basic Examples â–¾
Last day of the current month
=EOMONTH("2024-01-15"; 0)
Returns 2024‑01‑31.
Last day of next month
=EOMONTH("2024-01-15"; 1)
Returns 2024‑02‑29 (leap year).
Last day of previous month
=EOMONTH("2024-03-10"; -1)
Returns 2024‑02‑29.
Using cell references
=EOMONTH(A1; B1)
Advanced Examples â–¾
First day of next month
=EOMONTH(A1; 0) + 1
First day of current month
=EOMONTH(A1; -1) + 1
Days in the current month
=EOMONTH(A1; 0) - EOMONTH(A1; -1)
Generate a month-end schedule
=EOMONTH($A$1; ROW(A1)-1)
Compute quarter-end
=EOMONTH(A1; MOD(3 - MONTH(A1); 3))
Compute fiscal year-end (March 31 example)
=EOMONTH(DATE(YEAR(A1)+(MONTH(A1)>3); 3; 1); 0)
Add months to a text date
=EOMONTH(DATEVALUE(A1); 6)
Add months to Excel serial dates imported as text
=EOMONTH(DATE(1899;12;30)+VALUE(A1); 1)
Compute the last day of the year
=EOMONTH(DATE(YEAR(A1);12;1); 0)
Compute the last day of the quarter
=EOMONTH(A1; 3 - MOD(MONTH(A1); 3))
Edge Cases and Behavior Details â–¾
EOMONTH returns a number, not text
Accepts:
- Real dates
- Serial numbers
- DATEVALUE outputs
- ISO date strings
Invalid text → Err:502
Time components are ignored
=EOMONTH("2024-01-15 23:59"; 0) → 2024‑01‑31
Negative months allowed
Large offsets allowed
=EOMONTH("2024-01-01"; 1200) → year 2124
Leap-year aware
EOMONTH of an error → error propagates
Common Errors and Fixes â–¾
Err:502 — Invalid argument
Cause:
- Text not recognized as a date
- Non-numeric month offset
Fix:
- Wrap with DATEVALUE
- Ensure months is numeric
Wrong result due to text dates
Fix:
- Normalize with DATEVALUE
Unexpected month-end behavior
Cause:
- Misunderstanding of month offset logic
Fix:
- Use EDATE if you want same-day-of-month behavior
Best Practices â–¾
- Use EOMONTH for all month-end calculations
- Use EDATE for same-day-of-month offsets
- Use DATEVALUE to normalize text dates
- Use EOMONTH(A1;0)+1 for first-of-month logic
- Use EOMONTH with ROW() or SEQUENCE() to generate schedules
EOMONTH is your month‑end anchor — perfect for financial modeling, billing cycles, forecasting, and any workflow that depends on precise month boundaries.
Related Patterns and Alternatives â–¾
- Use EDATE for same-day-of-month offsets
- Use DATE for custom date construction
- Use DATEDIF for interval calculations
- Use DAYS for day differences
- Use YEARFRAC for fractional-year differences
By mastering EOMONTH and its companion functions, you can build powerful, reliable, and fully dynamic month‑end workflows in LibreOffice Calc.