How to Calculate Totals by Date and Category in Excel
Question details
The user needs a method to dynamically calculate totals or count values based on two specific conditions: a selected date and a specific category.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Summarizing log entries, dietary records, or sales data where multiple criteria (date and category) must be matched to calculate the final total.
- Observed behavior
- The user is looking for the most effective approach to summarize data, considering options like formula-based solutions (SUMIFS/COUNTIFS/PIVOTBY), Power Query, or PivotTables.
Ensure your source data is organized in a tabular format with clear column headers for Date, Category, and the Values you want to total. Formatting your data range as an official Excel Table (Ctrl+T) will ensure your formulas and PivotTables update dynamically when new rows are added.
Use SUMIFS or COUNTIFS Formulas for Fixed Summaries
The SUMIFS and COUNTIFS functions are ideal when you have a specific dashboard layout and need to calculate totals based on multiple criteria simultaneously.
SUMIFS is used to add numerical values that meet multiple conditions, while COUNTIFS counts the number of rows meeting those conditions. These formulas update instantly when source data changes.
Select two empty cells to act as your input fields. Type your target Date in one cell (e.g., G2) and your target Category in another (e.g., H2).
Select the cell where you want the total to appear. Type the formula: =SUMIFS(C:C, A:A, G2, B:B, H2). In this example, Column C contains the values to sum, Column A contains dates, and Column B contains categories.
Press Enter. Excel will instantly calculate the sum of values where the date and category exactly match your criteria.

Create an Interactive PivotTable
A PivotTable is the best choice if you want a complete, interactive overview of all dates and categories without writing any formulas.
Use Power Query to Transform and Summarize
Power Query is excellent for cleaning data and creating automated summary tables that fetch and aggregate data from external or internal sources.
Easily Summarize Data with WPS Spreadsheet
WPS Spreadsheet provides powerful built-in functions like SUMIFS, COUNTIFS, and intuitive PivotTables to help you calculate totals by date and category effortlessly. It delivers advanced data analysis without a subscription.
- 1. Open your data file: Launch WPS Spreadsheet and open your existing dataset containing the dates and categories.
- 2. Insert a PivotTable: Select your data range, navigate to the 'Insert' tab, and click 'PivotTable'.
- 3. Arrange your fields: In the side panel, drag your 'Date' and 'Category' fields into the Rows area, and drop your numerical field into the Values area.
- 4. Instantly view totals: WPS Spreadsheet will immediately generate a clean, organized table displaying your totals categorized by specific dates.

Frequently Asked Questions
Why does my SUMIFS formula return a #VALUE! error?
This usually happens when the criteria ranges (like Date_Range and Category_Range) and the sum range do not have the exact same number of rows and columns. Ensure all range references in your formula cover the same dimensions, such as A2:A100 and B2:B100.
Can I calculate totals by month instead of exact dates?
Yes. If using a PivotTable, you can right-click any date cell in the PivotTable and select 'Group', then choose 'Months'. If using formulas, you can add a helper column using the EOMONTH or MONTH function, and use that column for your SUMIFS criteria.
What is the difference between SUMIFS and COUNTIFS?
SUMIFS adds up the actual numerical values (e.g., total sales amount) in a specified range based on multiple criteria. COUNTIFS simply counts the number of rows or occurrences (e.g., number of transactions) that meet those criteria.
Do PivotTables automatically update when I insert new rows of data?
No, PivotTables do not update automatically in real-time. You need to right-click anywhere inside the PivotTable and select 'Refresh' so it can fetch the newly added data. Formatting your source data as a Table beforehand ensures the new rows are included in the refresh.




