Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

Thanks!

share|improve this question

1 Answer 1

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.

Syntax

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
    
COUNTIFS can be a great help - but for users of predecessors to Excel 2007 sadly not available. –  pnuts Jul 27 '12 at 16:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.