# Sum # in column only if cell contain text

Solved/Closed
xHaxelx Posts 5 Registration date Tuesday September 11, 2012 Status Member Last seen September 18, 2012 - Sep 11, 2012 at 10:27 AM
xHaxelx Posts 5 Registration date Tuesday September 11, 2012 Status Member Last seen September 18, 2012 - Sep 17, 2012 at 12:54 PM
Hello,

e.g. I am trying to sum up the row of number when a cell in the same row contains text "Ball"

[Column A]
Red Ball
Blue Ball
Chair
Pencil
Blue Ball

[Column B]
2
3
4
1
2

The resulting formula should output "7".

So far I have gotten "=IF(ISNUMBER(SEARCH("Ball",A1)),TRUE,FALSE). But I don't know how to sum up those specific rows without having to create another formula in another cell. Ideally I would want one cell, one formula.

Sincerely,
xHaxelx

## 1 response

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Sep 11, 2012 at 10:30 AM
=SUMIF(A:A,"*Ball",B:B)
xHaxelx Posts 5 Registration date Tuesday September 11, 2012 Status Member Last seen September 18, 2012
Sep 17, 2012 at 12:54 PM
Thank you!