Hi, I'm probably over complicating this....
I'm trying to use Index/Match with SUMIFS to add different ranges of sequenced of values. I'm hoping to avoid using an array formula, but not a deal breaker if I need one.
Is there a formula that will sum down (and stop) at a variety of different values, then stop summing? In my example the sum starts at letter "SG" and then needs to stops at the value that comes next after "SA" which could be either and variation of "T", "h", "S", or "SG". To make things harder, I wanted the sum to also omit any rows with "V" or "X" in an adjacent column.
Attached is my example sheet.
So far I've built this formula. But I'm stuck on the "SG" string. I don't know how to find/return the next value after "SA".
N(" T >> T Stop at T (skip over h, S, SG, SA)")+
IF(C21="T",ROUND(SUMIFS(L22:INDEX(L22:L$45,IFERROR(MATCH("T",C22:C$45,)-1,)),C22:INDEX(C22:C$45,IFERROR(MATCH("T",C22:C$45,)-1,)),"<>h",C22:INDEX(C22:C$45,IFERROR(MATCH("T",C22:C$45,)-1,)),"<>S",C22:INDEX(C22:C$45,IFERROR(MATCH("T",C22:C$45,)-1,)),"<>SG",C22:INDEX(C22:C$45,IFERROR(MATCH("T",C22:C$45,)-1,)),"<>SA",E22:INDEX(E22:E$45,IFERROR(MATCH("T",C22:C$45,)-1,)),"<>V",E22:INDEX(E22:E$45,IFERROR(MATCH("T",C22:C$45,)-1,)),"<>X"),0),
N(" h >> h Stop at h (skip over S, SG, SA)")+
IF(C21="h",ROUND(SUMIFS(L23:INDEX(L23:L$46,IFERROR(MATCH("h",C23:C$45,)-1,)),C23:INDEX(C23:C$45,IFERROR(MATCH("h",C23:C$45,)-1,)),"<>S",C23:INDEX(C23:C$45,IFERROR(MATCH("h",C23:C$45,)-1,)),"<>SG",C23:INDEX(C23:C$45,IFERROR(MATCH("h",C23:C$45,)-1,)),"<>SA",E23:INDEX(E23:E$45,IFERROR(MATCH("h",C23:C$45,)-1,)),"<>V",E23:INDEX(E23:E$45,IFERROR(MATCH("h",C23:C$45,)-1,)),"<>X"),0),
N(" S or SA >> Stop at any value T, h, S, SG, or SA (+1)")+
IF(OR(C21="S",C21="SA"),ROUND(SUMIFS(L22:INDEX(L22:L$45,IFERROR(MATCH(D21+1,D22:D$45,)-1,)),C22:INDEX(C22:C$45,IFERROR(MATCH(D21+1,D22:D$45,)-1,)),"<>s",E22:INDEX(E22:E$45,IFERROR(MATCH(D21+1,D22:D$45,)-1,)),"<>V",E22:INDEX(E22:E$45,IFERROR(MATCH(D21+1,D22:D$45,)-1,)),"<>X"),0),
N(" SG >> Stop at either T, h, S, SG (skip over SA)")+
?????
Bookmarks