Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have some Excel columns that look like this.

1774    David                    Not Upheld
1770    James                    Upheld
1771    David                    Upheld
1772    Sam                      Upheld
1768    Arthur                   Not Upheld
1769    James                    Upheld

How can I write an Excel formula for: count the number of rows with 'James' in column B, and 'Upheld' in column C?

I know how to do each of these conditions individually (using COUNTIF), but I'm not sure of the best way to combine them.


share|improve this question
up vote 7 down vote accepted

Use COUNTIFS instead.

The COUNTIFS function, similar to COUNTIF function, counts up the number of times data in two or more ranges of cells meets multiple criteria.

The ranges must be of identical size, and the function only counts instances where the criterion for each range is met simultaneously - such as in the same row.


COUNTIFS(range1, criteria1, range2, criteria2…)
share|improve this answer
Genius. Thank you! – AP257 Jul 21 '10 at 13:44
You're more than welcome. – Mehper C. Palavuzlar Jul 21 '10 at 14:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .