Task: See the MAX values in D:D originating from variable sub data ("item") counts within "groups":
A B C D ... X 1 Group A 5 100 2 Item1 3 3 Item2 5 4 Group B 8 5 Item1 1 6 Item2 7 7 Item3 8 8 Item4 2 9 End
Solution "positive" (evaluate the range C:C until the last local entry in C:C):
D1: =MAX(OFFSET(C2,,,MIN((1+$X$1-$X$1*(OFFSET(C2,,,$X$1,)=0))*ROW(INDIRECT("1:"&$X$1)))-1,))
must be entered as an array formula (Ctrl-Shift-Enter).
Solution "negative" (evaluate the range C:C before the first entry in A:A):
D1: =MAX(OFFSET(C2,,,MATCH("*",OFFSET(A2,,,$X$1,),),))
No array formula. A9 must contain something.
Both:
- Copy D1 manually to all "Group"-Headers, as to D4.
- 100 items per group are preset in X1 which can be altered easily.