Table of Contents
In the demanding world of business intelligence and data aggregation, raw transactional records often require systematic transformation before they yield meaningful insights. One of the most common and vital requirements for performance tracking is calculating the sum of key metrics—such as revenue, sales volume, or operational costs—by grouping them into standardized weekly periods. This process is crucial for identifying trends, measuring weekly performance against targets, and providing stakeholders with clear, actionable reports.
When utilizing Google Sheets as the primary analytical environment, achieving this precise weekly summarization requires more than just simple sorting. While the platform offers powerful tools like pivot tables, mastering a formula-based approach provides superior customization and control, allowing you to seamlessly integrate these calculations into sophisticated dashboards. This guide provides a comprehensive, expert-level walkthrough detailing the exact methodology for summarizing numerical values based on the corresponding week number within your spreadsheet.
We will break down the calculation into three primary, interdependent steps, utilizing three core Google Sheets functions to move from raw daily data to a clear, aggregated weekly report.
Setting Up the Raw Dataset in Google Sheets
The foundation of any successful time-series analysis is properly structured source data. Before attempting any weekly grouping or summation, you must ensure your dataset is correctly organized. For weekly summarization to be effective, your sheet must contain at least two essential columns: the specific date of the transaction or event, and the corresponding numerical value you wish to aggregate (the metric, such as sales figures or units produced).
It is absolutely critical that the column designated for dates is formatted as valid date values within Google Sheets. If the system interprets these entries as simple text strings, all subsequent temporal extraction functions will inevitably fail. Similarly, confirm that the numerical column contains only quantifiable data. For this illustrative example, we track daily sales totals for a specific product over a short period. This initial setup provides the necessary structure to begin the date manipulation required for effective weekly aggregation.
The visualization below shows our initial data structure, with transactional dates residing in Column A and the corresponding sales volume figures in Column B:

Converting Dates to Week Numbers Using the WEEKNUM Function
Because Google Sheets cannot natively group data based on the abstract concept of a “week,” we must first convert every specific date into a standardized, numerical week identifier. This conversion process generates the common criterion that is absolutely essential for performing subsequent conditional summation. The primary tool for this crucial step is the powerful WEEKNUM function.
The WEEKNUM function accepts a date input and returns an integer that represents which week of the year that date falls into (ranging typically from 1 to 52 or 53). While the function supports an optional argument to define the start day of the week (e.g., Sunday vs. Monday), the default setting is usually adequate for basic reporting needs. By employing this function, we effectively transform complex date formats into simple, numerical categories that are easily grouped and aggregated.
To implement this, we introduce a new helper column (Column D in our layout), which we label “Week Number.” We apply the formula to the first date in our dataset. Specifically, we input the following formula into cell D2, referencing the date contained in cell A2:
=WEEKNUM(A2)
Once the week number for the initial row is successfully calculated, we propagate this formula down the entire length of the dataset in Column D. This action systematically assigns a corresponding week number to every date entry, preparing the data for the next phase. This new column now serves as the critical grouping field required for our conditional total calculation using the SUMIF function.

Extracting Distinct Weekly Criteria with the UNIQUE Function
With every date now categorized by its week number, the next step in the data aggregation process is to identify the non-redundant categories—the unique week numbers—by which we intend to summarize the sales data. Our objective is to generate a report showing sales for each distinct week present in the raw data, meaning we must isolate a clean, non-duplicated list of these week numbers. Without this step, we would lack the necessary criteria to drive the final summation.
For this purpose, we leverage the highly efficient UNIQUE function in Google Sheets. The UNIQUE function quickly scans a specified range and automatically returns a vertically oriented list that contains only the non-duplicate entries. This is a powerful dynamic array formula, meaning it automatically ‘spills’ the results across multiple rows, eliminating the tedious need for manual filtering or sorting the data.
In our example, we designate cell E2 as the starting point for our unique week list. We instruct the function to analyze the entire calculated week number range in Column D (D2 through D12), applying the following concise syntax:
=UNIQUE(D2:D12)
Executing this formula produces a clean list in Column E, consisting solely of the distinct week numbers found in the original dataset (e.g., Week 1, Week 2, Week 3). This column now serves as the definitive list of criteria against which we will calculate the conditional sales totals in the subsequent final step.

