How to calculate a year-to-date (YTD) total
✓ Verified in LibreOffice 25.8.7.3 ✓ Verified in Google Sheets (2026-08-30)Total everything from January 1 through today — YTD sales, expenses, or hours.
The formula
| App | Formula | Notes |
|---|---|---|
| Excel (desktop) | =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. We then ran the same formulas in Google Sheets, executed 2026-08-30: a formula-only workbook goes into Google Drive, which converts it to a Sheet and recalculates every formula with Google’s own engine, and comes back out as .xlsx carrying the values Google computed. It returned 250 for the worked example, the same value LibreOffice produced. Both engines’ numbers on this page are executed results. The Excel formula follows Microsoft’s official documented syntax — we do not run desktop Excel.
Functions used
SUMIFS · DATE · YEAR · TODAY — see full Excel, Google Sheets & LibreOffice compatibility for each.
Related recipes
- How to get the day number of the year (1-365)
- How to get the quarter-end date for any date
- How to sum values from the last 7 days
- How to sum with multiple criteria (SUMIFS)
- How to count business days left in the month