Forum Discussion

papabear89's avatar
papabear89
Copper Contributor
Apr 04, 2019
Solved

Index Match row problem

In the attached spreadsheet, I have set up the formula to sum the set of numbers in column A until a negative number is encountered in row 5.  I need to have the formula in the adjacent columns to sum to the same row irrespective of whether the number is positive or negative.  The answer in Column B should be $31 and the answer in Column C should be ($63).  I would appreciate any thoughts.

  • Twifoo's avatar
    Twifoo
    Apr 04, 2019
    I haven’t tested, but you may try, this formula in B11, copied across to C11:
    =SUM(B1:INDEX(B1:B10,
    MATCH(-1,INDEX(SIGN($A1:$A10),
    0),0)-1))

5 Replies

  • Twifoo's avatar
    Twifoo
    Silver Contributor
    You may use this formula in B11, copied across to C11:
    =SUMPRODUCT(B1:B10*($A1:$A10>0))
    • papabear89's avatar
      papabear89
      Copper Contributor

      TwifooThank you for responding.  Your answer worked given the information I gave earlier but I realize now that the parameters were not set up correctly.  I've attached another spreadsheet with more accurate parameters.  If I use your formula with the new set of numbers, the returned answer is not correct.

      • Twifoo's avatar
        Twifoo
        Silver Contributor
        I haven’t tested, but you may try, this formula in B11, copied across to C11:
        =SUM(B1:INDEX(B1:B10,
        MATCH(-1,INDEX(SIGN($A1:$A10),
        0),0)-1))