What you will learn
- Get the year, month and day from a date
How it works
=YEAR(A2), =MONTH(A2) and =DAY(A2) pull out each part.
Formulas at a glance
=YEAR(A2) | The pattern to follow |
=MONTH(A2) | The pattern to follow |
=DAY(A2) | The pattern to follow |
Example
Write the formula to get the year from the first birthday.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Birthday | Year | Month | Day | Due date | Due month | |
| 2 | 4/12/2014 | 9/15/2026 | |||||
| 3 | 11/3/2013 | 10/2/2026 | |||||
| 4 | 7/28/2014 | 12/18/2026 | |||||
| 5 | 1/9/2015 | 2/27/2027 |
Click B2 and type =YEAR(A2), then press Enter.
The answer is 2014.
When to use it
- Grouping sales by month
- Finding birthdays in a month
- Splitting a date into columns
Common mistakes
- Using them on text that looks like a dateThe cell must be a real date. Check that it lines up on the right.
- Expecting a month nameMONTH gives a number. Use TEXT(A2,"mmmm") for the name.
- Forgetting the parenthesesWrite =YEAR(A2).
Practice it on a real sheet
Reading is a start. Doing it is how it sticks. This lesson walks you through every click on a live spreadsheet and checks each answer.