Average max of every nth data set

santomax

New Member
Joined
Aug 27, 2022
Messages
6
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
  5. 2013
  6. 2011
  7. 2010
  8. 2007
Platform
  1. Windows
Hi there

I have to get the average of the max of given data sets, skipping a yellow row in between. So for example Calculate the max of B4:B13 and the skip B14, to then calculate the max of B15:B24 and so on and so forth. to at the end average all of the max values calculated. I have been trying with array formulas and using MOD row functions, but I only make it work for single cell values, not for "data set" ranged to select the MAX (an example I made to calculate the average of every YELLOW row skipping 11 rows was =AVERAGE(IF(MOD(ROW(B:B)-ROW(B3),11)=0,IF(B:B<>"",B:B))).

Some help would be very appreciated!
 

Attachments

  • Annotation 2022-08-27 160725.png
    Annotation 2022-08-27 160725.png
    13.5 KB · Views: 9

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Welcome to the Forum!

With Excel 365, you could do it along these lines:

ABCDE
1Groups4
2Length5
3Gap1
4
51Result12.25
62CHECK12.25
73
84
95
10
119
128
137
146
155
16
1712
1813
1911
2010
219
22
2319
2420
2521
2622
2721
28
Sheet1
Cell Formulas
RangeFormula
E5E5=LET(start,B5,grps,C1,L,C2,G,C3,d,OFFSET(start,,,grps*(L+G)),AVERAGE(BYROW(INDEX(d,SEQUENCE(grps,,0,L+G)+SEQUENCE(,L)),LAMBDA(r,MAX(r)))))
E6E6=AVERAGE(MAX(B5:B9),MAX(B11:B15),MAX(B17:B21),MAX(B23:B27))
 
Upvote 0
Result​
12.25​
6
2​
CHECK​
12.25​
7
3​

Welcome to the Forum!

With Excel 365, you could do it along these lines:

ABCDE
1Groups4
2Length5
3Gap1
4
51Result12.25
62CHECK12.25
73
84
95
10
119
128
137
146
155
16
1712
1813
1911
2010
219
22
2319
2420
2521
2622
2721
28
Sheet1
Cell Formulas
RangeFormula
E5E5=LET(start,B5,grps,C1,L,C2,G,C3,d,OFFSET(start,,,grps*(L+G)),AVERAGE(BYROW(INDEX(d,SEQUENCE(grps,,0,L+G)+SEQUENCE(,L)),LAMBDA(r,MAX(r)))))
E6E6=AVERAGE(MAX(B5:B9),MAX(B11:B15),MAX(B17:B21),MAX(B23:B27))
HI.
This formula works wonders! the only problem that I have, is that the grp number is a limited fixed variable, I would like to be able to make it like a dynamic range that if add new data, it recalculates w/o needed to update the group number, and also because if the group number will calculate the average of empty cells, diving the average by an empty value; i.e If I have 4 groups, two blank and tow with a MAX of 20, the average comes up to 10.
I know that Im asking for a lot, but I do really appreciate the formula you created, totally our of my league xD
 
Upvote 0
Will this be more suitable:

ABCDE
1Groups4
2Length5
3Gap1
4
51Result12
62CHECK12
73
84
95
10
119
128
137
146
155
16
17
18
19
20
21
22
2319
2420
2521
2622
2721
28
Sheet1
Cell Formulas
RangeFormula
C1C1=CEILING((LOOKUP(2,1/ISNUMBER(B:B),ROW(B:B))-ROW(B5)+1)/(C2+C3),1)
E5E5=LET(start,B5,grps,C1,L,C2,G,C3,d,OFFSET(start,,,grps*(L+G)),AVERAGE(BYROW(INDEX(d,SEQUENCE(grps,,0,L+G)+SEQUENCE(,L)),LAMBDA(r,IF(COUNT(r),MAX(r))))))
E6E6=AVERAGE(MAX(B5:B9),MAX(B11:B15),MAX(B23:B27))
 
Upvote 0

Forum statistics

Threads
1,214,980
Messages
6,122,563
Members
449,088
Latest member
Motoracer88

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