beginner 5 min read

YEAR, MONTH, and DAY Functions in Google Sheets

Learn how to use YEAR, MONTH, and DAY in Google Sheets to extract date parts. Group data by year, filter by month, and rebuild dates with examples.

SB

Sheets Bootcamp

February 24, 2026 ยท Updated November 5, 2026

Reviewed by Ryan

Quick Answer

=YEAR(A2), =MONTH(A2) and =DAY(A2) pull the year, month number and day out of a date. For 8/1/2018 they return 2018, 8 and 1. They return plain numbers, not dates. To build a changed date, combine them with DATE: =DATE(YEAR(A2)+1, MONTH(A2), DAY(A2)) returns 8/1/2019, one year later.

YEAR, MONTH, and DAY in Google Sheets extract individual parts from a date. YEAR returns the four-digit year, MONTH returns a number from 1 to 12, and DAY returns the day of the month. These three date functions are the building blocks for grouping data by time period, filtering by month, and reconstructing modified dates.

This guide covers the syntax for all three functions, step-by-step examples using employee hire dates, and practical patterns for counting, grouping, and rebuilding dates.

In This Guide

Syntax

All three functions take a single argument: the date to extract from.

Formula
=YEAR(date)

Returns the four-digit year (e.g., 2018).

Formula
=MONTH(date)

Returns the month as a number from 1 (January) to 12 (December).

Formula
=DAY(date)

Returns the day of the month as a number from 1 to 31.

ParameterDescriptionRequired
dateA valid date value or cell reference containing a dateYes

Important

These functions return numbers, not dates. YEAR(D2) returns 2018, not a date. If you need to build a new date from these parts, use the DATE function: =DATE(year, month, day).

How to Use YEAR, MONTH, and DAY: Step-by-Step

Weโ€™ll use the employee database with 8 employees. Column D has Hire Dates and column E has Birthdates.

Sample Data

Employee database with Name, Department, Hire Date, and Birthdate columns

1

Review your employee data

Open the spreadsheet. Column D contains Hire Dates ranging from 9/1/2017 (Dr. John Watson) to 3/22/2021 (Mary Morstan). Column E contains Birthdates. Youโ€™ll extract year, month, and day from the hire dates.

2

Extract the hire year

Select cell F2 and enter:

Formula
=YEAR(D2)

For Sherlock Holmesโ€™s hire date of 8/1/2018, this returns 2018. Copy the formula down to F9.

YEAR function returning 2018 for Sherlock Holmes's hire date

Results across all employees:

  • Dr. John Watson (9/1/2017): 2017
  • Sherlock Holmes, Inspector Lestrade (8/1/2018): 2018
  • Irene Adler (6/15/2019), the second Sherlock Holmes (4/1/2019): 2019
  • Dr. Mortimer (1/10/2020), Professor Moriarty (5/1/2020): 2020
  • Mary Morstan (3/22/2021): 2021
3

Extract the hire month

Select cell G2 and enter:

Formula
=MONTH(D2)

For Sherlock Holmes (hired 8/1/2018), this returns 8 (August). Copy down to G9. Dr. John Watson returns 9, Irene Adler returns 6, and Dr. Mortimer returns 1.

MONTH function returning 8 for Sherlock Holmes's August hire date

4

Extract the hire day

Select cell H2 and enter:

Formula
=DAY(D2)

For Sherlock Holmes (8/1/2018), this returns 1. For Irene Adler (6/15/2019), it returns 15. For Mary Morstan (3/22/2021), it returns 22.

5

Rebuild a date with DATE

To modify a date, extract its parts, change one, and rebuild with DATE. Select cell I2 and enter:

Formula
=DATE(YEAR(D2)+1, MONTH(D2), DAY(D2))

For Sherlock Holmesโ€™s hire date of 8/1/2018, this returns 8/1/2019, the same date shifted one year forward. The DATE function combines the extracted year (plus 1), original month, and original day into a new date.

DATE function rebuilding hire date with year incremented by 1

For more on adding years to dates, including edge cases with leap years, see the date arithmetic guide.

Tip

You can modify any part when rebuilding. =DATE(YEAR(D2), MONTH(D2)+3, DAY(D2)) adds 3 months. However, for month math, EDATE handles month-end edge cases more reliably.

Try it yourself

Question 1 of 3

3 quick questions. No account needed.

In B9, use YEAR to return the year the blender in B2 was bought.

A
B
C
D
E
F
G
H
I
J
1
2
3
4
5
6
7
8
9
10
11
Item
Bought
Store
Cost
Blender
2/14/2025
Kord
89
Kettle
8/3/2026
Vane
45
Fridge
3/10/2023
Kord
1450
Laptop
11/28/2025
Pique
980
Heater
1/6/2026
Vane
120
Router
6/19/2026
Pique
70
Result
B9

Get Month Names Instead of Numbers

MONTH returns a number. To display the month name, use TEXT instead:

Formula
=TEXT(D2, "MMMM")

For Sherlock Holmesโ€™s hire date (8/1/2018), this returns August. Use "MMM" for the three-letter abbreviation Aug.

For more date formatting options, including custom patterns like โ€œAug 2018โ€ or โ€œ2018-08โ€, see the formatting guide.

