Adding variable range of numbers
Thank you -- this worked! I got a couple good solutions -- I'm going to try
the one Glenn suggested and don't have to use 2 worksheets.
"Sheeloo" wrote:
Here is one way...
Assuming you have your data in Sheet1 with header row
1. In Sheet 2 A1 enter
=Sheet1!A1 and copy down till end of your data set...
This will give you the Part Nos
2. In Sheet2 C2 enter
=SUM(Sheet1!C2:INDIRECT("Sheet1!"&CHAR(Sheet1!$B2+ 65+COLUMN(Sheet1!A2))&ROW()))
and copy to U2
This will give you running total for no. of days equal to the value in
Sheet1 B1
(Of course, if you have, say 5 in B2, then last four totals will be partial
for 4,3,2 and 1 day)
3. In Sheet2 B2 enter
=MAX(C2:U2)
and copy down till end of your data set
This will give you the Maximum as required...
Test this out and let me know...
--
Always provide your feedback...
"mwavra" wrote:
I'm not even sure if this is possible, but I've thought about it a while,
cruised through a lot of the posts, and thought I'd go to the experts and see
if they can help.
Part No Leadtime Monday Tuesday Wednesday Thursday Friday
11154001 5 2000 2530 2020 1860 2640
11154002 4 3200 2530 2020 1860 2640
11154003 3 5000 2530 2020 1860 2640
11154004 2 1700 2530 2020 1860 2640
11154005 1 2250 2530 2020 1860 2640
The columns go out for 4 weeks - Monday thru Friday. Based on the lead time,
I need to find the highest demand within the 4-week time frame. So, if the
lead time is 5, I need to add Monday thru Friday, Tuesday thru Monday,
Wednesday thru Tuesday, etc., and find the highest total demand for that
item. If I change the lead time from a 5, to a 4, it would need to
recalculate and give the highest demand over a 4-day period.
Can anyone help?
|