How to use YEAR, MONTH, DAY in Excel
YEAR, MONTH and DAY extract one part of a date as a number. Use them to group sales by year or month, build reports per period or create new dates.
Syntax
=YEAR(date) · MONTH(date) · DAY(date)
serial_number | A date (cell or formula) — the same argument for all three functions. |
Examples
=YEAR(A2)2025 from 15-Mar-2025.=MONTH(A2)3 from 15-Mar-2025.=DAY(A2)15 from 15-Mar-2025.=SUMPRODUCT((YEAR(A2:A100)=2025)*C2:C100)Total sales in 2025.Common mistakes
- #VALUE! error
- The "date" is actually text. Convert it with DATEVALUE or rebuild it with DATE.
- Month as a name
- MONTH returns 3, not "March". Use
TEXT(A2, "mmmm")for the name.
Available in: All versions of Excel, Excel for the web, Google Sheets