FIFO Excel template: Automate Flow from inventory to Cost of Goods Sold based on First in First Out

This is an attempt to automate the tabulation of Cost of Goods Sold amount from an existing list of inventory based on First in First Out (FIFO) Principle.

The template consists of 2 tabs:

How the template works

Upon Clicking the FIFO Matching Button

Sales Orders to be filled from Column K till Column M

Click on Button to run the matching macro

List of transnational log of all matches are recorded in the LOG worksheet

DOWNLOAD FIFO-Template HERE

https://docs.google.com/spreadsheets/d/1mM1INRs5HFaKr9DCM-sUncT3UFr_YSWB/edit?usp=sharing&ouid=102583703753746949912&rtpof=true&sd=true

Updated 12th Feb 2018: Fixed Bug which ignores "Insufficient stock" on subsequent matches after the 1st run

Updated 13th Apr 2019: Tidied up and Fixed Bug (which ignores possibility of similar SKUs) ~ Replaced "Find xlPart" with "Find XlWhole" to ensure exact matches

On a side note, there are examples where FIFO could be achieved through DATA Tables (non-VBA method) and Custom Functions method. As per listed below for reference as it may be more applicable for you depending on your unique set of circumstances / requirements.

By Somkiat Foongkiat: A very creative use of DATA TABLES (non- VBA method) ~ explanation with sample file could be found over at his site http://pakaccountants.com/fifo-costing-inventory-excel-data-tables/

By Marcus Small: 2 examples, One through Custom functions ;another a VBA solution ~ explanations with sample files for both could be viewed over at his site http://www.thesmallman.com/fifo-calculator/

Next: Logic of Capitalism