Function Problems

How to Multiply COUNTIF Results by Quantities in Excel

Emma BrownEmma Brown Oct 22, 2026 871 views

Question details

The user needs to calculate the total quantity of items for a specific condition, rather than merely counting the number of matching orders.

How to Multiply COUNTIF Results by Quantities in Excel
Product
Excel
Device & OS
not provided
Scenario
Tracking orders and engineering capacity where each order row contains variable item quantities for specific weeks.
Observed behavior
Using a COUNTIF formula only returns the count of matching order rows, failing to account for multiple items within a single order.
Before you start

Ensure your data ranges do not contain any merged cells, as calculations involving merged cells in Excel can be difficult and lead to formula errors.

Solution 1Recommended

Use the SUMIFS Function to Calculate Total Quantities

Replace the COUNTIF function with SUMIFS to sum actual numeric values (quantities) based on your specified criteria (the selected week).

While COUNTIF is excellent for finding out how many orders occurred in a specific week, it cannot multiply variable quantities natively. The SUMIFS function solves this by evaluating a criteria range and summing a corresponding value range.

1
Select the destination cell

Click on the cell where you want the total item quantity to appear (for example, cell AK4).

2
Enter the SUMIFS formula

Type the formula =SUMIFS($G$3:$G$100, $N$3:$N$100, $AJ4). In this syntax, $G$3:$G$100 represents the column containing quantities, $N$3:$N$100 is the column containing your weeks, and $AJ4 is the specific week you are filtering by.

3
Apply and copy the formula

Press Enter to calculate the total quantity. You can then click and drag the fill handle down to apply this formula to other rows for different weeks.

Use the SUMIFS Function to Calculate Total Quantities
Unmerge Cells First: If you have merged cells in your data range, unmerge them and widen the columns instead to ensure the SUMIFS formula references the arrays correctly.
Efficient Spreadsheet Calculations

Seamlessly Calculate Conditional Sums in WPS Spreadsheet

WPS Office provides a powerful, highly compatible spreadsheet tool that effortlessly handles complex formulas like SUMIFS, making data analysis and order tracking a breeze.

  1. 1. Open your dataset: Launch WPS Spreadsheet and open your order tracking workbook.
  2. 2. Access the Function Wizard: Navigate to the Formulas tab on the top ribbon, click 'Insert Function', and search for the SUMIFS function.
  3. 3. Define your ranges visually: Input your Sum_range (the quantities) and Criteria_range (the weeks) into the intuitive dialog box to generate your formula automatically.
Fully compatible with Microsoft Excel formulas including SUMIF, SUMIFS, and COUNTIF.Lightweight software with rapid processing for large, complex datasets.Built-in function wizard to help you build conditional formulas without syntax errors.
microsoft office alternative - wps office

Frequently Asked Questions

What is the difference between COUNTIF and SUMIFS?

COUNTIF counts the total number of cells that meet a single condition (e.g., how many orders were placed). SUMIFS adds up the numerical values in a specified range for cells that meet one or multiple conditions (e.g., the total number of items inside those orders).

Can I just multiply a COUNTIF result by a quantity?

You can only do this accurately if every single order has the exact same quantity. If quantities vary per order, multiplying the COUNTIF result will yield incorrect totals, which is why SUMIFS is required.

Why is my SUMIFS formula returning an error or zero?

This typically occurs if your sum range and criteria range are not identically sized (e.g., rows 3 to 100 for both). It can also happen if your calculation area contains merged cells, which disrupts how Excel reads the row data.