Formualizer Docs

YEAR

Extracts the calendar year from a date serial.

The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.

Syntax

=YEAR(serial_number)

Arguments

ArgumentTypeRequiredDefault
serial_numbernumberRequired—

Remarks

  • A date argument may be text holding a date or time ("10/26/1999", "1999-10-26 14:05"), read as its serial; text that is neither a number nor a date returns #VALUE!.
  • Fractional time is ignored; only the integer date portion is used.
  • Input serials are interpreted with the workbook's date system (Excel 1900 or Excel 1904).
  • Results are Gregorian calendar years.

Examples

Extract the date component from a leap-day date.

Formula =YEAR(DATE(2024,2,29))

Expected result 2024

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Read the date component from a serial that also contains a time fraction.

Formula =YEAR(DATE(2024,12,31)+0.75)

Expected result 2024

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Read the component of the first day of the 1900 date system.

Formula =YEAR(1)

Expected result 1900

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

An unrecognized date string cannot be interpreted as a serial.

Formula =YEAR("not a date")

Expected result #VALUE!

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Extract year from date serial

Formula =YEAR(44927)

Expected result 2023

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Extract year from datetime serial

Formula =YEAR(45351.75)

Expected result 2024

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Extract year from date text

Formula =YEAR(A1)

Input cells
A
1"10/26/1999"

Expected result 1999

This example uses behavior that differs in the published browser package.

FAQ

Does YEAR use the fractional time part of a serial?

No. YEAR resolves the calendar date and ignores time-of-day fractions.

Implementation

Engine source

On this page