# FIFO Inventory Valuation in Excel using Data Tables – How To

Inventory can be valued in number of ways, FIFO, LIFO and AVCO being the most famous. To learn few more inventory valuation methods have a quick look at this: What are different inventory valuation methods? Entities purchase inventory as and when they feel the need or based on a particular method for example Economic Order Quantity (EOQ). Often the the purchase price is different every time order is placed. Therefore, the price of each purchase lot is different from each other as you can see in the data at left

First In First Out (FIFO) assumes that every time units are taken from store, they are issued from the oldest available lot first and next lot to be consumed only if needed.

This requirement makes the calculations a little too complex for formulas. May be there is a way to do it via formulas but I am unaware of it yet and would love to know. On the other hand VBA is also an alien knowledge for me so far. So is there a way? Yes there is!

By the end of the tutorial we will be able to get this: This is where Excel Data Tables comes handy. One of the less known and used tool for sure. But it can make this process super smooth and easy. So lets get to learn it!

Important: Excel Data Tables are different from Excel Tables so please don’t confuse the two

In a hurry?

Skip the tutorial for now and get the file. This fully unlocked no secrets held Excel file is available for you to change and use at your disposal. It is designed to input data easily. You just have to give the units sold and all calculations will be done automatically.

ALSO And any future revisions to this template will be sent to you absolutely free!

Got a question? Contact details are here

### FIFO Inventory Valuation in Excel – Step by Step

Step 1: Download this workbook. It has the dummy data that we can use to understand the process.

Step 2: Format the worksheet as follows so that we know exactly what information is where: Step 3: Suppose we have made a sale of 1000 units. So enter that in cell G1 and name the cell as “sales” by typing in the name box having cell G1 active. Step 4: Now we want the total units sold to be divided as per lots available deducting from the first available lot. Go to cell F4 and put this formula and drag it down to cell F10.

=MIN(B4,sales-SUM(\$F\$3:F3))

Step 5: Next put the following formulas in the mentioned cells and drag them to row 10:

G4: =F4*C4
H4: =B4-F4
I4: =H4*C4 Step 6: Calculate the totals of each column by simply selecting the 11th row and hitting ALT+= So we have completed the calculations and if you change the value in sales we can easily update the records of each column showing the correct cost and value of inventory at hand Though the above process has helped me get the numbers but its not helping much if I want to calculate the cost of sales for different quantities. For example if I want to know the cost of sales of all the quantities by the end of the month, I simply need a report instead of punching each quantity in cell and then record the value somewhere. To solve this we will take few more steps

Step 7: Format the cells as follows. This is where we will have a mini report generator for the units you mention and Excel will automatically calculate the CGS of units mentioned on FIFO basis: Step 8: In cell L4 put the following formula and drag the fill handle down to cell L10

=SUM(\$K\$4:K4) Step 9: In cell M3 refer to total of CGS we calculated before in cell G11 with this formula: =G11

Step 10: Select the range L3: M10 and go to Data tab > Forecast group > Click what-if drop down button > click Data table. A pop up will appear. Leave the row input cell empty and mention units sold in column input cell G1. Click OK. Step 11: Put the following formula in CGS column’s cells:

N4: =M4
N5: =M5-SUM(\$N\$4:N4), drag the fill handle down to cell N10 Step 12: Select cells N4:N10 and hit Ctrl+1. Go to Custom and in the input bar mention the following and click OK:

0;0;

Step 13: Hide the columns L and M. Now test your report by typing the units in “Units” column and it will give you the correct CGS as per FIFO. So here you have fully working FIFO Calculator and a mini report generator!

FIFO Stock Valuation in Excel - Template
Download the fully working and unlocked Excel file that can serve as a template for your FIFO calculations and also help learning the techniques applied.

And any future revisions to this template will be sent to you absolutely free!

Got a question? Contact details are here

### Liked it? Pin it! 1. Maria

Thanks you solved my problem

2. jawad

What if Multiple sales/issuance of inventory in different dates? You are only showing to calculate a specific single item calculation.

3. MS

Nice article. It’s informative blog.

4. Kriszta

Hi, the formula =MIN(B4,sales-SUM(\$F\$3:F3)) doesn’t works for me, too. Is there any solution?
thx

• Kriszta

It’s OK! 😀 I have to write SZUM

5. Shirley

What about weight or moving average formula?

6. Joel

this is genius work!

7. Dan

Will this work with an invoicing template in Excel?
Specifically, using FIFO for COGS associated with each invoice.

• Hasaan Fazal

Yes, it should work. You have the technique and the template. Try it out. And if you get any questions you can always ask.

8. Karanbir Singh Soin

I have made a FIFO share register using a data table as in your example. Somehow the COGS part in the end is not coming right. How can I mail you my excel sheet if you could guide me?

9. Naveed Rasheed

Tell me how can we merge previous sheet cell record in next sheet cell e.g
1- Sheet1 In First Semester cell show three exam result with subject code (Fail 5101,5102,5103)
2- Sheet2 In second Semester cell show two exam result (*************Fail 5201,5202)
tell me by which formula 1st semester cell record will show in 2nd semester cell record until he will pass the exam…………….same condition will apply next more 6 semesters e.g 3rd, 4th, 5th, 6th, 7th, 8th so on. I hope that you will give me answer.

10. softwareguide

Awesome! and very easy to understand.

• Pavel

Can you give me the copy that you done

11. rinda

Could you make some changes to the formulas and have the sheet calculate using LIFO?

• Hasaan Fazal

A detailed tutorial is already in process and will be published today. Will update the comment with link.

12. A

Hi, thanks, Great template!
is it possible to tune these formulas to have the same template for weighted average?

13. Kelsey

Could you make some changes to the formulas and have the sheet calculate using LIFO?

14. irfan

Dear,

can uyou please help in establishing Stock card using FIFO with multiple items. I HV around 300 item and want stock card using FIFO

• Irfan

Nice

• Irfan

Let me try tomorrow Nice

15. Igor Paix

=MIN(B4,sales-SUM(\$F\$3:F3))

This first formula is wrong… could anyone help me please?

Thx

• Hasaan Fazal

Hey,

• Kriszta

Hi, the formula =MIN(B4,sales-SUM(\$F\$3:F3)) doesn’t works for me, too. Is there any solution?
thx

• Manuel Salameh

I have the same issue and you haven’t answered Kriszta. What is wrong here? Excel sais, thi sis not a formula 😐
And to be honest, I haven’t really understood, what the formula should do, otherwise I would have done it by my own :-/

• Manuel Salameh

Hi Hasaan, any chance that you post the fix to the wrong excel formula?

• Michael

click on the box where you typed in 1000. On the far left you will see “G1”. Now click on that box and replace “G1” with sales. renaming the box as “sales” should do the trick

16. Tanya Morera

This has been super helpful information, but i can’t get the formula’s to work in my google drive spreadsheet.

• Hasaan Fazal

For this to work we need data tables like functionality implemented. I will have to check if google spreadsheets allow this method to work or not as I am not using google sheets frequently.

17. prakash rajendhran

its very use full guide for ever…………

18. rukhsana

Very productive indeed