How to Automatically Update Inventory Quantities from a Transaction Log in Excel
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.

- 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.
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.
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.
Click the cell in your master inventory table where you want the final updated balance to appear.
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.
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.
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.

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. Open WPS Spreadsheet: Launch WPS Office and open your inventory tracking workbook.
- 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. 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.

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.




