How to Calculate FIFO Inventory Aging Formulas in Excel 365
Question details
The user needs formulas to calculate inventory aging based on the First-In-First-Out (FIFO) method, specifically to find closing quantity, closing value, and average cost.

- Product
- Microsoft Excel 365
- Device & OS
- not provided
- Scenario
- Tracking inventory age across multiple years to determine remaining stock layers, their monetary value, and the average unit cost for accounting purposes.
- Observed behavior
- Allocate the remaining FIFO inventory layers into distinct year columns (e.g., 2020 to 2024) to accurately report closing quantity, closing value, and average cost.
Before applying FIFO formulas, ensure your inventory purchase data is chronologically sorted and clearly separated into individual intake batches with distinct dates, quantities, and unit costs.
Set Up the FIFO Inventory Data Structure
Proper data organization is the foundation of any FIFO calculation. You must structure your purchase history and allocate remaining stock step-by-step.
Because FIFO requires matching the most recent remaining inventory to your closing stock, a single straightforward formula is rarely enough. You must establish a helper table that tracks each purchase batch.
Your structure should separate years into columns P through S (rows 12-14), designating specific cells for aggregate totals.
Create columns for 'Purchase Date', 'Received Quantity', 'Unit Cost', and 'Remaining Quantity'. Sort the entire table from oldest to newest dates.
Use a helper column to subtract total sold items from your inventory batches, starting from the oldest rows. If the sold amount exceeds a batch, the remaining quantity for that row becomes zero.
Designate cell P4 for the Total Closing Quantity, Q4 for the Total Closing Value, and R4 for the Average Cost. These cells will aggregate the remaining amounts from your helper table.

Calculate Aging by Year and Summarize Values
Allocate your remaining inventory into distinct yearly aging buckets using conditional formulas like SUMIFS.
Calculate FIFO Inventory Effortlessly with WPS Spreadsheet
WPS Office provides advanced formula support, including SUMIFS, SUMPRODUCT, and dynamic array functions, making it perfectly equipped to handle complex FIFO inventory aging calculations seamlessly.
- 1. Open WPS Spreadsheet: Launch WPS Office and open a new blank workbook or import your existing Excel inventory file.
- 2. Structure Your Inventory Data: Enter your chronological inventory data into rows and columns, establishing a helper column for remaining quantities.
- 3. Apply FIFO Formulas: Use standard Excel-compatible formulas like SUMPRODUCT and SUMIFS to allocate closing quantities and values to your designated yearly cells.
- 4. Save and Export: Save your finished inventory tracker in .xlsx format for seamless sharing and reporting.

Frequently Asked Questions
Why is FIFO aging difficult to calculate with a single formula?
FIFO logic requires tracking individual inventory layers and sequentially matching total sales against the oldest available batches. This involves iterative calculations, making it necessary to use helper columns or complex dynamic array formulas rather than a single basic function.
What is the formula for average cost in a FIFO system?
The average cost of ending inventory is calculated by dividing the total Closing Value by the total Closing Quantity. If your Closing Value is in Q4 and your Closing Quantity is in P4, simply type =Q4/P4 in cell R4.
Can I use dynamic arrays in Excel 365 to handle FIFO?
Yes. Excel 365 features like LET, FILTER, and SCAN allow advanced users to build single-cell spill formulas that calculate remaining FIFO layers without traditional helper columns, though these require an in-depth understanding of array mathematics.




