Question

Trying to identify the syntax to do this in Excel 2010:

Look for the string "Potomac" in a range of rows. Wherever "Potomac" is found, count the whole numbers in the B and C column of that row. Search all rows in the same manner and sum the result.

I know that a long COUNTIF or COUNTIFS could do this but I have not been able to identify the syntax.

Was it helpful?

Solution

Assuming your data extends to 5 rows from row 1, try this single-cell formula:

{=SUM(IF(A1:A5="Potomac", B1:B5 + C1:C5, 0))}

This is an array formula, meaning you don't actually type the braces, but use Ctrl + Shift + Return once you've done editing.

(I'm at home without Excel so am doing this from memory. If it doesn't work it means I've slipped the syntax. Do let me know.)

OTHER TIPS

Try this, values in A1:A5

=COUNTIFS(A1:A5;"Potomac";B1:B5;"<>0")+COUNTIFS(A1:A5;"Potomac";C1:C5;"<>0")
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top