YEAR() – Extracts the year from a date

The YEAR() function returns the year (as a four-digit number) from a given date.

Syntax

YEAR(date)

  • date: A valid date or a cell reference containing a date. This date can be entered as text (e.g., "15/01/2025", conforming to your MathGrid date settings) or be the result of another date function like TODAY().

Basic example

YEAR(T1A1)

Extracts the year from the date in cell T1A1.

Example outputs:

  • If T1A1 contains the date "15/01/2025": YEAR(T1A1)2025
  • If TODAY() returns "23/07/2024": YEAR(TODAY())2024
  • If cell T1B2 contains "05-12-1999" (and this matches your date format settings): YEAR(T1B2)1999

Key features

  • Numeric output: Always returns a four-digit number representing the year.
  • Flexible input: Accepts dates as text strings (matching MathGrid's date format settings) or as outputs from other date functions.
  • Date part extraction: Specifically isolates the year component from a full date.

Practical uses

  • Analyzing data based on the year (e.g., tracking annual growth).
  • Conditional formatting or calculations specific to a certain year.
  • Grouping data by year.
  • Calculating ages or service durations when combined with the current year.

Common mistakes

  • Incorrect date format: If providing a date as text, ensure it matches the date format specified in MathGrid's settings. An incorrect format can lead to an error or an incorrect year being extracted.
  • Using non-date values: Providing text that isn't a valid date or a number that doesn't represent a date will result in an error (e.g., YEAR("March") is invalid).
  • Two-digit years: While MathGrid's date settings might allow displaying a two-digit year (e.g., "yy"), the YEAR() function itself will typically return the full four-digit year for clarity in calculations.

Report issue

Features, Pricing, Documentation, Support, Login

MathGrid ©

Features,
Pricing,
Documentation,
Support,
Login

MathGrid ©

Back to top Arrow