Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Aug 2001
    Location
    Cape Town, South Africa, South Africa
    Posts
    399
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Countif with 2 conditions (Excel XP)

    =COUNTIF(B3:B11,">5")-COUNTIF(B3:B11,">=7")
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    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. #4
    3 Star Lounger
    Join Date
    Aug 2001
    Location
    Cape Town, South Africa, South Africa
    Posts
    399
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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
  •