Rows 2:8 show inputs. Rows 10:14 show desired output--I'd like a dynamic array formula in B10 that spills to B10:C14 (two columns in this example but I really need to spill to 40+ columns).
B2: Item1 needs 10,000 of purchases.
B8: Total purchases are 50,000.
B10: 10,000 of the purchases are allocated to Item1, so the new balance for Item1 is 0, and there are 40,000 of purchases to allocate to Items 2, 3, and part of 4.
Repeat for each Month (column).
So it's basically Rows 2:6 minus Row 8 = Rows 10:14, where no values in 10:14 would be negative and allocation order would cascade from Item1 to Item5.
B2: Item1 needs 10,000 of purchases.
B8: Total purchases are 50,000.
B10: 10,000 of the purchases are allocated to Item1, so the new balance for Item1 is 0, and there are 40,000 of purchases to allocate to Items 2, 3, and part of 4.
Repeat for each Month (column).
So it's basically Rows 2:6 minus Row 8 = Rows 10:14, where no values in 10:14 would be negative and allocation order would cascade from Item1 to Item5.
Book2 | |||||
---|---|---|---|---|---|
A | B | C | |||
1 | Month1 | Month2 | |||
2 | Item1 begin bal | 10,000 | 10,000 | ||
3 | Item2 begin bal | 11,000 | 23,000 | ||
4 | Item3 begin bal | 26,000 | 21,000 | ||
5 | Item4 begin bal | 7,000 | 11,000 | ||
6 | Item5 begin bal | 29,000 | 15,000 | ||
7 | |||||
8 | tot purchased | 50,000 | 20,000 | ||
9 | |||||
10 | Item1 end bal | 0 | 0 | ||
11 | Item2 end bal | 0 | 13,000 | ||
12 | Item3 end bal | 0 | 21,000 | ||
13 | Item4 end bal | 4,000 | 11,000 | ||
14 | Item5 end bal | 29,000 | 15,000 | ||
Sheet1 |