⭐ 4.9 out of 5 • Trusted by over 100,000 learners since 2014

post

How to create a FIFO calculation in Excel

Emil
Author
July 7, 2025 3 mins read

How to create a FIFO calculation in Excel

FIFO, or “First In, First Out,” is a concept used to manage inventory and calculate profits. It means that the first assets acquired are the first ones to be sold or used.

📥 Download the example file: FIFO-Calculation.xlsx

A FIFO calculation is crucial when dealing with assets that:

  • Were purchased at different prices across multiple transactions
  • Were sold in several stages at different prices
  • Cannot be uniquely identified or tracked individually

Example applications of FIFO

  • In Logistics: FIFO ensures that older inventory is used or sold before newer stock, helping to prevent spoilage, obsolescence, or waste.
  • In Finance and Accounting: FIFO is commonly applied to stocks, bonds, or cryptocurrencies. When these assets are sold, capital gains or losses are calculated by subtracting the cost of the earliest purchased units from the sale price.

How to create a FIFO calculation in Excel:

First, create two tables to store data for purchased assets and sold assets.
The image shows the calculation of price per unit.

Next, calculate in a new column how many of the purchased assets have been sold.
For the first purchase, the formula would be:

=MIN( [quantity purchased in purchase no. 1] ; [quantity sold in total])
    The image shows the calculation of the quantity sold.

The MIN function returns the smallest of its arguments. In this case, it determines whether all 100 units purchased on 01/03/2022 have already been sold.

For the next purchase, apply a similar formula, but take into account the 100 units already sold. Use a SUM formula to add all the values above and subtract them from the total number of units sold.
The image shows the column quantity sold.

At this point, we can see how all 340 units sold are assigned their own cost basis in the table of purchased assets.

Calculate the cost of goods sold (COGS) by multiplying Quantity Sold by Price per Unit.
The image shows the COGS calculation in Excel.
The image shows the calculation of COGS in Excel.

Finally, calculate the profit or loss by subtracting the cost of goods sold from the revenue.
The image shows the final result, with the profit highlighted.

 

Note: This calculation only works for products of the same type. If you need to handle multiple product types, you can simply create separate sheets for each product.

Tip: You can further develop this model by, for example, calculating the inventory value of products that have not yet been sold.

Do you want to sharpen your skills even more in your role as a purchaser or logistics professional?

Excel is one of the most important tools in both purchasing and logistics – whether you’re managing forecasts, tracking deliveries, or analyzing costs. With our online course Excel for Purchasers and Logistics Professionals, you’ll gain practical skills that can be immediately applied in your daily work.

Built for Nordic business teams

See how Learnesy works for your team

12 years in market. Admin dashboard included. Courses in Swedish and Norwegian

500+ companies 4.9 on Google
Book a demo Try free for 7 days

Try some lessons in this course for free

Fill in your e-mail address and telephone and we will give you 7 days free access to some lessons in this course.

No card required!

Frequently Asked Questions

FIFO stands for “First In, First Out” and is an inventory valuation method where the oldest stock is used or sold first. A FIFO calculation in Excel often uses formulas combined with inventory tables to track quantities, purchase dates, and costs across multiple inventory transactions.
No, many people find FIFO easier to understand than LIFO because it follows the natural flow of inventory. FIFO inventory calculations in Excel are commonly used in retail, logistics, and warehouse management since older stock is processed first, making inventory tracking more intuitive in many situations.
A FIFO calculation in Excel is usually done by listing purchases and sales in chronological order, then matching the oldest inventory costs against outgoing stock. Many inventory spreadsheets use tables, formulas, and filters to automate parts of the process and reduce manual calculation errors.
Converting inventory from LIFO to FIFO involves recalculating inventory values using the oldest purchase costs first instead of the newest. Many companies use Excel inventory calculations to compare the two methods and analyze how the change affects stock valuation, margins, and financial reporting over time.
You can usually determine whether a company uses FIFO or LIFO by reviewing its accounting policies in financial statements or annual reports. Inventory valuation methods are often disclosed in the notes section because they directly affect inventory costs, profit margins, and financial reporting.
Yes, Excel includes several inventory templates that can be used for stock tracking, product lists, and inventory management. Many businesses customize these templates with formulas, filters, and conditional formatting to create a more advanced inventory system tailored to their workflows and reporting needs.
You can turn Excel into an inventory system by combining tables, formulas, filters, and data validation tools. Many inventory spreadsheets also include stock movement tracking, reorder alerts, and FIFO formulas to improve inventory management. More advanced setups may use PivotTables and Power Query for reporting and automation.
The easiest way to keep track of inventory is often through a structured spreadsheet or inventory management system that updates stock levels automatically. Many small businesses start with Excel inventory templates because they are flexible, easy to customize, and suitable for tracking products, quantities, and purchase history.
Author

Emil har jobbat på Learnesy som produktutvecklare i flera år och ligger bakom flera av Learnesys kurser. Han har en utbildning inom datavetenskap med ett stort intresse för det analytiska och teoretiska. Utöver Finska och Svenska snackar Emil även flytande Excelfunktioner!