OK, I created some fictional data to play with, located on Sheet1 in the range A2:C20000, then came up with some formulas for you. Because it looks like you have multiple transactions per day for any given Item, the SUMPRODUCT formula is heavily used here. (If the list displayed a daily total of xx units of item nn, I might have gone with a LOOKUP or INDEX/MATCH combo instead.) What I've done is create a day by day forecast of inventory based on a starting number in column C. Each column from D all the way to IV then does a SUMPRODUCT against the list of transactions, looking for those which both match the Item in column A, and match the date one year ago plus x days (x is determined by what COLUMN() the formula is in). I perform an INT operation against the list of dates on the off-chance that they are actually in date&time format, like my fictional data is. The SUMPRODUCT adds up those transactions, then the formula subtracts that number from the inventory. At some point, this results in a negative inventory level; that's your depletion date displayed in column B. (Manually highlighted two near-term depletions.) You see at the top something called EAF, entered in cell D1. That's my shorthand for Economy Adjustment Factor. This is where you can tell the spreadsheet that this year is better or worse than last year, and affect the forecast accordingly. If your sales this year are half of last year's, the EAF should be 0.5, if equal then EAF=1.0, if double then EAF=2.0 etc.
Here are the formulas, listed by cell number:
D2, copy across all the way to IV2:
="Proj Inv, close of business "&TEXT($B$1+COLUMN()-3,"mm/dd")
C3, copy down:
=$B$1+COUNTIF(D3:IV3,">"&0)+1
D3, copy this down and across all the way to IV:
=C3-$D$1*SUMPRODUCT(--(INT(Sheet2!$B$2:$B$20000)=Sheet1!$B$1-365+(COLUMN()-3)),--(Sheet2!$A$2:$A$20000=Sheet1!$A3),Sheet2!$C$2:$C$20000)
Here's an excerpt from the sheet:
Book1 |
---|
|
---|
| A | B | C | D | E | F | G | H | I | J | K | L | M |
---|
1 | Date: | 12/11/2009 | EAF: | 1 | | | | | | | | | |
---|
2 | Item | Projected depletion date | On Hand | Proj Inv, close of business 12/12 | Proj Inv, close of business 12/13 | Proj Inv, close of business 12/14 | Proj Inv, close of business 12/15 | Proj Inv, close of business 12/16 | Proj Inv, close of business 12/17 | Proj Inv, close of business 12/18 | Proj Inv, close of business 12/19 | Proj Inv, close of business 12/20 | Proj Inv, close of business 12/21 |
---|
3 | 100 | 12/18/2009 | 5000 | 4485 | 3650 | 2885 | 2055 | 1325 | 715 | -415 | -590 | -1715 | -1775 |
---|
4 | 101 | 2/8/2010 | 8000 | 7975 | 7715 | 7630 | 7385 | 7185 | 7150 | 7055 | 6880 | 6760 | 6710 |
---|
5 | 102 | 1/28/2010 | 7000 | 6975 | 6900 | 6615 | 6480 | 6310 | 6285 | 6235 | 6035 | 5760 | 5750 |
---|
6 | 103 | 12/21/2009 | 1000 | 815 | 755 | 735 | 700 | 675 | 640 | 340 | 115 | 90 | -5 |
---|
7 | 104 | 2/26/2010 | 12000 | 11780 | 11480 | 11370 | 11095 | 10785 | 10675 | 10630 | 10350 | 10255 | 10235 |
---|
|
---|