Maximum in Regular Intervals

drshkd

New Member
Joined
Dec 16, 2015
Messages
8
I have values in 3000 cells in F column which I need to find maxiumum value at regular intervals. For ex, max(F4:F28) in G4 cell, max(F29:F99) in H4 cell, max(F100:F124) in G5, max(F125:F195) in H5 cell & continue. Basically I have to find the maximum value for 25 rows in G column & then next 71 rows in H column, then next 25 rows in G column & next 71 rows in H column. Kindly help.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Welcome to the MrExcel board!

Check the ranges in my formula as you said 3000 rows of data, but that is not a multiple of 96 which is your stated grouping.
Each formula copied down
G4: =MAX(INDEX(F$4:F$3003,ROWS(G$4:G4)*96-95):INDEX(F$4:F$3003,ROWS(G$4:G4)*96-71))
H4: =MAX(INDEX(F$4:F$3003,ROWS(G$4:G4)*96-70):INDEX(F$4:F$3003,ROWS(G$4:G4)*96))
 
Upvote 0
Hi!

Another way:

In G4 and copy down and to the right

=MAX(OFFSET($F$4,96*(ROWS(G$4:G4)-1)+25*(COLUMNS($G4:G4)-1),0,25+46*(COLUMNS($G4:G4)-1),1))

Markmzz
 
Upvote 0
Comments:
- Since OFFSET is a volatile function, I generally try to avoid it where there is a feasible alternative. I do accept that with the data size stated in this problem, there is unlikely to be a performance issue.
- If OFFSET was to be used, I would still opt for separate formulas in each column to keep those formulas simpler & reduce calculation overheads. (It isn't much harder to copy/paste 2 formulas than 1)

G4: =MAX(OFFSET(F$4,(ROWS(G$4:G4)-1)*96,0,25,1))
H4: =MAX(OFFSET(F$4,(ROWS(G$4:G4)-1)*96+25,0,71,1))
 
Upvote 0
Hi!

Another way (without OFFSET function and with one formula):

In G4 and copy down and to the right

=MAX(INDEX($F:$F,4+25*(COLUMNS($G4:G4)-1)+96*(ROWS(G$4:G4)-1)):
INDEX($F:$F,28+71*(COLUMNS($G4:G4)-1)+96*(ROWS(G$4:G4)-1)))


Markmzz
 
Upvote 0
I thank you both Peter_SSs & markmzz for your prompt reply. I have checked both formulas & they are working like charm. Yeah, it is about 3000 cells not in particular. Who said that help is not available when you need it most. You just have to ask for it, some of World's greatest minds are there to help you out of any situation. I thank Mr.Excel team for this website.
 
Upvote 0
I thank you both Peter_SSs & markmzz for your prompt reply. I have checked both formulas & they are working like charm. Yeah, it is about 3000 cells not in particular. Who said that help is not available when you need it most. You just have to ask for it, some of World's greatest minds are there to help you out of any situation. I thank Mr.Excel team for this website.
You are very welcome. Glad we were able to help. :)
 
Upvote 0
I thank you both Peter_SSs & markmzz for your prompt reply. I have checked both formulas & they are working like charm. Yeah, it is about 3000 cells not in particular. Who said that help is not available when you need it most. You just have to ask for it, some of World's greatest minds are there to help you out of any situation. I thank Mr.Excel team for this website.

You are welcome and I'm happy that your problem was solved.

Markmzz
 
Upvote 0

Forum statistics

Threads
1,214,863
Messages
6,121,978
Members
449,058
Latest member
oculus

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