I have a table of expected outputs by calendar day. I want to specify a target number of outputs (user entry, cell B1), then for any given start date, calculate the end date whose elapsed period (given that start date) will yield at least that target amount of outputs.
Example follows - I need a formula (prefer not to use VBA) that will calculate the stop dates, shown in red in Column E (note: for the sake of this example, I manually determined the appropropriate stop dates an inseted them in Column E).
Excel 2007
Thanks in advance!
SDL
Example follows - I need a formula (prefer not to use VBA) that will calculate the stop dates, shown in red in Column E (note: for the sake of this example, I manually determined the appropropriate stop dates an inseted them in Column E).
Excel Workbook | ||||||||
---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | |||
1 | Target output: | 4 | Units | |||||
2 | ||||||||
3 | ||||||||
4 | Expected Output | ( Units by Date) | Date Range | to Achieve | Target Output | |||
5 | ||||||||
6 | Date | Units | StartDate | StopDate | Units Yield | |||
7 | 1/1/2012 | 0 | 1/1/2012 | 1/7/2012 | 4 | |||
8 | 1/2/2012 | 0 | 1/2/2012 | 1/7/2012 | 4 | |||
9 | 1/3/2012 | 0 | 1/3/2012 | 1/7/2012 | 4 | |||
10 | 1/4/2012 | 1 | 1/4/2012 | 1/7/2012 | 4 | |||
11 | 1/5/2012 | 0 | 1/5/2012 | 1/8/2012 | 5 | |||
12 | 1/6/2012 | 1 | 1/6/2012 | 1/8/2012 | 5 | |||
13 | 1/7/2012 | 2 | 1/7/2012 | 1/8/2012 | 4 | |||
14 | 1/8/2012 | 2 | 1/8/2012 | 1/12/2012 | 4 | |||
15 | 1/9/2012 | 0 | etc | |||||
16 | 1/10/2012 | 1 | ||||||
17 | 1/11/2012 | 0 | ||||||
18 | 1/12/2012 | 1 | ||||||
19 | 1/13/2012 | 1 | ||||||
20 | etc | |||||||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
F7 | =SUMIFS($B$7:$B$19,$A$7:$A$19,">="&D7,$A$7:$A$19,"<="&E7) | |
F8 | =SUMIFS($B$7:$B$19,$A$7:$A$19,">="&D8,$A$7:$A$19,"<="&E8) | |
F9 | =SUMIFS($B$7:$B$19,$A$7:$A$19,">="&D9,$A$7:$A$19,"<="&E9) | |
F10 | =SUMIFS($B$7:$B$19,$A$7:$A$19,">="&D10,$A$7:$A$19,"<="&E10) | |
F11 | =SUMIFS($B$7:$B$19,$A$7:$A$19,">="&D11,$A$7:$A$19,"<="&E11) | |
F12 | =SUMIFS($B$7:$B$19,$A$7:$A$19,">="&D12,$A$7:$A$19,"<="&E12) | |
F13 | =SUMIFS($B$7:$B$19,$A$7:$A$19,">="&D13,$A$7:$A$19,"<="&E13) | |
F14 | =SUMIFS($B$7:$B$19,$A$7:$A$19,">="&D14,$A$7:$A$19,"<="&E14) |
Thanks in advance!
SDL