+ Reply to Thread
Results 1 to 6 of 6

Count and IF function with 2 conditions

  1. #1
    Registered User
    Join Date
    09-07-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2007
    Posts
    2

    Count and IF function with 2 conditions

    Any assistance would be appreciated! What's the best way to count how many numbers in a row are between two criteria, > 40 and <=70? . If there is no data in the row that is between this criteria, I don't want to count it. Here's what I have so far:


    =IF((B8:J8>40),IF(B8:J8<=70,COUNT(B8:J8),0))
    The above formula returns a VALUE! error.

    Or do I write it this way?

    =COUNTIF(B8:J8,">40<=70")
    This gives a 0 value and there are numbers in my data that match this criteria.

  2. #2
    Valued Forum Contributor
    Join Date
    05-08-2012
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2003, 2010
    Posts
    811

    Re: Count and IF function with 2 conditions

    =countif(b8:j8,">=40")-countif(b8:j8,">=70")
    Click on star (*) below if this helps

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Count and IF function with 2 conditions

    TRy:

    =COUNTIFS(B8:J8,">40",B8:J8,"<=70")
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Count and IF function with 2 conditions

    Hi Megcam2,

    Try using below array formula:-
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    See attached :- count with 2 conditions.xlsx

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  5. #5
    Registered User
    Join Date
    09-07-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Count and IF function with 2 conditions

    A big THANK YOU to you all for your fast responses. Very helpful.

  6. #6
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Count and IF function with 2 conditions

    You are welcome Megcam2... Cheers

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1