Function Problems

Use Excel SUMIF to Sum Quantities for a Specific Product

John WilsonJohn Wilson Nov 18, 2026 869 views

Question details

Calculate the total quantity for one product by matching its code or description.

How to Sum Quantities for a Specific Product with Excel SUMIF
Product
Microsoft Excel
Device & OS
not provided
Scenario
A worksheet contains product descriptions or codes and quantities, and the user wants a total for a selected product.
Observed behavior
The desired result is the sum of quantities in rows where the product identifier matches the selected value.
Before you start

Identify the column containing product descriptions or codes and the column containing quantities. In this example, descriptions are in column C, quantities are in column E, and the selected description will be entered in M2.

Solution 1Recommended

Sum matching product quantities with Excel SUMIF

Use SUMIF to add quantities for every row that matches the selected product.

1
Enter the product

In cell M2, type the product description you want to total, using the same wording as the entries in column C.

2
Enter the formula

Select cell N2 and enter =SUMIF(C:C,M2,E:E), then press Enter.

3
Check the result

Review the total in N2. Change the value in M2 to calculate the total for another product.

Sum matching product quantities with Excel SUMIF
Using different columns: Replace C:C with the column containing product codes or descriptions and E:E with the quantity column. Replace M2 if the selected product is in a different cell.
Calculate product totals

Sum product quantities with SUMIF in WPS Spreadsheets

Use the same SUMIF formula in WPS Spreadsheets to total quantities for a selected product.

  1. 1. Open the workbook: Open WPS Spreadsheets and use Open to select your workbook.
  2. 2. Enter the product: Type the product description in M2, matching the descriptions in column C.
  3. 3. Calculate the total: Select N2, enter =SUMIF(C:C,M2,E:E), and press Enter to sum the matching quantities in column E.
  4. 4. Save your changes: Use File > Save to save the workbook with the formula.
Total matching product quantities with SUMIFOpen and edit Microsoft Excel XLSX and XLS filesUpdate the result by changing the selected productWork in a familiar spreadsheet interface
microsoft office alternative - wps office

Frequently Asked Questions

Can I use a product code instead of a description?

Yes. Enter the product code in M2 and use the code column as the first SUMIF argument. For example, if codes are in column B and quantities are in column E, enter =SUMIF(B:B,M2,E:E).

Why does my SUMIF formula return zero?

Check that M2 matches the product entries in the criteria column and that the quantities are stored as numbers. Also confirm that the formula refers to the correct product and quantity columns.

Does SUMIF distinguish between uppercase and lowercase letters?

No. SUMIF matches text without distinguishing between uppercase and lowercase letters.

Can I limit the formula to specific rows?

Yes. Use corresponding ranges of the same size, such as =SUMIF(C2:C100,M2,E2:E100), to check and sum rows 2 through 100.