Gabriel Ideas Written by Gabriel

Year-to-Date Formula in Google Sheets

By Gabriel Aug 06, 2026
Date Calculator Spreadsheet | Add Days, Weeks, Months, Years & Hours | Google Sheets Template | Countdown and  Future Date Tool
Date Calculator Spreadsheet | Add Days, Weeks, Months, Years & Hours | Google Sheets Template | Countdown and Future Date Tool

Have you ever found yourself regularly calculating Year-to-Date (YTD) sums in Google Sheets? This can become tedious and prone to error, especially when dealing with large datasets. But what if I told you there's a straightforward, automated way to do this using a simple formula? Let's explore how to harness the power of Google Sheets to automate your YTD calculations.

Date Calculator Spreadsheet | Add Days, Weeks, Months, Years & Hours | Google Sheets Template | Countdown and  Future Date Tool
Date Calculator Spreadsheet | Add Days, Weeks, Months, Years & Hours | Google Sheets Template | Countdown and Future Date Tool

Before diving into the formula, it's crucial to understand that YTD refers to the cumulative total of a set of values up to a specific point in time, typically the current date. By using Google Sheets' in-built functions, we can create a dynamic YTD formula that updates itself each time data is added or removed.

the date function is used to show how many numbers are in each column and where they are
the date function is used to show how many numbers are in each column and where they are

Handling Data with Structured Headers

For the YTD formula to work correctly, your data should have structured headers. Here's a simple layout to follow:

the datedif function calculator is displayed in this screenshot from microsoft
the datedif function calculator is displayed in this screenshot from microsoft

DateValue
2022-01-1550
2022-02-1035

Sorting Data by Date

How to Sort by Date in Google Sheets
How to Sort by Date in Google Sheets

Before applying the YTD formula, ensure your data is sorted by date in ascending order. This is crucial for the formula to function accurately.

To sort, select your data, click on 'Data' in the menu, then 'Sort A-Z' or 'Sort Z-A' depending on your desired order. Once sorted, you can proceed to apply the YTD formula.

Applying the Year-to-Date Formula

How to make a monthly calendar printable using Google Sheets (online tool similar to Excel)
How to make a monthly calendar printable using Google Sheets (online tool similar to Excel)

Now, it's time to apply the YTD formula. Click on a cell where you want the YTD total to appear, then enter the following:

=SUMIF(INDIRECT("A2:B"&ROW()),A2:A, B2:B)

Automating the Formula for Multiple YTD Totals

The Ultimate Google Sheets Formulas Cheat Sheet
The Ultimate Google Sheets Formulas Cheat Sheet

What if you want to calculate YTD totals for multiple values or dates? You can automate this process by using a simple table structure and indirect references.

Create a table with headers '.unique_value' and 'YTD'. Then, in the 'YTD' column, enter the YTD formula using indirect references for both the range of unique values and the range of dates and values:

an image of a calendar in microsoft office 365 with the date and time tab open
an image of a calendar in microsoft office 365 with the date and time tab open
a green and white poster with the words eonoth function on it's side
a green and white poster with the words eonoth function on it's side
a green and white sign that says today function returns the current date, updated continuously when a worksheet is changed or opened
a green and white sign that says today function returns the current date, updated continuously when a worksheet is changed or opened
a green and white poster with the date for day function on it's side
a green and white poster with the date for day function on it's side

=SUMIF(INDIRECT("A2:A"&ROW()),A2:A, B2:B)

This way, each unique value in your 'unique_value' column gets a dynamic YTD total.

Expanding the Unique Values

Now, let's say you want to calculate YTD totals for even more unique values. You can do this by duplicating the 'unique_value' column and applying the YTD formula to each new value. The formula will adjust automatically due to the indirect references.

For example, if you initially had unique values 'Value1' and 'Value2', adding 'Value3' to the 'unique_value' column would result in a new YTD total for 'Value3'.

And there you have it! With these steps, you've learned how to calculate Year-to-Date sums in Google Sheets using a simple yet powerful formula. Not only does this save you time, but it ensures accuracy and eliminates human error. Now, whenever you need to calculate YTD sums, you can do so with confidence and efficiency.