Function Problems

Subtract Multiple Inventory Uses with an Excel SUMIF Formula

Amos GikundaAmos Gikunda Nov 22, 2026 869 views

Question details

Calculate the quantity on hand by subtracting all matching usage entries for each inventory item.

Subtract Multiple Inventory Uses with an Excel SUMIF Formula
Product
Microsoft Excel
Device & OS
not provided
Scenario
An inventory workbook lists available stock on one sheet and records item usage across multiple rows on another sheet.
Observed behavior
Subtracting only one matching usage row produces an incorrect quantity on hand.
Before you start

Check that the inventory sheet has item identifiers in column A and available stock in column B. The example also assumes the IT Accessories Used sheet has matching identifiers in column A and quantities used in column B.

Solution 1Recommended

Use SUMIF to subtract all matching usage entries

Use this formula when each item can appear on multiple rows in the usage sheet.

SUMIF adds the quantities used for the item in A2, and the formula subtracts that total from the available stock in B2. If no usage entries match, the formula returns the available stock.

1
Select the quantity cell

On the inventory sheet, select cell C2 in the Quantity on Hand column.

2
Enter the formula

Type =B2-SUMIF('IT Accessories Used'!$A:$A,A2,'IT Accessories Used'!$B:$B) and press Enter.

3
Copy the formula down

Drag the fill handle at the bottom-right corner of C2 down the Quantity on Hand column for the remaining inventory items.

4
Check the result

Compare a calculated quantity with the corresponding entries on the IT Accessories Used sheet. If your sheet name or columns differ, edit the references in the formula bar.

Use SUMIF to subtract all matching usage entries
Keep item identifiers consistent: Item identifiers must match between sheets. Check for extra spaces or spelling differences if a usage entry is not included.
Calculate inventory in WPS

Track quantity on hand with SUMIF in WPS Spreadsheets

Open your inventory workbook in WPS Spreadsheets and use SUMIF to subtract all matching usage entries from each item's available stock.

  1. 1. Open the workbook: Open WPS Spreadsheets and select Open to choose your inventory workbook.
  2. 2. Check the columns: On the inventory sheet, check that column A contains item identifiers and column B contains available stock. On IT Accessories Used, check that columns A and B contain identifiers and quantities used.
  3. 3. Enter SUMIF: Select C2 on the inventory sheet, enter =B2-SUMIF('IT Accessories Used'!$A:$A,A2,'IT Accessories Used'!$B:$B), and press Enter.
  4. 4. Fill and save: Drag C2's fill handle down to calculate the remaining rows, then select Save to keep your changes.
Totals multiple usage entries for each inventory itemCompatible with Microsoft Excel XLSX workbooksUses a familiar spreadsheet interfaceFree to download and use
microsoft office alternative - wps office

Frequently Asked Questions

What happens if an item has no usage entries?

SUMIF returns zero for the matching usage total, so the formula in C2 returns the available stock from B2.

Why is a usage entry missing from the total?

Compare the item identifier in the inventory sheet's column A with the identifier on IT Accessories Used. Extra spaces or spelling differences can prevent a match; also check that the usage quantity is numeric.

How do I use the formula with a different sheet name?

In the formula bar, replace both references to 'IT Accessories Used' with your actual usage sheet name. Keep single quotes around names containing spaces.

Why does the formula still reference the correct usage columns when copied down?

The dollar signs in $A:$A and $B:$B keep the usage columns fixed, while A2 and B2 change to the corresponding row as you fill the formula down.