Add and count
Add up numbers for one year
=SUMPRODUCT((YEAR(A2:A4)=E2)*B2:B4)How it works in Excel
- YEAR pulls the year from each date.
- =E2 marks the rows in your chosen year.
- Multiplying keeps those numbers and zeroes the rest.
- A pivot table can group dates by year with no formula.
The idea in general
Sort the receipts into one year's pile, then add up that pile.
What I assumed
- The dates are in A2:A4, the numbers are in B2:B4 and the year is in E2.
Check the result on your own data before relying on it.