I'd like to sum a column of cells if the corresponding cell on the next column contains a string of any sort. I've tried using SUMIF
but I can't figure out how to combine it with ISBLANK
or ISTEXT
.
For example, in this case the function should output 12.
---------
| 5 | x |
---------
| 6 | |
---------
| 7 | y |
---------
Best Answer
Here's the formula you need
First parameter :
The formula expects a range. This is why
ISTEXT(B1:B3)
alone doesn't work because it returns a single BooleanFALSE
.To return a range, you need to use
ARRAYFORMULA()
I.E :
ARRAYFORMULA(ISTEXT(B1:B3))
returns thisSecond parameter :
You choose when a value will be
SUM
; in this case it's whenISTEXT()
returnsTRUE
Third parameter :
In our case the range we are testing is different from the range we want to sum.