Want FIFO Based Purchase Price of Goods Sold

CA_Punit

Well-known Member
Joined
Nov 18, 2019
Messages
944
Office Version
  1. 365
Platform
  1. Windows
I want to get the purchase price of goods sold on the basis of FIFO .
Example of Data

I have tried but not able to get Quantity

New Microsoft Excel Worksheet.xlsx
ABCDEFGHIJKL
3ItemQuantity PurchasedRateCumulative Total
4Part 11010010
5Part 11011020
62012040
71013050
8
9
10
11Quantity SoldSale PriceCumulative QuantityFifo Based Purchase Price
121111
133111542#DIV/0!10
14910
152920
163910
17
18
19
Sheet1
Cell Formulas
RangeFormula
E4:E7E4=SUMPRODUCT($C$3:C4)
E12:E13E12=SUM($C$11:C12)
G13:G16G13=1/(1/(IF($E$4:$E$7-E12<=0,0,$E$4:$E$7-E12)))
J13:J16J13=INDEX($C$4:$C$7,ROW(INDIRECT("1:"&AGGREGATE(15,6,1/(1/(NOT(C13>=IF($E$4:$E$7-E12<=0,0,$E$4:$E$7-E12))*(ROW($E$4:$E$7)-ROW($E$4)+1))),1))))
Dynamic array formulas.


Hope someone could help
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Please change E4 to
=SUM($C$3:C3)

then F12
=SUMPRODUCT(TEXT(E12-C12*{0,1}-$E$4:$E$7,"0;\0;0")*($D$4:$D$7-N(+$D$3:$D$6))*{1,-1})


I have my Thai clip to explain, Maybe you might get some idea on how the formula works.


Book1
ABCDEFGH
1
2
3ItemQuantity PurchasedRateCumulative Total
4Part 1101000
5Part 11011010
62012020
71013040
8
9
10
11Quantity SoldSale PriceCumulative QuantityFifo Based Purchase PriceManual check
12111111101110
13311154236503650
Sheet1
Cell Formulas
RangeFormula
E4:E7E4=SUM($C$3:C3)
E12:E13E12=SUM($C$11:C12)
F12:F13F12=SUMPRODUCT(TEXT(E12-C12*{0,1}-$E$4:$E$7,"0;\0;0")*($D$4:$D$7-N(+$D$3:$D$6))*{1,-1})
H12H12=10*D4+1*D5
H13H13=9*D5+20*D6+2*D7
 
Upvote 0
Thanks @Bo_Ry

For your help. My formula turned out to be Almost Half Page long.
I have learnt the following today from you

New Microsoft Excel Worksheet.xlsx
WX
3N(+I would have Used If error
4"/0"In Text to convert (-) number to Zero
Sheet2


Thanks
 
Upvote 0
Different method, same results.
Book2
BCDEF
3ItemQuantity PurchasedRateCost varianceTotal previous purchase qty
4Part 1101001000
5Part 1101101010
6201201020
7101301040
8
9
10
11Quantity SoldSale PriceCumulative QuantityFifo Based Purchase Price
1211111110
1331115423650
Sheet31
Cell Formulas
RangeFormula
E4:E7E4=D4-N(D3)
F4:F7F4=SUM(C$3:C3)
E12:E13E12=SUM($C$12:C12)
F12:F13F12=SUMPRODUCT(--(E12>$F$4:$F$7),E12-$F$4:$F$7,$E$4:$E$7)-SUM(F$11:F11)
 
Upvote 0

Forum statistics

Threads
1,214,948
Messages
6,122,420
Members
449,083
Latest member
Ava19

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top