You can also use CHOOSE with MONTH for custom labels:

Formula
=CHOOSE(MONTH(D2), "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec")

This gives you full control over the label text.

Practical Examples

Count Hires by Year

Use COUNTIF with ARRAYFORMULA and YEAR to count how many employees were hired each year:

Formula
=COUNTIF(ARRAYFORMULA(YEAR($D$2:$D$9)), 2018)

This returns 2, Sherlock Holmes and Inspector Lestrade were both hired in 2018. Change 2018 to 2019 and the count becomes 2 (Irene Adler and the second Sherlock Holmes, hired 4/1/2019).

Group by Quarter

Combine MONTH with a formula to assign each hire date to a quarter:

Formula
="Q" & INT((MONTH(D2)-1)/3)+1

For Sherlock Holmes (August, month 8): INT((8-1)/3)+1 = INT(2.33)+1 = 3. The result is Q3. For Dr. Mortimer (January): Q1. For Sherlock Holmes (April): Q2.

Build a โ€œMonth Yearโ€ Label

Combine TEXT with the date to create a sortable label:

Formula
=TEXT(D2, "MMM YYYY")

For Sherlock Holmes, this returns Aug 2018. For Dr. John Watson, Sep 2017. Use these labels as group headers in reports or pivot-style summaries.

Common Errors and How to Fix Them

#VALUE! Error

YEAR, MONTH, or DAY returns #VALUE! when the cell contains text instead of a real date.

Fix: Check with =ISNUMBER(D2). If FALSE, the value is text. Convert it with =DATEVALUE(D2) before extracting parts.

Result Shows 1899 or 1900

You enter =YEAR(D2) and get 1899. The cell contains a number (like 0 or 1) that Google Sheets interprets as a date near its epoch (12/30/1899).

Fix: Verify that the source cell actually contains a date. If it contains a number from another calculation, YEAR interprets it as a serial date number.

MONTH Returns the Same Number for Every Row

MONTH returns the same small number on every row, like 7 or 1. The column likely contains years (2018, 2019) or other plain numbers rather than dates. Google Sheets reads a plain number as a date serial, so 2018 becomes 7/10/1905 and =MONTH(2018) returns 7.

Fix: Confirm the source cells are formatted as dates and contain actual date values, not plain numbers.

Tips and Best Practices

  1. Use TEXT for display, YEAR/MONTH/DAY for calculations. TEXT returns text strings that look good but cannot be used in math. YEAR, MONTH, and DAY return numbers you can use in formulas.

  2. Combine with DATE to modify dates. The pattern =DATE(YEAR(D2)+N, MONTH(D2), DAY(D2)) adds N years. This is the standard way to shift dates by years in Google Sheets.

  3. Use MONTH with conditional formatting. Highlight cells where =MONTH($D2) = MONTH(TODAY()) to flag dates in the current month. The rule updates automatically each month because TODAY() changes.

  4. ARRAYFORMULA with YEAR enables bulk analysis. =ARRAYFORMULA(YEAR(D2:D9)) returns a column of years. Use this inside COUNTIF, SUMIF, or QUERY to aggregate data by year without helper columns.

  5. Watch out for the DATE overflow. =DATE(2026, 13, 1) does not error, it returns 1/1/2027 because month 13 overflows to January of the next year. Google Sheets handles this gracefully, but it can produce unexpected results if your month math goes past 12.

Frequently Asked Questions

How do I extract the year from a date in Google Sheets?
Use =YEAR(A2) where A2 contains a date. For a date of 8/1/2018, YEAR returns 2018. The result is a four-digit number, not a date.
How do I get the month number from a date in Google Sheets?
Use =MONTH(A2). For 8/1/2018, MONTH returns 8. For 12/25/2026, it returns 12. The result is a number from 1 (January) to 12 (December).
How do I get the month name instead of the month number?
Use =TEXT(A2, "MMMM") for the full month name like August, or =TEXT(A2, "MMM") for the abbreviation like Aug. The TEXT function formats the date directly without needing MONTH.
How do I rebuild a date from separate year, month, and day values?
Use the DATE function: =DATE(year, month, day). For example, =DATE(YEAR(A2)+1, MONTH(A2), DAY(A2)) adds one year to the date in A2 by extracting each part, modifying the year, and reconstructing the date.
Can I use YEAR and MONTH with COUNTIF?
Yes. Use COUNTIF with ARRAYFORMULA to count dates by year or month. =COUNTIF(ARRAYFORMULA(YEAR(D2:D9)), 2018) counts how many dates in D2:D9 fall in 2018. For Sherlock Holmes and Inspector Lestrade (both hired 8/1/2018), the count is 2.

You read about Date Functions. Now type it.

Unit 1 of the course is free: 6 short lessons in a grid that checks every formula. They teach the Google Sheets skills you'll actually use.

Start the course free

First 6 lessons free. No card needed. See plans

Keep going

Continue learning

Unit 2 is next. Get full access

Practice this in the app

Practice Date Functions

Spot an error on this page? Tell us.

First 6 lessons free. No credit card required.

Start the course free
Continue learning

Cookie policy ยท Privacy policy