Hi all
I am a newbie here so please bear with me.
I have a simple calc that I would like to do.
I have a purchase history of various stock. It is simply listed as a purchase date and amount and shown as positive. The next cell down is the same concept. This continues until there is a sale which shows as a negative.
Does anybody know of a way that excel can scroll up and down the spreadsheet and work out which original batch the purchase inventory was from ? This is an example of my list.
transaction_datetime effective_datetime amount units
16/02/05 12:22 11/02/05 0:00 48106.41 45452.41
09/02/05 15:10 04/02/05 0:00 7176.44 6774.70
02/02/05 8:10 28/01/05 0:00 9123.26 8670.65
25/01/05 17:13 21/01/05 0:00 9627.53 9164.71
24/01/05 16:17 24/01/05 0:00 124.16 118.09
24/01/05 16:10 21/01/05 0:00 8857.29 8409.09
21/01/05 15:31 17/01/05 0:00 2604.13 2466.03
12/01/05 16:08 07/01/05 0:00 28295.23 26696.13
05/01/05 16:48 31/12/04 0:00 54609.33 51605.87
30/12/04 14:52 24/12/04 0:00 -2143.32 -2026.01
20/12/04 14:28 16/12/04 0:00 110.21 104.57
15/12/04 13:10 10/12/04 0:00 -8803.81 -8390.97
For example if we bought 2000 units, then 4000 the next day and sold 3000 on the third day.
How could excel work out that the sold units consisted of 2000 from the original batch and then another 1000 from the second batch. It also means that there is 3000 units from the second batch left on hand.
Sorry it is long winded