How to calculate a year-to-date (YTD) total
✓ Verified in LibreOffice 25.8.7.3Total everything from January 1 through today — YTD sales, expenses, or hours.
The formula
| App | Formula | Notes |
|---|---|---|
| Excel | =SUMIFS(B2:B100,A2:A100,">="&DATE(YEAR(TODAY()),1,1),A2:A100,"<="&TODAY()) | A = dates, B = amounts. DATE(YEAR(TODAY()),1,1) is Jan 1 of the current year. |
| Google Sheets | =SUMIFS(B2:B100,A2:A100,">="&DATE(YEAR(TODAY()),1,1),A2:A100,"<="&TODAY()) | Identical. |
| LibreOffice Calc | =SUMIFS(B2:B100,A2:A100,">="&DATE(YEAR(TODAY()),1,1),A2:A100,"<="&TODAY()) | Identical. |
How it works
YTD is a date-range SUMIFS whose start is January 1 of the current year and whose end is today: DATE(YEAR(TODAY()),1,1) computes Jan 1 without hardcoding the year, so it rolls into the new year automatically. In the verification the window is Jan 1-Jul 30, 2026, and the two 2026 rows total 200+50 = 250 while the prior-year row (serial 45900) is excluded. Same-period-last-year for comparison just shifts both bounds back a year with EDATE(...,-12) or DATE(YEAR(TODAY())-1,...). For fiscal years that don't start in January, replace the Jan 1 with your fiscal start date.
Verified, not just documented
We ran =SUMIFS(B2:B4,A2:A4,">="&DATE(2026,1,1),A2:A4,"<="&DATE(2026,7,30)) in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned 250 — exactly the expected result. Every formula here is confirmed by actually executing it.