Spreadsheet Practice

YEAR formula generator

Describe what you need and get a working YEAR formula for Excel and Google Sheets, tested on real data before you copy it. YEAR returns the four-digit year from a date.

Tested YEAR examples

Each formula below was calculated on its own sample sheet. Open one to see the sheet, why it works, and to try it yourself.

Filter data by month

=FILTER(A2:E11,(MONTH(B2:B11)=MONTH(H1))*(YEAR(B2:B11)=YEAR(H1)))

Excel · result on the sample sheet: 4 rows (G3:K6)

Sum by year

=SUMIFS($C$2:$C$10,$A$2:$A$10,">="&DATE(E2,1,1),$A$2:$A$10,"<="&DATE(E2,12,31))

Excel · result on the sample sheet: 3 rows (F2:F4)

Sum by fiscal year

=SUMPRODUCT((YEAR(EDATE($A$2:$A$9,6))=E2)*$C$2:$C$9)

Excel · result on the sample sheet: 2 rows (F2:F3)

Questions

What does the YEAR formula generator do?

You describe the task in plain English, and it writes the formula, using YEAR where that's the right tool, for your table or a sample one. The formula is run in our engine in Excel and Google Sheets mode before you see it, so you get its result, not just a guess.

What does YEAR do?

YEAR returns the four-digit year from a date.

Can I learn to write YEAR formulas myself?

Yes. Each example below opens a page where you try the formula in a live grid and it's checked as you go, and the YEAR function page has a practice exercise.

More formula generators