Function Problems

How to Calculate Totals by Date and Category in Excel

Algirdas JasaitisAlgirdas Jasaitis Nov 10, 2026 869 views

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.

How to Calculate Totals by Date and Category in Excel
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.
Before you start

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.

Solution 1Recommended

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.

1
Prepare the criteria cells

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).

2
Enter the SUMIFS formula

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.

3
Press Enter to calculate

Press Enter. Excel will instantly calculate the sum of values where the date and category exactly match your criteria.

Use SUMIFS or COUNTIFS Formulas for Fixed Summaries
Microsoft 365 Users: If you are using Microsoft 365, you can also use the new PIVOTBY function to instantly generate a dynamic summary array without setting up manual grid coordinates.
Free Advanced Spreadsheet Tool

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. 1. Open your data file: Launch WPS Spreadsheet and open your existing dataset containing the dates and categories.
  2. 2. Insert a PivotTable: Select your data range, navigate to the 'Insert' tab, and click 'PivotTable'.
  3. 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. 4. Instantly view totals: WPS Spreadsheet will immediately generate a clean, organized table displaying your totals categorized by specific dates.
Fully compatible with Microsoft Excel (.xlsx, .xls) files and formulasSupports advanced functions including SUMIFS and dynamic arraysInteractive PivotTables for quick and accurate data summarizationFree, lightweight, and fast alternative for data analysis
microsoft office alternative - wps office

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.