I have a worksheet with columns as follows :
A B C D E F
item batch date qty rate amount
berries p-1 11/11/2010 2300 39.59 91065.97
berries p-2 24/12/2013 2000 22.60 45200.00
berries p-3 26/12/2013 700 22.50 15750.00
berries s-1 01/06/2017 -1000 89.87 89865.65
berries s-2 02/06/2017 -1000 92.02 92020.00
berries s-3 24/08/2017 -1000 93.02 93020.00
berries s-4 26/12/2017 -1000 95.83 95830.00
berries s-5 28/12/2013 -1000 94.73 94730.00
carrots p-1 17/08/2016 1000 21.54 21540.00
carrots p-2 24/08/2016 5350 24.54 131289.00
carrots s-1 06/06/2017 - 850 26.00 22100.00
carrots s-2 09/06/2017 - 500 26.50 13250.00
The positive qty denotes purchase in batches p-1,p2... and -ve qty denotes sale in batches s-1,s2...I want to match the sale qty with purchase qty on FIFO (First in First out) basis and calculate profit / loss in each sale and the remaining stock after all sale adjusted, with its cost value What formula in excel to do the above calculations ?
A B C D E F
item batch date qty rate amount
berries p-1 11/11/2010 2300 39.59 91065.97
berries p-2 24/12/2013 2000 22.60 45200.00
berries p-3 26/12/2013 700 22.50 15750.00
berries s-1 01/06/2017 -1000 89.87 89865.65
berries s-2 02/06/2017 -1000 92.02 92020.00
berries s-3 24/08/2017 -1000 93.02 93020.00
berries s-4 26/12/2017 -1000 95.83 95830.00
berries s-5 28/12/2013 -1000 94.73 94730.00
carrots p-1 17/08/2016 1000 21.54 21540.00
carrots p-2 24/08/2016 5350 24.54 131289.00
carrots s-1 06/06/2017 - 850 26.00 22100.00
carrots s-2 09/06/2017 - 500 26.50 13250.00
The positive qty denotes purchase in batches p-1,p2... and -ve qty denotes sale in batches s-1,s2...I want to match the sale qty with purchase qty on FIFO (First in First out) basis and calculate profit / loss in each sale and the remaining stock after all sale adjusted, with its cost value What formula in excel to do the above calculations ?
Last edited: