Features of !SEMTools

YEAR

YEAR function in Excel - examples
YEAR function examples in Excel
Function categoryDate and time functions
VolatilityNon-volatile
Similar functionsMONTH — returns month number
DAY — returns day number
WEEKDAY — returns day of week number from date

What does this function do?

The YEAR function extracts a four-digit year number from a given date. For example, from date 03/15/2025 it will return value 2025.

Examples:

  • 01/01/2024 → 2024
  • 12/31/1999 → 1999

The function is useful when you need to analyze data distribution by years, build pivot tables, group events or sales by calendar year.

Formatting

The result is an integer. If necessary, you can change the cell’s number format, but usually this is not required.

If you need to display the year as text, you can use the TEXT function:

=TEXT(A2,"yyyy")

Syntax

=YEAR(date)
  • date — required argument. Can be:
    • reference to a cell with date
    • result of a function (for example, TODAY() or NOW())
    • text that Excel recognizes as a date (for example, “2025-03-15”)

Examples

DateFormulaResult
03/15/2025=YEAR(A2)2025
=TODAY()=YEAR(TODAY())(current year)
=YEAR("1999-12-31")1999

Features

  • The function returns only the year number, without month and day.
  • If the cell is empty or contains text that Excel cannot recognize as a date, the result will be an error.
  • Excel considers dates starting from January 1, 1900.

Other Date and Time functions in Excel

TIMEVALUE, TIME, DATE, DATEVALUE, EDATE, DAY, WEEKDAY, YEARFRAC, EOMONTH, MONTH, MINUTE, WEEKNUM and WEEKNUM.ISO, WORKDAY, DATEDIF, TODAY, SECOND, NOW, HOUR, NETWORKDAYS

Like the article? Help its author! Buy !SEMTools, it has lots of useful instruments to process text data.

This post is also available in RU.