I'd like to sum the cells in a column where the cell above contains a string. For example, sum all the cells where the cell directly above contains the string "Transport".
For example, in the following (which I have just inserted the correct numbers into), the 'Total transport' cell contains 42 as it is the sum of 10 + 20 + 12, from those cells with the string 'Transport' above them.
Best Answer
You can use do it in several steps :
Using
=IF (logical_test, [value_if_true], [value_if_false])
=IF(A1="hello", A2,0)
- this will set the values in the B column according the existence of a string. Than you can use=SUM(B2:B12)
.