Function Problems

How to Create an Excel Inventory Tracking System with Logbook Codes

Jason MillerJason Miller Nov 11, 2026 868 views

Question details

The user wants to build an automated inventory system in Excel that automatically deducts stock quantities when a form number or logbook code is entered.

How to Create an Excel Inventory Tracking System with Logbook Codes
Product
Excel
Device & OS
not provided
Scenario
Managing inventory and recording stock-in or stock-out transactions systematically.
Observed behavior
Needs a formula or structured method to automatically subtract inventory quantities upon logging a transaction with a specific code.
Before you start

Before setting up your inventory formulas, organize your data into a clear, single-sheet transaction log that includes dedicated columns for Item Names, Logbook Codes, and Form Numbers.

Solution 1Recommended

Use the COUNTIF Formula to Automate Stock Deductions

This method uses a centralized transaction table and the COUNTIF function to automatically calculate remaining inventory based on logbook entries.

Keeping all stock-in and stock-out records on a single sheet simplifies calculations. By counting the occurrences of a logbook code in your transaction log, you can automatically subtract that count from your initial quantity.

1
Create the Initial Inventory Table

Set up a main inventory table with columns for 'Item Name', 'Logbook Code', and 'Initial Quantity'.

2
Set up the Transaction Log

Create a separate Transaction Log table on the same sheet with columns for 'Date', 'Form No.' (which will record the logbook code when an item is used), and 'Transaction Details'.

3
Format as Excel Tables

Highlight both data ranges and press Ctrl+T to format them as official Excel Tables. This ensures formulas update automatically when new rows are added.

4
Add the Calculation Formula

In your Initial Inventory table, add a new column named 'Remaining Quantity'. Click the first cell in this column and enter the formula: =[@Quantity]-COUNTIF(TransactionLog[Form No.],[@[Logbook Code]]).

5
Apply to All Rows

Press Enter. The structured table reference will automatically apply the formula down the entire column, deducting 1 from the initial quantity every time the logbook code appears in the transaction log.

Use the COUNTIF Formula to Automate Stock Deductions
Handling Variable Quantities: If your transactions involve multiple items at once rather than single units, replace COUNTIF with SUMIFS to sum an actual 'Quantity Deducted' column.
Seamless Spreadsheet Management

Build Your Inventory System Free in WPS Spreadsheet

WPS Spreadsheet fully supports advanced functions like COUNTIF and structured table references, allowing you to build automated inventory trackers effortlessly without expensive software.

  1. 1. Open WPS Spreadsheet: Launch WPS Office and create a new blank spreadsheet.
  2. 2. Set Up Your Tables: Create your 'Initial Inventory' and 'Transaction Log' tables, formatting them using 'Format as Table' from the Home tab.
  3. 3. Apply the Formula: Use the COUNTIF function in the Remaining Quantity column to track stock deductions automatically.
  4. 4. Save and Share: Save your document in .xlsx format to ensure it works seamlessly across different devices.
Fully compatible with Microsoft Excel (.xlsx) formats and table structures.Supports advanced formulas like COUNTIF, SUMIFS, and VLOOKUP for accurate inventory tracking.Free, lightweight, and features a familiar user interface for a seamless transition.
QA img-9

Frequently Asked Questions

Can I use SUMIFS instead of COUNTIF for inventory tracking?

Yes. If you track variable quantities per transaction rather than single units, use SUMIFS to sum the 'Quantity' column based on the matching 'Logbook Code'.

Why is my COUNTIF formula returning an error?

Ensure that your cell references match exactly. If you are using structured table references (like [Form No.]), verify that your data is formatted as an official Table (Ctrl+T) and the table name matches the one in your formula.

How can I prevent negative inventory in my spreadsheet?

You can use Data Validation to restrict entries, or wrap your calculation formula in a MAX function, such as =MAX(0, [@Quantity]-COUNTIF(...)), to ensure the stock level never displays below zero.

Is it better to use one sheet or multiple sheets for transactions?

It is generally better to use a single, centralized transaction sheet for all stock-ins and stock-outs. This reduces formula complexity and makes the data much easier to analyze with PivotTables later.