I'm trying to figure out a way to allocate a sell transaction to tax lots where the order might change over time.
For example:
Say you have a table with four columns and the number of units of stock stored in a row across the four columns.
So
A1 has the number 10
A2 has the number 4
A3 has the number 20
A4 has the number 2
The number in each cell represents shares of stock you own but there is a different purchase date and cost basis for each.
Now you are going to do a sale 5 units.
Your optimization analysis says the units should be sold from A2 first, then A1, then A3, then A4. So you would sell 4 from A2 and 1 from A1 and update the values post sale.
New balances are:
A1 has the number 9
A2 has the number 0
A3 has the number 20
A4 has the number 2
Now you need to allocate the sale of 25 units and your optimization says they should be allocated in this DIFFERENT order: sell in the order of A4, A3, A1. Since A4 has only 2 units, you sell those. Then you sell the 20 units in A3 and then you sell 3 units from A1.
New Balances are:
A1 has 6
A2 has 0
A3 has 0
A4 has 0
Any sell transaction is contingent on the size of the sale v. the inventory you have in a given bucket but the order of operations from sales change. What is the best way to model this in Excel??
For example:
Say you have a table with four columns and the number of units of stock stored in a row across the four columns.
So
A1 has the number 10
A2 has the number 4
A3 has the number 20
A4 has the number 2
The number in each cell represents shares of stock you own but there is a different purchase date and cost basis for each.
Now you are going to do a sale 5 units.
Your optimization analysis says the units should be sold from A2 first, then A1, then A3, then A4. So you would sell 4 from A2 and 1 from A1 and update the values post sale.
New balances are:
A1 has the number 9
A2 has the number 0
A3 has the number 20
A4 has the number 2
Now you need to allocate the sale of 25 units and your optimization says they should be allocated in this DIFFERENT order: sell in the order of A4, A3, A1. Since A4 has only 2 units, you sell those. Then you sell the 20 units in A3 and then you sell 3 units from A1.
New Balances are:
A1 has 6
A2 has 0
A3 has 0
A4 has 0
Any sell transaction is contingent on the size of the sale v. the inventory you have in a given bucket but the order of operations from sales change. What is the best way to model this in Excel??