🍂 Buy your course today and get access throughout 2025 🏷️ Course catalog

FIFO Calculation in Excel

FIFO Calculation in Excel

FIFO is a fundamental principle in logistics, finance, and accounting. FIFO stands for ‘first in, first out,’ indicating that assets acquired first should also be sold first.

Download the sample set: FIFO Calculation.xlsx

A FIFO calculation is essential for determining costs and profits for assets that:

  • Have been acquired at different prices in multiple rounds.
  • Have been sold at different prices in multiple rounds.
  • Cannot be uniquely identified.

In logistics, FIFO ensures that older goods are used or sold first, minimizing the risk of selling expired or obsolete items.

In economic contexts, this principle is primarily applied to assets such as stocks, bonds, or currencies. When selling these assets, the capital gain or loss is often calculated by subtracting the cost basis from the selling price according to the FIFO principle.

To create a dynamic FIFO model in Excel:

  1. First, we create two tables that store data on purchased and sold assets.The image shows the calculation of price per unit.
  2. Then, we 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, and in this case, it determines if all 100 units purchased on 01/03/2022 have already been sold.

  1. For the next purchase, apply a similar formula, but consider the 100 units already sold. Then, 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.

We can now see how all 340 units sold have their own cost basis in the table for purchased assets.

  1. Calculate the cost of goods sold by multiplying [Quantity sold] by [Price per unit].
    The image shows the calculation of COGS in Excel.
  2. Finally, we obtain the profit/loss by subtracting the cost of goods sold from the revenues.
    The image shows the final result, with the profit highlighted.

 

Note that this calculation only works for products of the same type. If you need multiple 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!


Leave a Reply

You must be logged in to post a comment.

More blog posts

Tired of Googling?
Get the best Excel tips every week. Subscribe to our newsletter.

About the 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!