Function Problems

Use Excel SUMIFS for Two Matching Row and Column Conditions

Muhammad TalhaMuhammad Talha Nov 12, 2026 869 views

Question details

Create a SUMIFS formula that adds values only when two criteria, such as a row condition and a column condition, both match.

Use Excel SUMIFS for Two Matching Row and Column Conditions
Product
Microsoft Excel
Device & OS
not provided
Scenario
The user needs to total values in column C for records whose values in columns A and B match the criteria listed in columns A and B of a summary row.
Observed behavior
The desired result is a separate total for each criteria pair, with the formula filled down through the summary list.
Before you start

Confirm that the sum range and every criteria range cover the same number of rows. Check that the criteria values in the source data and summary rows use matching text, numbers, and date formats.

Solution 1Recommended

Use SUMIFS with two criteria ranges and fill the formula down

Use this method when each total depends on an exact match in both the first and second criteria columns.

SUMIFS evaluates every criteria pair together. It adds a value from column C only when the value in column A matches the first criterion and the value in column B matches the second criterion.

1
Select the first total cell

Click cell C44, or select the first cell where the two-condition total should appear.

2
Enter the two-condition SUMIFS formula

Type =SUMIFS($C$2:$C$30,$A$2:$A$30,A44,$B$2:$B$30,B44) and press Enter. Column C is the sum range, while columns A and B are the criteria ranges.

3
Verify the range sizes

Make sure $C$2:$C$30, $A$2:$A$30, and $B$2:$B$30 start and end on the same rows. SUMIFS returns an error or incorrect result when the paired ranges are not aligned.

4
Copy the formula to other criteria pairs

Select C44 and drag the fill handle downward, or copy C44 and paste it into the remaining total cells. The fixed source ranges stay unchanged while A44 and B44 adjust for each row.

Use SUMIFS with two criteria ranges and fill the formula down
Formula result: The formula totals only records where both criteria match. For example, a row is included only if its column A value equals A44 and its column B value equals B44.
Work with formulas in WPS Spreadsheets

Calculate Two-Criteria Totals with SUMIFS in WPS Spreadsheets

WPS Spreadsheets lets you build the same two-condition SUMIFS formula, copy it down a report, and work with Excel-compatible workbook formats. Enter the formula once, then use the fill handle to calculate totals for every criteria pair.

  1. 1. Open the worksheet in WPS Spreadsheets: Open the workbook and select the worksheet containing the source columns and the summary criteria rows.
  2. 2. Choose the first summary total cell: Click cell C44, or select the first output cell beside the criteria values.
  3. 3. Enter the SUMIFS formula: In the formula bar, enter =SUMIFS($C$2:$C$30,$A$2:$A$30,A44,$B$2:$B$30,B44), then press Enter.
  4. 4. Fill the formula through the report: Select the completed cell and drag its fill handle down to calculate each remaining pair of criteria.
Use SUMIFS to total records that match two conditions.Fill formulas down quickly with relative and absolute cell references.Open, edit, and save Microsoft Excel .xlsx and .xls files.Use a familiar spreadsheet interface for formulas, functions, and data summaries.
microsoft office alternative - wps office

Frequently Asked Questions

How does SUMIFS apply two matching conditions in Excel?

SUMIFS checks each criteria range on the same source row. In =SUMIFS(C2:C30,A2:A30,A44,B2:B30,B44), Excel adds a value from column C only when column A equals A44 and column B equals B44.

Why must SUMIFS ranges be the same size?

Excel compares positions across the sum range and criteria ranges row by row. Use matching ranges such as C2:C30, A2:A30, and B2:B30; do not pair C2:C30 with A2:A29.

How do I copy a SUMIFS formula down without changing the data ranges?

Use dollar signs to lock the source ranges, such as $C$2:$C$30, $A$2:$A$30, and $B$2:$B$30. Then drag the fill handle down so the criteria references A44 and B44 change to the next row.

Can SUMIFS match text and dates as two criteria?

Yes. Put the text criterion in one criteria cell and the date criterion in another, then reference both cells in SUMIFS. Ensure source dates are real date values rather than text strings.