Use Excel SUMIF to Sum Quantities for a Specific Product
Question details
Calculate the total quantity for one product by matching its code or description.

- 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.
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.
Sum matching product quantities with Excel SUMIF
Use SUMIF to add quantities for every row that matches the selected product.
In cell M2, type the product description you want to total, using the same wording as the entries in column C.
Select cell N2 and enter =SUMIF(C:C,M2,E:E), then press Enter.
Review the total in N2. Change the value in M2 to calculate the total for another product.

Sum product quantities with SUMIF in WPS Spreadsheets
Use the same SUMIF formula in WPS Spreadsheets to total quantities for a selected product.
- 1. Open the workbook: Open WPS Spreadsheets and use Open to select your workbook.
- 2. Enter the product: Type the product description in M2, matching the descriptions in column C.
- 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. Save your changes: Use File > Save to save the workbook with the formula.

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.




