How can I use the “Sum by Week” function in Google Sheets?

The “Sum by Week” function in Google Sheets allows users to quickly and accurately calculate the total sum of values for each week in a given data set. This function is particularly useful for organizing and analyzing large amounts of data, as it automatically groups the data by week and calculates the sum for each week. By using the “Sum by Week” function, users can easily identify trends and patterns in their data, making it a valuable tool for data analysis and decision making. This function is easy to use and can be accessed through the “Data” menu in Google Sheets.

Sum by Week in Google Sheets (With Example)


Often you may want to sum the values of some dataset in Google Sheets based on week.

The following step-by-step example shows how to do so.

Step 1: Enter the Data

First, enter the values for a dataset that show the total sales of some product on various dates:

Step 2: Extract the Week from Dates

Next, we will use the WEEKNUM function to extract the week from each date.

In our example, we’ll type the following formula in cell D2:

=WEEKNUM(A2)

We’ll then drag and fill this formula down to every remaining cell in column D:

Step 3: Find the Unique Weeks

Next, we need to use the UNIQUE function to produce a list of unique weeks.

In our example, we’ll type the following formula in cell E2:

=UNIQUE(D2:D12)

This will produce a list of unique weeks:

Step 4: Calculate the Sum by Week

Next, we will use the SUMIF(range, criterion, sum_range) function to find the sum of the sales made during each week.

In our example, we’ll type the following formula in cell F2:

=SUMIF($D$2:$D$12, E2, $B$2:$B$12)

We’ll then drag and fill this formula down to the remaining cells in column F:

From the output we can see

  • There were 22 total sales made in the first week of the year.
  • There were 24 total sales made in the second week of the year.
  • There were 63 total sales made in the third week of the year.

And so on.

Additional Resources

The following tutorials explain how to perform other common tasks in Google Sheets:

How to Calculate Year to Date Values in Google Sheets

x