• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User


  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

FIFO purchase cost (COGS)

The file is attached with some modifications but gives the same results
Column H is only auxiliary
You must sort column A after you edit the data
This code I learned from participation in this wonderful forum



New Member
Thanks for the effort. Currently we have 400 different type of product and I will have two different sheet, Sales and Purchase.

I am trying to link so that the FIFO cogs is calculated for my sales and get the profit numbers.

I am also try because the condition i need to have is

1. the Inventory is not negative
2. the inventory date is before the sale proceed
3. in which row the balance quantity starts.
4. the cost calculation there may 1 or multiple row with multiple prices. I don't want to have a average price as the number differs

Last edited:


Excel Ninja
Hi ,

If possible , can you upload your complete workbook , with as much data as possible ?

The data can all be dummy data so that your organization's data is not compromised.