# Thread: Countif with 2 conditions (Excel XP)

1. ## Countif with 2 conditions (Excel XP)

I would like to count a range and select basis on 2 criteria. I've tried COUNTIF(B3:B11,AND(B3>5,B3<7)) but I think I'm barking up the wrong tree

In the attached I would like to count the number of entries between 5 & 7

TIA

2. ## Re: Countif with 2 conditions (Excel XP)

=COUNTIF(B3:B11,">5")-COUNTIF(B3:B11,">=7")

3. ## Re: Countif with 2 conditions (Excel XP)

COUNTIF and SUMIF don't work with multiple conditions, but see the next reply by Pieterse. There are several possibilities:

=SUMPRODUCT((B3:B11>5)*(B3:B11<7))

or an array formula, to be confirmed with Ctrl+Shift+Enter:

=SUM((B3:B11>5)*(B3:B11<7))

Both use the fact that TRUE =1 and FALSE = 0.

4. ## Re: Countif with 2 conditions (Excel XP)

What can I say. Hans your are good BUT the second one is sooo easy

Thanks

Mario

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•