Google-sheets – Criteria to SUM if cell above is blank

google sheets

I am trying to get a sum of column values in a Google Spreadsheet only if there is no value in the column above. Consider the following example:

       A | B | C
  ---------------------------------
         |   | Formula on blank row
  Apple  | 1 |
  Apple2 | 2 |
         |   |
  Bravo  | 3 |
  Bravo2 | 5 |

The sum of A should return (1 + 3) which is 4.

I tried to use the following function in C1:

=SUMIF(B2:B,"<>"&"",A1:A)

This returns 0.

Best Answer

Turns out I was using the SUMIF formula wrong. This works:

=SUMIF(A1:A,"",B2:B)