Table of Contents
In the realm of advanced data analysis and financial reporting, the ability to accurately aggregate numerical values across specific time periods is a fundamental requirement. Microsoft Excel offers powerful tools specifically designed to meet this challenge, enabling analysts to summarize transactions or measurements categorized by both month and year simultaneously. This technique is absolutely indispensable for anyone tasked with generating robust periodic reports, tracking detailed sales trends, or monitoring budgetary expenditures over extended timelines.
Imagine a scenario where you are presented with a voluminous, raw dataset containing thousands of daily sales figures. The core objective is not merely to find a grand total, but rather to calculate the precise summation of sales volume corresponding to each unique month-year combination within the data. Executing this transformation moves the data from its raw, granular transactional state into meaningful, high-level summarized statistics essential for executive review and strategic planning.

This comprehensive, four-step tutorial provides the precise methodology—utilizing advanced formulas and functions—required to execute this conditional aggregation efficiently within the Excel environment. We will demonstrate how to transform complex, daily date fields into usable, consistent criteria necessary for accurate summation.
Step 1: Structuring and Preparing the Source Data
The initial and most critical phase of any analytical task is ensuring the underlying data is correctly structured and formatted within the spreadsheet. For successful time-based aggregation, the dataset must contain at least two primary columns: one dedicated to the full transaction date (which must be recognized by Excel as a valid date serial number) and another containing the corresponding numerical value (e.g., sales, costs, or measurements) intended for summation. Accurate date formatting is paramount, as misformatted dates will prevent subsequent extraction and calculation steps from functioning correctly.
As depicted in the illustration below, we will organize our source data with transaction dates housed in Column A and the associated sales values placed in Column B. This layout establishes the foundational structure upon which all subsequent calculations will depend. We proceed under the assumption that the entries in Column A are correctly interpreted by Excel, allowing the system to decompose the numerical components (day, month, and year) necessary for the next stage of processing.

This preparation step concludes once all relevant data points—spanning the date range and numerical values—are clearly defined and entered. Only after verifying the integrity and formatting of this data can we move on to the crucial process of creating an intermediary column dedicated solely to generating uniform aggregation criteria.
Step 2: Extracting Uniform Criteria Using the TEXT Function
A frequent pitfall when attempting to sum by specific temporal periods is trying to use the raw date column directly as the criteria. Since standard Excel dates include day information (e.g., March 5, 2023, is numerically distinct from March 10, 2023), a simple conditional sum would fail to group all entries for the same month and year. To overcome this inherent limitation, we must generate a uniform text string criterion that represents only the month and year, effectively ignoring the day component. This extraction is efficiently managed using the powerful TEXT function.
The TEXT function serves to convert a numerical value, such as an Excel date serial number, into a text string based on a specified format code. We will input this formula into Column C, starting in cell C2, to extract the relevant month and year from the date listed in cell A2. The format code "mmm yyyy" is specified to instruct Excel to output the three-letter abbreviated month name followed by the full four-digit year (e.g., “Feb 2023”). This produces a consistent criteria string required for aggregation.
The precise formula applied to cell C2 is structured as follows:
=TEXT(A2, "mmm yyyy")
Once the formula is entered, we utilize Excel’s convenient fill handle functionality—by clicking and dragging the formula down—to apply this extraction logic across the entirety of our raw sales data. This action populates Column C with the necessary aggregation criteria, creating a cohesive list of combined month and year indicators that will be essential for the final summation step.

Step 3: Defining Unique Groupings with the UNIQUE Function
With Column C now successfully established as our conditional criteria column, the subsequent requirement is to systematically identify every unique month-year grouping present within the dataset. It is impossible to proceed with the summation until we have a definitive, non-redundant list of categories against which to match our sales data. Fortunately, modern versions of Microsoft Excel streamline this task significantly through the implementation of the dynamic array UNIQUE function.
The UNIQUE function automatically scans the designated range—in this instance, the newly created text strings in Column C—and returns a “spill array” containing only the items that appear once. This eliminates the need for cumbersome manual filtering, pivoting, or utilizing older, less efficient methods like “Remove Duplicates,” thereby dramatically accelerating the preparation workflow. We will place this function in cell E2 to generate our consolidated list of unique aggregation criteria. It is critical to reference the full range of the criteria text strings created in the previous step (C2 through C15).
The formula employed to extract the comprehensive list of unique month and year combinations is remarkably simple:
=UNIQUE(C2:C15)
Upon execution, this single formula dynamically populates cells E2 downwards with the distinct categories. This crucial step prepares the groundwork for the final aggregation by establishing the exact reporting structure. Each item in this list, displayed clearly in Column E, represents a summary row awaiting its corresponding calculated total sales figure.

