Formula Errors

Fix Excel SUMIF Returning Zero When Summing Expenses by Month, Category, and Subcategory

Olivia MillerOlivia Miller Oct 23, 2026 869 views

Question details

The user needs to calculate total expenses based on specific combinations of month, major category, and subcategory created with a dynamic array, but the summation formula is failing.

How to Sum Excel Expenses by Month, Category, and Subcategory
Product
Excel
Device & OS
not provided
Scenario
Attempting to total amounts corresponding to unique combinations of month, major category, and subcategory created via a dynamic array formula.
Observed behavior
The SUMIF function returns zeros instead of the actual total amounts for the corresponding categories.
Before you start

Before troubleshooting your SUMIF formula, verify that your date columns are formatted consistently (use =ISNUMBER() to check if they are recognized as real dates or text) and ensure there are no trailing spaces in your category text.

Solution 1Recommended

Correct the SUMIF Syntax and Array Ranges

Fix the SUMIF formula by ensuring the criteria array matches the concatenated range and the sum range is placed in the correct argument position.

When using SUMIF with dynamic arrays (like H2#), the syntax must strictly follow SUMIF(range, criteria, [sum_range]). Often, zeros are returned if the sum range and criteria range are swapped, or if their row limits do not match exactly.

1
Check row limits across all ranges

Ensure all your data ranges share the exact same row limits. For example, if your sum range is C2:C322, your criteria ranges must also start at row 2 and end at row 322.

2
Concatenate criteria arrays

Combine your source columns (Month, Category, Subcategory) inside the formula to match your dynamic array criteria format. Example: LEFT(A2:A322,2)&" "&E2:E322&" "&F2:F322.

3
Input the corrected SUMIF formula

Enter the formula placing the concatenated source array first, your dynamic criteria (H2#) second, and the amount column third. Example: =SUMIF(LEFT(A2:A322,2)&" "&E2:E322&" "&F2:F322, H2#, C2:C322).

Correct the SUMIF Syntax and Array Ranges
Data Format Matching: If a cell displays 'Jan 2022' but is formatted as a true date, using LEFT() will extract digits from its underlying serial number rather than text. Ensure your criteria strings match the source format exactly.
Easily Summarize Data with WPS Spreadsheet

Master Multi-Condition Summation in WPS Office

WPS Spreadsheet offers powerful functions like SUMIFS, dynamic arrays, and intuitive PivotTables to help you quickly calculate complex expenses without formula errors.

  1. 1. Open your data in WPS Spreadsheet: Launch WPS Office and open your expense tracker workbook.
  2. 2. Use the SUMIFS function: Select the cell for your total and type =SUMIFS(. This function is better suited for multiple conditions than SUMIF.
  3. 3. Define the sum range: Select the column containing your expense amounts as the first argument.
  4. 4. Add multiple criteria: Select your first criteria range (e.g., Month column) and the criteria cell, then repeat for Category and Subcategory. Press Enter to calculate.
100% compatibility with Microsoft Excel formulas, dynamic arrays, and formats.Intuitive PivotTable creation for fast multi-level categorization and data grouping.Lightweight software that easily handles large datasets without freezing.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my SUMIFS formula return a zero when summing by month?

This usually happens if the data formats do not match. If your source column contains real date values (serial numbers) but your criteria uses text (like 'Jan'), the formula won't find a match. Use the MONTH() function or ensure formats align perfectly.

What is the difference between SUMIF and SUMIFS?

SUMIF is designed for a single condition (e.g., sum amounts if Category is 'Food'). SUMIFS allows you to check multiple conditions simultaneously across different columns (e.g., Month is 'Jan' AND Category is 'Food').

How do I remove trailing spaces that cause formula mismatches?

Extra spaces prevent exact text matches in formulas. You can wrap your text ranges in the TRIM() function or use the Find and Replace tool (Ctrl+H) to remove extra spaces from your source data, ensuring your categories match the criteria perfectly.