Hi everyone, Here, I have a FIFO problem. File attached -
CalcHelp16102021_FIFO.ods (27.4 KB)
LT_Buy_Qty is stock which is more than 365 days old and ST_Buy_Qty is stock which is less than 365 days old. I already computed those values and put in appropriate columns.
SALE_Qty is to be deducted on FIFO basis from LT_Buy_Qty and ST_Buy_Qty.
(a) Total_Sale_Qty for each ISIN should be deducted on FIFO basis first from corresponding ISIN’s LT_Buy_Qty in Column E, till all of the LT_Buy_Qty of that ISIN is exhausted. The result would be shown in Column K.
(b) Balance, if any in Total_Sale_Qty of each ISIN beyond LT_Buy_Qty must be similarly deducted on FIFO basis from corresponding ISIN’s ST_Buy_Qty
(c) If there LT_Buy_Qty is zero Total_Sale_Qty FIFO deduction must be done from ST_Buy_Qty and shown in Column L.
(d) If Total_Sale_Qty for any ISIN is zero, needless to say, corresponding ISIN’s result in Column K and Column L will be LT_Buy_Qty and ST_Buy_Qty respectively.
thank you,