Calculation Issues

Build an Excel Inventory Log with Activity-Based Updates

John WilsonJohn Wilson Dec 2, 2026 868 views

Question details

Calculate current inventory quantities from an activity log without creating a circular reference.

Build an Excel Inventory Log with Activity-Based Updates
Product
Microsoft Excel
Device & OS
not provided
Scenario
An inventory sheet lists items, while a separate activity log records additions and removals.
Observed behavior
Each inventory quantity should update from the signed activity entries for its matching item ID.
Before you start

Choose a unique ID for each inventory item and use the same IDs in the activity log. Record additions as positive numbers and removals as negative numbers.

Solution 1Recommended

Calculate inventory from a separate activity table

Use SUMIFS to total each item's activity without referring back to the calculated inventory quantity.

1
Create the inventory table

On an inventory sheet, add columns named ID # and Inventory. Select the range, choose Insert > Table, and name the table Inventory on the Table Design tab.

2
Create the activity table

On a separate activity sheet, add columns named Key and In/Out. Select the range, choose Insert > Table, and name the table ActivityLog on the Table Design tab.

3
Enter opening quantities

In ActivityLog, add an opening row for each item: enter its ID in Key and its opening quantity as a positive number in In/Out. Enter later additions as positive numbers and removals as negative numbers.

4
Calculate current quantities

In the Inventory column of the inventory table, enter =SUMIFS(ActivityLog[In/Out],ActivityLog[Key],[@[ID #]]). Excel totals the activity for the ID in the current row and normally fills the formula down the table.

5
Check an update

Add an activity row with the same item ID and a signed quantity. For example, an opening entry of 12 followed by -1 should produce a current inventory of 11.

Current versus historical balance: The formula returns the current total. If you also display that total on the activity sheet, it will not preserve the balance as it was when each activity row was entered.
WPS Spreadsheets

Track inventory activity in WPS Spreadsheets

Use separate sheets and a SUMIF formula in WPS Spreadsheets to calculate each item's current quantity from signed activity entries.

  1. 1. Set up the inventory sheet: Open WPS Spreadsheets and create a sheet with item IDs in column A and an Inventory heading in cell B1.
  2. 2. Set up the activity sheet: Add a sheet named Activity Log. Enter Key in A1 and In/Out in B1, then record item IDs and signed opening quantities below the headings.
  3. 3. Enter the formula: On the inventory sheet, enter =SUMIF('Activity Log'!$A$2:$A$1000,A2,'Activity Log'!$B$2:$B$1000) in B2, then fill it down for the other item IDs.
  4. 4. Record changes: Add new rows on Activity Log with positive quantities for additions and negative quantities for removals. Extend both formula ranges if the log grows beyond row 1000.
Calculate inventory from additions and removalsKeep activity entries separate from calculated quantitiesOpen and save Microsoft Excel XLSX filesWork in a familiar spreadsheet interface
microsoft office alternative - wps office

Frequently Asked Questions

Where should I enter opening inventory quantities?

Add an opening row for each item in ActivityLog. Put the item ID in Key and the opening quantity as a positive number in In/Out, rather than typing it into the calculated Inventory column.

Why does this method avoid a circular reference?

The inventory formula sums values from ActivityLog; it does not use the calculated inventory cell as an input. Enter all changes directly in the activity table.

Why is an item's calculated quantity zero?

Check that the ID in the inventory table matches the Key in ActivityLog and that the In/Out entries are numbers. Also confirm that an opening entry or other activity has been recorded for that ID.

Does the formula show the balance after each activity?

No. SUMIFS returns the current total for the item. A historical running balance requires a separate calculation that accounts for the order of activity rows.