Contact

Calligra Sheets EDATE Function: Add or Subtract Calendar Months

Date & Time Intermediate Calligra Sheets

Shift dates by whole calendar months with EDATE in Calligra Sheets. Covers leap-year end-of-month adjustments, examples, negative offsets, errors and versioned KDE source.

Verification status: Consult the documentation and examples below. Native application testing has not been documented for this guide. How formula examples are checked

Quick answer

EDATE shifts a calendar date by a specified number of whole calendar months. Use it to calculate monthly billing dates, renewals, or the corresponding date before/after a date in a schedule. =EDATE(DATE(2024;1;31);1) has an expected result of February 29, 2024: when the target month has fewer days, the Qt date routine used by pinned Calligra source adjusts to that month’s last valid date.

Scope and test disclosure: Applies to Calligra Sheets 26.08.2, released 2026-10-08, as documented and source-inspected 2026-10-12. The spreadsheet application was not executed. Date results below are expected, independently checked using Gregorian month arithmetic and supported by pinned Calligra/Qt code and documentation. Actual displayed date styles, error strings, package build and locale parsing remain untested. KDE currently lists Linux distribution/Flatpak channels; cross-platform behavior is not asserted.

Exact syntax, inputs and return value

=EDATE(date;months)

Exactly two parameters are required, in this order, with no optional defaults. The pinned registration explicitly calls setParamCount(2).

Position Parameter KDE XML type What it controls
1 date String/Text in legacy XML Starting date: preferably an actual date cell or DATE(year;month;day) expression, not a locale-ambiguous quoted string.
2 months Integer Signed number of months to shift: positive = forward; negative = backward; zero = same date.

Return: a date value. datetime.xml lists its return type as Date; the pinned implementation converts the first argument to QDate, calls addMonths, checks validity and returns Value(date, calc->settings()). A date cell may be displayed in different orders or formats across locales. Use the separator conventions of the target Calligra editor; KDE’s handbook uses semicolons.

Registered alternate name: COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETEDATE is an explicit compatibility alias for the same implementation in 26.08.2. It is not a second canonical function or a separate calculation. Do not recommend typing the long alias in routine formulas when EDATE is available.

Reproducible worksheet: month-offset schedule

In A1 type Start date, in B1 type Month shift, and in C1 type EDATE result. Fill A2:A6 with the date-producing formulas below; enter integers into B2:B6. Type =EDATE(A2;B2) in C2 and fill down to C6. Display columns A and C using the same date format (for example YYYY-MM-DD) so the expected calendar values are easy to compare.

Row Date formula in A B: Months Formula in C Expected resulting calendar date
2 =DATE(2024;1;31) 1 =EDATE(A2;B2) 2024-02-29
3 =DATE(2023;1;31) 1 =EDATE(A3;B3) 2023-02-28
4 =DATE(2024;5;15) -2 =EDATE(A4;B4) 2024-03-15
5 =DATE(2024;2;29) 12 =EDATE(A5;B5) 2025-02-28
6 =DATE(2024;10;12) 0 =EDATE(A6;B6) 2024-10-12

The examples specifically distinguish leap-year February from non-leap February, positive and negative month shifts, 12-month renewal and zero shift. These results were independently calculated, not copied from an observed Calligra session. The Qt QDate reference explains addMonths adjusts a target day absent from the resulting month to the last valid date. The Calligra 26.08.2 func_edate callback uses exactly that API.

KDE’s original text-input examples

The official KDE handbook documents EDATE("2/22/2002";3) → May 22, 2002 and EDATE("3/31/2002";-1) → February 28, 2002. These are documentation examples, not independently tested string parsing. Numeric month/day text is ambiguous across locales; prefer the DATE constructor in examples to make input meaning explicit.

Practical and advanced uses

Subscription renewal by full calendar months: If A2 holds the start date and B2 the signed renewal interval, =EDATE(A2;B2) computes the expected date-based renewal. For a January 31, 2024 start and a one-month cycle, the first expected target is February 29. A repeat schedule based on an original anchor date can differ from repeatedly shifting already adjusted February 29 dates; specify your business rule before copying formulas.

Annual review:

=EDATE(DATE(2024;2;29);12)

