Function Problems

How to Sum Rows Based on a Specific Column Condition in Excel

Huma Ashraf ChHuma Ashraf Ch Nov 10, 2026 868 views

Question details

Calculate the total across a two-dimensional range for rows where a specific column's cell matches a given condition without writing manual formulas for every row.

How to Sum Rows Based on a Specific Column Condition in Excel
Product
Excel
Device & OS
not provided
Scenario
Working with dynamic data across multiple columns and needing to automatically identify and sum rows based on a specific criteria.
Observed behavior
Needs a scalable formula solution to evaluate a condition across a target column and sum the corresponding row values.
Before you start

Ensure your data is organized in a clear, tabular format with consistent columns, and identify the exact column that contains the condition you want to test.

Solution 1Recommended

Use SUMPRODUCT to Sum Rows Based on a Single Column

Use the SUMPRODUCT function to multiply a boolean array (the condition) by the numeric array, resulting in the sum of only the matching rows.

The SUMPRODUCT function is ideal for evaluating conditions without requiring Ctrl+Shift+Enter array formulas. It processes the criteria check and the summation natively.

1
Identify criteria and value ranges

Determine your condition column (e.g., A2:A6) and your numeric values range (e.g., B2:K6) in your spreadsheet.

2
Enter the SUMPRODUCT formula

In your result cell, type =SUMPRODUCT((A2:A6="D")*B2:K6). Replace "D" with your specific text or numeric condition.

3
Calculate the result

Press Enter to calculate. The formula will evaluate which rows in A2:A6 equal 'D' and sum all corresponding row values in the B2:K6 range.

Use SUMPRODUCT to Sum Rows Based on a Single Column
Formula Breakdown: The expression (A2:A6="D") creates an array of TRUE/FALSE values. When multiplied by the values range B2:K6, it converts TRUE to 1 and FALSE to 0, zeroing out the rows that do not match and leaving only the required values to be summed.
Seamless Data Analysis in WPS Spreadsheet

Calculate Conditional Sums Instantly in WPS Office

WPS Spreadsheet offers full support for advanced array formulas, including SUMPRODUCT and MMULT, making it incredibly easy to perform complex conditional row sums. With a familiar interface and comprehensive function library, you can manage and analyze your data seamlessly.

  1. 1. Open your worksheet in WPS Spreadsheet: Launch WPS Office and open your Excel spreadsheet containing the data.
  2. 2. Enter the SUMPRODUCT formula: Select a blank cell and type the formula =SUMPRODUCT((A2:A6="D")*B2:K6) matching your data ranges.
  3. 3. Get your results: Press Enter to instantly see the calculated sum across the rows meeting your condition.
Fully supports advanced Excel functions like SUMPRODUCT and MMULT.100% compatible with Microsoft Excel (.xlsx, .xls) formats.Fast calculation engine to handle large two-dimensional data arrays.Free, lightweight, and easy to navigate with a familiar tabbed interface.
microsoft office alternative - wps office

Frequently Asked Questions

Why is my SUMPRODUCT formula returning a #VALUE! error?

This usually happens if the criteria range (e.g., A2:A6) and the sum range (e.g., B2:K6) do not have the same number of rows. Ensure that the row dimensions of both ranges match exactly. It can also occur if there is text in the numerical sum range.

Can I use multiple conditions in SUMPRODUCT?

Yes, you can add more conditions by multiplying them together. For example, =SUMPRODUCT((A2:A6="D")*(C2:C6="Yes")*B2:K6) will sum the rows where column A is 'D' and column C is 'Yes'.

Can I reference a cell instead of hardcoding the condition "D"?

Absolutely. Instead of typing "D" directly into the formula, you can reference a cell like M1. The formula becomes =SUMPRODUCT((A2:A6=M1)*B2:K6), which makes it much easier to change criteria dynamically.

Does SUMPRODUCT require me to press Ctrl+Shift+Enter?

No, SUMPRODUCT is designed to handle arrays natively. You can simply press Enter after typing the formula, unlike older array formulas that required Ctrl+Shift+Enter.