Microsoft Excel – How to SUM Cells Matching Specific Criteria

microsoft excelmicrosoft-excel-2010

Here's the excel table:

enter image description here

In B16 I'd like to insert the sum of all the cells in the range B1:B10 that have "*" on the right.
In this case B16 = 10 + 2 + 7 + 9 = 28

How can I do this with a formula?

P.S. I'm using Excel 2010.

Best Answer

You can use SUMIF function:

SUMIF( range, criteria, [sum_range] )

So in your case you would place in b16:

=SUMIF(c1:c10, "~*", b1:b10)

The tilde (~) in front of the * is to prevent the * of being used as a wildcard that could match anything non blank. The * alone only worked because there where only stars or blank cells in the criteria column but any other character would match. Credits to barry houdini in his comments.

Related Question