Executing the Conditional Summation with the SUMIF Function
With the unique grouping criteria now neatly established in Column E, we are prepared to perform the final calculation. This step uses the SUMIF function, a fundamental tool designed to sum values in a specified range only when a single condition is met in a corresponding criteria range. Understanding the structure of SUMIF is crucial: it requires three arguments formatted as SUMIF(range, criterion, sum_range).
For our weekly summation, the arguments are specifically defined as follows: the range is the column containing all the week numbers we must check (Column D); the criterion is the specific unique week number we are currently summing for (the value in the current row of Column E); and the sum_range is the column holding the actual numerical values we wish to total (our sales figures in Column B). A paramount consideration when implementing this formula across multiple rows is the correct application of absolute references (denoted by the dollar sign, $) for the ranges that must remain fixed.
We initiate the calculation in cell F2. The formula must instruct Google Sheets to search all week numbers (D2:D12), find entries matching the unique week in E2, and then sum the corresponding sales values (B2:B12). This results in the following highly efficient formula structure:
=SUMIF($D$2:$D$12, E2, $B$2:$B$12)
Note the deliberate use of absolute references ($D$2:$D$12 and $B$2:$B$12). This ensures that when the formula is dragged down to calculate the totals for Week 2, Week 3, and so on, the search range and the sum range remain completely fixed. Conversely, the criterion cell (E2) is a relative reference, allowing it to dynamically update to E3, E4, etc., for each calculation row. This application of the SUMIF function effectively aggregates the sales data based on the assigned week number.
The final action is to drag and fill this formula down Column F to compute the total sales corresponding to every unique week identified in Column E:

Analyzing the Final Weekly Aggregated Results
The resulting data set in Column F provides a concise, high-level summary of the sales performance, grouped precisely by the week number extracted in the initial step. This aggregated format is vastly superior for reporting and performance monitoring compared to the original, verbose row-by-row transactional data. The structured process successfully converted a long list of individual daily sales into a clear, structured weekly report.
From the final output displayed in our example, key business conclusions can be rapidly drawn regarding sales performance across the observed period:
- The total sales volume recorded during Week 1 of the dataset was 22 units.
- Sales volume during Week 2 totaled 24 units, showing minimal increase.
- Sales volume during Week 3 surged to 63 units, indicating a significant upward trend and potential high-performance period that warrants further investigation.
This repeatable methodology guarantees accuracy and reliability when performing weekly roll-ups, regardless of the complexity or volume of the underlying transactional data. By seamlessly integrating the date-extraction power of the WEEKNUM function, the efficiency of the UNIQUE function, and the conditional summation logic of the SUMIF function, analysts can effectively transform granular data into essential weekly business intelligence reports.
Additional Resources for Time Series Analysis
To further expand your proficiency in advanced data manipulation and time series analysis within Google Sheets, we recommend exploring these related tutorials focused on common computational tasks:
Cite this article
Mohammed looti (2025). Learning to Calculate Weekly Sums in Google Sheets: A Step-by-Step Guide. PSYCHOLOGICAL STATISTICS. Retrieved from https://statistics.arabpsychology.com/sum-by-week-in-google-sheets-with-example/
Mohammed looti. "Learning to Calculate Weekly Sums in Google Sheets: A Step-by-Step Guide." PSYCHOLOGICAL STATISTICS, 11 Nov. 2025, https://statistics.arabpsychology.com/sum-by-week-in-google-sheets-with-example/.
Mohammed looti. "Learning to Calculate Weekly Sums in Google Sheets: A Step-by-Step Guide." PSYCHOLOGICAL STATISTICS, 2025. https://statistics.arabpsychology.com/sum-by-week-in-google-sheets-with-example/.
Mohammed looti (2025) 'Learning to Calculate Weekly Sums in Google Sheets: A Step-by-Step Guide', PSYCHOLOGICAL STATISTICS. Available at: https://statistics.arabpsychology.com/sum-by-week-in-google-sheets-with-example/.
[1] Mohammed looti, "Learning to Calculate Weekly Sums in Google Sheets: A Step-by-Step Guide," PSYCHOLOGICAL STATISTICS, vol. X, no. Y, ص Z-Z, November, 2025.
Mohammed looti. Learning to Calculate Weekly Sums in Google Sheets: A Step-by-Step Guide. PSYCHOLOGICAL STATISTICS. 2025;vol(issue):pages.