Contact

MONTH Function (LibreOffice Calc)

Date & Time Beginner LibreOffice Calc Introduction not established

The MONTH function extracts the month component (1–12) from a date or datetime value. It is essential for reporting, grouping, filtering, and constructing date logic.

Verification status: Consult the documentation, examples and any stated test scope below. How formula examples are checked

Availability and version history

  • Introduced: Documented by LibreOffice 26.8.1.1; original introduction not established.
  • Availability: Supported in LibreOffice 26.8.1.1, verified against its function registry. This identifies a supported release, not a final working version.
  • Scope: Desktop Calc, using the English function name. Availability in other spreadsheet applications is separate.
  • Checked: 2026-10-14 — function reference; versioned support. Documentation/source check; not a new native test. Existing example-specific test claims below retain their stated scope.
The **MONTH** function extracts the **month component (1–12)** from a date or datetime value. It is essential for reporting, grouping, filtering, constructing dates, and validating imported data. MONTH works with real dates, serial numbers, and text converted with DATEVALUE.

What the MONTH Function Does

  • Extracts the month from a date or datetime
  • Accepts serial numbers, real dates, or converted text
  • Returns an integer from 1 to 12
  • Ignores year, day, and time components

It is designed to be simple, reliable, and ideal for date‑component extraction.

Syntax

MONTH(date_value)

Arguments

  • date_value:
    A date, datetime, or serial number representing a date.

Basic Examples

Extract month from a date

=MONTH("2024-03-15")

Returns 3.

Extract month from a datetime

=MONTH("2024-03-15 08:45")

Returns 3.

Extract month from a cell

=MONTH(A1)

Extract month from TODAY()

=MONTH(TODAY())

Advanced Examples

Extract month from text using DATEVALUE

=MONTH(DATEVALUE(A1))

Extract month from imported CSV timestamps

=MONTH(DATEVALUE(LEFT(A1;10)))

Extract month from Excel serial dates imported as text

=MONTH(DATE(1899;12;30)+VALUE(A1))

Determine if two dates are in the same month

=MONTH(A1)=MONTH(B1)

Build a month label (e.g., “March”)

=TEXT(A1; "MMMM")

Build a short month label (e.g., “Mar”)

=TEXT(A1; "MMM")

Extract fiscal month (April–March example)

=MONTH(A1 - 90)

Extract month from YYYYMMDD text

=MONTH(DATEVALUE(LEFT(A1;4) & "-" & MID(A1;5;2) & "-" & RIGHT(A1;2)))

Extract month from DDMMYYYY text

=MONTH(DATEVALUE(RIGHT(A1;4) & "-" & MID(A1;3;2) & "-" & LEFT(A1;2)))

Edge Cases and Behavior Details

MONTH returns an integer (1–12)

Accepts:

  • Real dates
  • Serial numbers
  • DATEVALUE outputs
  • ISO date strings

Invalid text → Err:502

MONTH ignores:

  • Time components
  • Timezones
  • Seconds/milliseconds
  • Everything after the date portion

MONTH of a number < 1 → Err:502

(Serial numbers must represent valid dates)

MONTH of an error → error propagates

Common Errors and Fixes

Err:502 — Invalid argument

Cause:

  • Text not recognized as a date
  • Negative serial numbers
  • Non-numeric values

Fix:

  • Wrap with DATEVALUE
  • Clean text with TRIM or SUBSTITUTE

Wrong month due to locale parsing

Fix:

  • Convert to ISO format before DATEVALUE

MONTH returns unexpected value from serial numbers

Cause:

  • Serial numbers represent days since epoch

Fix:

  • Ensure imported values are converted properly

Best Practices

  • Use MONTH for grouping and reporting
  • Normalize text dates with DATEVALUE
  • Use MONTH with YEAR and DAY to reconstruct dates
  • Use MONTH with TODAY() for dynamic calculations
  • Use MONTH with EDATE/EOMONTH for period analysis
  • Use TEXT(A1; “MMM”) or “MMMM” for readable labels
MONTH is your date‑extraction workhorse — perfect for reporting, grouping, filtering, and building dynamic date‑driven workflows.
  • Use YEAR and DAY for other components
  • Use DATE to construct dates
  • Use DATEVALUE for text conversion
  • Use NOW and TODAY for dynamic values
  • Use EDATE and EOMONTH for month offsets

By mastering MONTH and its companion functions, you can build powerful, reliable, and fully structured date‑analysis workflows in LibreOffice Calc.


Reproducible example (tested in LibreOffice Calc)

This standalone example was calculated in LibreOffice Calc 25.2.3.2 and matched the expected value. It is a practical cross-check of one usage, not proof that every example elsewhere on this page is correct.

=MONTH(DATE(2025;1;15))

Expected result: 1.

Extract the month number from a spreadsheet date.

If the result differs, check the referenced cells, argument separators and number formatting. For more information, consult the LibreOffice Calc official help.