1

Continuation of this thread

Formula so far. Match[n] = match criteria, HEADER = header criteria etc. This formula Sums the values of the header cells that match a specific criteria, ie: 6502, with this formula, could match a header /6502, then take the value of RETURNSUM, a named range and add them with other matches.

    =SUMPRODUCT((RETURNSUM*
(MID(HEADER,2,4)=IF(LEN(Match5)=4,Match5&"",Match5&" ")))+(RETURNSUM*
(MID(HEADER,2,4)=IF(LEN(Match6)=4,Match6&"",Match6&" ")))+(RETURNSUM*
(MID(HEADER,2,4)=IF(LEN(Match7)=4,Match7&"",Match7&" ")))

The idea is that HEADER and RETURNSUM will become match criteria like the matches written above, that way it would be easier to punch new criterion into the search table. As of the moment, it doesn't support multiple rows/dragging even though it did when written as cell ranges like $A2:$F2.

The question I have is, how do I go about making the named cells multi-row capable?

Community
  • 1
  • 1
Avan
  • 223
  • 3
  • 13

1 Answers1

1

You can use =INDEX(array,row_num,[col_num]) to achieve this.

The index formula will only take results from the corresponding row. Row(1:1) will automatically update when dragged down so INDEX can then grab the next row.

=SUMPRODUCT((INDEX(RETURNSUM,ROW(1:1),0)* (MID(HEADER,2,4)=IF(LEN(Match5)=4,Match5&"",Match5&" ")))+(INDEX(RETURNSUM,ROW(1:1),0)* (MID(HEADER,2,4)=IF(LEN(Match6)=4,Match6&"",Match6&" ")))+(INDEX(RETURNSUM,ROW(1:1),0)* (MID(HEADER,2,4)=IF(LEN(Match7)=4,Match7&"",Match7&" "))))

Glitch_Doctor
  • 2,994
  • 3
  • 16
  • 30