Find a highest consecutive range in a column

EWek1

New Member
Joined
Jan 16, 2006
Messages
32
If I have a column with 365 rows with each cell representing total sales for each day of the year. If I wanted to find any 30 consecutive days with the highest sum, how could I do that?
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Interesting. Try:

ABCDE
1DaySalesDay30 Day Max
212517017191
32931
43295
54566
6510
76677

<tbody>
</tbody>
Sheet9

Array Formulas
CellFormula
D2{=MIN(IF(SUBTOTAL(9,OFFSET($B$2,ROW($B$2:$B$336)-ROW($B$2),0,30))=E2,$A$2:$A$336))}
E2{=MAX(SUBTOTAL(9,OFFSET($B$2,ROW($B$2:$B$336)-ROW($B$2),0,30)))}

<tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,128
Messages
6,129,040
Members
449,482
Latest member
al mugheen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top