Subtract Cumulative Total until it reach zero with FIFO excel creation

cmkong87

New Member
Joined
Aug 8, 2019
Messages
1
Hi, i'm trying to create some subtract formula, but no idea how should i do it, the table below would show the result i desire:

ABCDEF
1DATESTOCK ITEMS NAMECOST PER STOCK (IN USD)QUANTITY OF STOCKSCUMULATIVE/ BALANCE OF STOCKSREMARK
21/1/2019XYZUSD 110001000BUY
315/1/2019XYZUSD 1(500)500SELL
431/1/2019XYZUSD 210001500BUY
52/2/2019XYZUSD ???(-1500)0SELL



<tbody>
</tbody>


For ROW 5, as i sell the entire stock, i need the First 500 cost at USD1, the remaing 1,500 at USD2, so how can i create and present an automate formula in the excel table?
Thanks.
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Forum statistics

Threads
1,214,652
Messages
6,120,746
Members
448,989
Latest member
mariah3

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