Calculation Issues

How to Automatically Update Inventory Quantities from a Transaction Log in Excel

Natalie TaylorNatalie Taylor Nov 11, 2026 870 views

Question details

The user needs to calculate an updated inventory balance by taking the original quantity from a Cost Tracking sheet and adjusting it with additions and removals from a Material Log.

How to Automatically Update Inventory Quantities from a Transaction Log in Excel
Product
Excel
Device & OS
not provided
Scenario
Building an automated inventory tracking sheet where the current balance updates automatically as new daily transactions are entered.
Observed behavior
The goal is to dynamically reflect the starting stock plus the net change from logged transactions by matching material codes across different tables.
Before you start

Verify that your transaction log and original inventory lists are formatted as Tables. Ensure that material codes are formatted consistently as either text or numbers across both sheets to prevent mismatch errors.

Solution 1Recommended

Combine VLOOKUP and SUMIFS to Calculate Total Inventory

Use a combination formula that pulls the starting balance with VLOOKUP and adds the net transactions matching the material code using SUMIFS.

This formula uses VLOOKUP to retrieve the initial stock quantity from your Cost Tracking sheet. It then adds a SUMIFS function to aggregate all matching additions and removals from your material log based on the specific material code.

1
Select the target inventory cell

Click the cell in your master inventory table where you want the final updated balance to appear.

2
Input the VLOOKUP portion

Type `=VLOOKUP([@[Mat. Code]],'Cost Tracking'!$A$2:$J$45,10,FALSE)` to pull the original inventory quantity. Adjust the range to cover your actual Cost Tracking table boundaries, ensuring the quantity column index is correct.

3
Append the SUMIFS portion

Add the plus sign and the SUMIFS formula: `+SUMIFS(Inventory_tracker1_2[Amount Taken], Inventory_tracker1_2[Mat. Code], [@[Mat. Code]])`. This sums up all transaction amounts corresponding to the current material code.

4
Apply and check transaction signs

Press Enter to apply the formula to the column. Confirm that your transaction values use the correct sign in the log sheet, meaning additions are recorded as positive values and removals as negative numbers.

Combine VLOOKUP and SUMIFS to Calculate Total Inventory
Working Without Tables: If you are not using formatted Excel Tables, replace structured references like [@[Mat. Code]] with standard cell references (e.g., A2) and lock your data ranges using the F4 key (e.g., $A$2:$A$100).
Simplify Inventory Management

Track and Update Inventory Effectively with WPS Spreadsheet

WPS Spreadsheet fully supports advanced array formulas, structural references, and functions like VLOOKUP, XLOOKUP, and SUMIFS, making it an excellent tool for building automated, real-time inventory systems.

  1. 1. Open WPS Spreadsheet: Launch WPS Office and open your inventory tracking workbook.
  2. 2. Format data as tables: Highlight your transaction log data and press Ctrl+T to convert it into a formatted table. This allows dynamic formula updates when new rows are added.
  3. 3. Apply the tracking formula: Use the VLOOKUP and SUMIFS combination in the formula bar to link your transaction log and cost tracking sheets together, pressing Enter to automatically fill the entire column.
100% compatible with Microsoft Excel formulas and table structuresFree to download with a highly intuitive spreadsheet interfaceIncludes hundreds of built-in templates for stock and inventory trackingCross-platform synchronization across Windows, Mac, iOS, and Android
microsoft office alternative - wps office

Frequently Asked Questions

Why does my inventory formula return an #N/A error?

An #N/A error usually happens when the material code in the transaction log does not exactly match the code in the Cost Tracking sheet. Check for accidental spaces, typos, or mismatched text-to-number formats.

Can I use XLOOKUP instead of VLOOKUP for this inventory calculation?

Yes, XLOOKUP is a modern and robust alternative. You can replace the VLOOKUP portion with `=XLOOKUP([@[Mat. Code]], 'Cost Tracking'!A:A, 'Cost Tracking'!J:J)` to pull the starting quantity safely, even if columns are later inserted or deleted.

How do I handle multiple transaction logs for different store locations?

You can chain multiple SUMIFS functions together in your formula (e.g., `+SUMIFS(Log1) + SUMIFS(Log2)`). Alternatively, you can consolidate your multiple transaction logs into a single master data table using Power Query before applying the calculation.