Expected date: 2025-02-28. This expression means 12 calendar months; it does not mean 365 days. The result is checked by independent Gregorian arithmetic and Qt addMonths documentation.

Flag obligations due before quarter-end: With A2/B2 from the table, enter the following in D2, then copy down:

=IF(EDATE(A2;B2)<=DATE(2024;3;31);"Due by 2024 Q1";"After 2024 Q1")

Using the five dates above, the expected labels for rows 2–6 are respectively Due by 2024 Q1, Due by 2024 Q1, Due by 2024 Q1, After 2024 Q1, After 2024 Q1. These are independently reasoned formula expectations, not observed Calligra outputs. IF and DATE are separately registered functions.

Compare with DATE component rollover: For A2 = January 31, 2024, the expected =EDATE(A2;1) is February 29; =DATE(YEAR(A2);MONTH(A2)+1;DAY(A2)) is expected to roll to March 2 under the pinned DATE callback. The difference is material for contracts that specify the last valid day of the target month.

Errors, limitations and troubleshooting

  • Invalid starting date: the pinned func_edate calls asDate, applies Qt addMonths, then returns a VALUE-class error if the resulting date is invalid. The exact visible error label has not been tested.
  • Wrong number of parameters: EDATE() or a three-argument call violates pinned setParamCount(2). The engine rejects wrong arity with a source-level VALUE-class error.
  • An unparsed quoted date: legacy examples such as "2/22/2002" are locale sensitive. Use DATE(2002;2;22) or a properly typed date cell instead; a value merely displaying as a date does not ensure the underlying type is a date.
  • Months as decimals: the code calls asInteger for the shift. Exact conversion behavior for nonintegral/invalid numeric text was not tested; enter a genuine integer month count and avoid promises about rounding vs truncation in your installed build.
  • End-of-month expectations: the Qt date API adjusts Jan 31 + 1 month to the last day in February; repeating the shift can change the anchor day for subsequent months. Use a consistent original date plus cumulative month counts when needed.
  • Time-of-day input: EDATE uses a QDate, so it is a date operation; this guide makes no promise to preserve input time components.
  • Very large shifts or unusual historical years: addMonths may yield an invalid date for unsupported ranges; QDate validity and calendar conventions are not a guarantee of workbook interoperability.
  • Display differs: set both source and target as dates; the formula result is not guaranteed to render in ISO order or with a particular locale language.
  • No native tests: this manuscript does not establish localized error presentation, package/runtime behavior, or round-trip semantics in imported Excel workbooks.

Cross-compatibility: Excel and other applications

Microsoft documents EDATE(start_date,months) for shifting a date by calendar months, with positive/negative offsets and an integer month argument. The functional purpose is shared, and both products also recognize DATE for constructing source dates. However, Excel’s dates are documented as numerical serials and Calligra source converts to Qt QDate; locale parsing, serial-date calendars, invalid dates and error rendering may differ. Excel’s EDATE examples do not prove Calligra execution, particularly for text dates and out-of-range values. This Microsoft source was checked 2026-10-12. The compatibility alias uses the same implementation.

Related KDE-registered functions include DATE (construct a date), EOMONTH (end of shifted month), and DAY / MONTH / YEAR (extract components). See the linked KDE documentation.

Official/source links checked 2026-10-12:

  1. KDE EDATE handbook — month shift purpose, semicolon syntax and month-end examples.
  2. KDE EDATE function XML — Date return type, required date plus integer month parameters, reference examples.
  3. KDE registration / alias — exactly two parameters and the long COM.SUN...GETEDATE compatibility alternate.
  4. KDE EDATE implementation — asDate, integer months, Qt addMonths, validity check and returned date value.
  5. Qt QDate addMonths behavior — last-valid-day adjustment; supporting Qt API documentation, not native Calligra execution.
  6. Calligra function arity guard — source-level VALUE error on incorrect number of arguments.
  7. KDE Calligra Sheets release listing — 26.08.2 (2026-10-08) at audit time.
  8. Microsoft Excel EDATE reference — purpose comparison only; checked independently.

Testing limitation: Native Calligra locale, coercion, error display and workbook interchange have not been executed.