Create an Excel Inventory Tracker for In and Out Quantities
Question details
Create an inventory tracker that calculates current stock from opening quantities and recorded movements.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A user wants to log item codes, transaction dates, and incoming or outgoing quantities.
- Observed behavior
- Each stock movement is recorded separately, and the current quantity is calculated automatically for each item.
List each product's unique item code and opening quantity. Decide which date the opening quantities represent so earlier movements are not counted twice.
Build an inventory and activity table with SUMIFS
Use separate tables for opening stock and transactions to calculate each item's current quantity.
On an Inventory sheet, enter the headers Code, InitialQuantity, and CurrentQuantity. Add one row per product, select the range, and choose Insert > Table. On the Table Design tab, name the table Inventory.
On an Activity sheet, enter the headers Code, Date, and In/Out. Select the range, choose Insert > Table, and name the table Activity on the Table Design tab.
Add one row to the Activity table for each transaction. Enter a positive In/Out quantity for stock received and a negative quantity for stock issued, along with the item code and date.
In the first data cell under Inventory[CurrentQuantity], enter =[@InitialQuantity]+SUMIFS(Activity[In/Out],Activity[Code],[@Code]). Excel will normally fill the formula down the table.
Select Inventory[Code], then use Formulas > Define Name to name the range ItemCodes. Select the Activity code cells and choose Data > Data Validation > List; enter =ItemCodes as the source.

Create the same inventory tracker in WPS Spreadsheets
Use a product list, a transaction log, and a SUMIF formula in WPS Spreadsheets to calculate stock from signed movements.
- 1. Create the product list: In WPS Spreadsheets, create an Inventory sheet with Code in column A, InitialQuantity in column B, and CurrentQuantity in column C. Enter one product per row.
- 2. Create the activity log: Add a sheet named Activity with Code in column A, Date in column B, and In/Out in column C. Enter each incoming quantity as positive and each outgoing quantity as negative.
- 3. Calculate stock: On the Inventory sheet, enter =B2+SUMIF(Activity!$A$2:$A$10000,A2,Activity!$C$2:$C$10000) in C2. Copy the formula down for the other products.
- 4. Save the tracker: Choose File > Save As and save the workbook in XLSX format. Extend the formula's activity ranges if your log grows beyond row 10000.

Frequently Asked Questions
How do I record stock going out?
Add a row to the Activity table with the item code and date, then enter the outgoing quantity as a negative number in In/Out, such as -5.
Why is an item's current stock incorrect?
Check that the Activity code matches the Inventory code, outgoing quantities are negative, and the opening quantity does not already include the logged movements.
Does the SUMIFS formula calculate stock as of a specific date?
No. The formula shown includes all matching activity rows. To calculate stock as of a date, add a date condition to SUMIFS and use an opening quantity established before the included movements.
Can I prevent users from entering an invalid item code?
Yes. Define the Inventory code range as ItemCodes, then select the Activity code cells and use Data > Data Validation > List with =ItemCodes as the source.




