Excel Formula Explanation Needed (Excel file Attached)

teckxhenw

New Member
Joined
Mar 22, 2018
Messages
5
Hi all, i need help to understand the formulas in column P -> Column T. My goal is to perform first in, first out (FIFO) calculation, to show inventory price in the earliest purchase price.

Excel spreadsheet link:-
http://www.costviewer.com/files/CostViewer/Downloads/FIFO_model_for_many_products_no_VBA_v5.xlsx

Formulas
P19
SUM(--IF(MMULT(--(ROW(E$17:E18)>=TRANSPOSE(ROW(E$17:E18))),--IF(D$17:D18=H19,E$17:E18,0))<sumif(h$18:h19,h19,i$18:i19),1,0))

Q19
=SUMPRODUCT(--IF(OFFSET(D$17,,,P19+1)=H19,1,0),OFFSET(E$17,,,P19+1),OFFSET(G$17,,,P19+1))-SUMIF(H$18:H18,H19,T$18:T18)


R19
=(SUMIF(H$18:H19,H19,I$18:I19)-SUMPRODUCT(--IF(OFFSET(D$17,,,P19+1)=H19,1,0),OFFSET(E$17,,,P19+1)))*OFFSET(G$17,P19,,,)

T19
=IF(SUMIF(H$18:H19,H19,I$18:I19)>SUM(D$18:D19,H19,E$18:E19),MAX(SUMIF(D$18:D19,H19,F$18:F19)-SUMIF(H$18:H18,H19,J$18:J18),0),S19)</sumif(h$18:h19,h19,i$18:i19),1,0))
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Forum statistics

Threads
1,214,990
Messages
6,122,625
Members
449,093
Latest member
catterz66

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