Step 4: Performing Conditional Summation with SUMIF
The fourth and final step involves leveraging the SUMIF function to conditionally sum the values found in the sales column (Column B) based on the unique temporal criteria established in Column E. The SUMIF function requires three essential arguments: first, the range to check the criteria against (the month/year strings in Column C); second, the specific criterion to match (the unique month/year string in Column E); and third, the actual range of values to sum (the sales figures in Column B).
We initiate this pivotal calculation in cell F2, immediately adjacent to the first unique criteria entry (“Jan 2022”). It is imperative to use absolute references (indicated by the dollar signs, e.g., $C$2:$C$15) for both the criteria range and the sum range. Absolute referencing guarantees that when the formula is subsequently copied down to process other months, these data ranges remain fixed, thereby preventing range shifting errors. In contrast, the reference to the criteria cell itself (E2) must remain relative, allowing it to correctly shift and check “May 2022” in cell F3, “Jun 2022” in cell F4, and so forth.
The final, robust formula structured to calculate the sum of sales corresponding to the specific month/year listed in E2 is:
=SUMIF($C$2:$C$15, E2, $B$2:$B$15)
Once the formula is correctly entered into cell F2, the final mechanical step is to use the fill handle to copy this function down column F. Excel automatically adjusts the relative reference (E2, E3, etc.) while meticulously preserving the absolute references for the data ranges, successfully yielding the total sales aggregated by the defined month and year periods.

Summary of Results and Analytical Review
The resulting output generated in Column F provides a concise, summarized view of the sales performance categorized precisely by the extracted month and year combinations. This structured output holds significantly more analytical value for reporting and trend identification than the original raw transactional dataset. By strategically utilizing the TEXT function and the UNIQUE function to forge accurate criteria, we successfully deployed the SUMIF function to achieve flawless conditional aggregation.
A quick review of the final aggregated data immediately allows for insights into the total sales volume for each specific reporting period:
- The total aggregated sales for January 2022 amounted to 33 units.
- Sales volume witnessed a significant increase in May 2022, reaching a total of 60 units.
- The sales figures for June 2022 stabilized at 20 units.
This systematic four-step methodology—encompassing data preparation, criteria extraction, unique criteria identification, and final conditional summation—serves as a robust, repeatable, and highly scalable solution for handling complex time-based aggregation tasks within Microsoft Excel.
Advanced Considerations and Further Learning
Mastering conditional aggregation using these core formulas is a foundational skill for aspiring advanced Excel users. It is important to note that should your analysis requirements involve summing data based on multiple criteria simultaneously (for example, aggregating by month, year, AND specific sales region), you would typically need to transition from the simpler SUMIF function to the more versatile and powerful SUMIFS function.
The following curated tutorials offer further guidance on related complex operations within Excel, helping to extend your core analytical capabilities:
Cite this article
Mohammed looti (2025). Learning to Summarize Data by Month and Year in Excel. PSYCHOLOGICAL STATISTICS. Retrieved from https://statistics.arabpsychology.com/excel-sum-values-by-month-and-year/
Mohammed looti. "Learning to Summarize Data by Month and Year in Excel." PSYCHOLOGICAL STATISTICS, 9 Nov. 2025, https://statistics.arabpsychology.com/excel-sum-values-by-month-and-year/.
Mohammed looti. "Learning to Summarize Data by Month and Year in Excel." PSYCHOLOGICAL STATISTICS, 2025. https://statistics.arabpsychology.com/excel-sum-values-by-month-and-year/.
Mohammed looti (2025) 'Learning to Summarize Data by Month and Year in Excel', PSYCHOLOGICAL STATISTICS. Available at: https://statistics.arabpsychology.com/excel-sum-values-by-month-and-year/.
[1] Mohammed looti, "Learning to Summarize Data by Month and Year in Excel," PSYCHOLOGICAL STATISTICS, vol. X, no. Y, ص Z-Z, November, 2025.
Mohammed looti. Learning to Summarize Data by Month and Year in Excel. PSYCHOLOGICAL STATISTICS. 2025;vol(issue):pages.