+ Reply to Thread
Results 1 to 6 of 6

IF one to four numbers fall within a range

Hybrid View

sans IF one to four numbers fall... 11-04-2011, 01:33 PM
NBVC Re: IF one to four numbers... 11-04-2011, 01:40 PM
NBVC Re: IF one to four numbers... 11-04-2011, 01:45 PM
sans Re: IF one to four numbers... 11-04-2011, 04:58 PM
NBVC Re: IF one to four numbers... 11-04-2011, 10:31 PM
sans Re: IF one to four numbers... 11-05-2011, 07:26 PM
  1. #1
    Valued Forum Contributor sans's Avatar
    Join Date
    10-19-2011
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    550

    IF one to four numbers fall within a range

    Hello,

    I have a list of 5 numbers and I would like to get a checkmark when 1 to 4 numbers fall within a range of 1 to 4. For example,

    5-5-3-9-6 - This will get a checkmark because 1 number falls within 1 to 4
    1-3-4-4-2 - No checkmark as 5 numbers fall within 1 to 4 and the max is 4
    7-4-4-3-14 - Checkmark because 3 numbers fall within 1 to 4
    16-8-9-1-1 - Checkmark because 2 numbers fall within 1 to 4
    18-5-7-10-5 - No checkmark because no numbers for within 1 to 4 and the minimum is 1

    I have tried an IF AND statement but I cant figure out how to also apply the condition that if 1 to 4 numbers are within a range to get the checkmark.

    Thank you
    Sans
    Last edited by sans; 11-05-2011 at 07:43 PM.

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

    Re: IF one to four numbers fall within a range

    I am curious to why these sudden and rapid variations in requests over the last few days... is this homework?
    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.

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

    Re: IF one to four numbers fall within a range

    In the meantime, assuming range starts in C2:G2, then in H2:

    =IF(AND(COUNTIF(C2:G2,"<=4")>0,COUNTIF(C2:G2,"<=4")<=4),CHAR(252),CHAR(251))

    copied down

    Change font to Wingdings.

  4. #4
    Valued Forum Contributor sans's Avatar
    Join Date
    10-19-2011
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    550

    Re: IF one to four numbers fall within a range

    Haha, thank you so much for helping me, I 'm working on mathematical statistics.
    It works great! I have tried changing the criteria, for instance, when 2 to 4 numbers fall within a range of 3 to 5 but I keep getting errors. Do I have to change only the numbers or also something else to make it work?
    Again, thank you very much for your time and help! Sans

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

    Re: IF one to four numbers fall within a range

    Assuming you have Excel 2003 like your profile states, then you need to use SUMPRODUCT() instead of COUNTIF() to test 2 conditions....

    so try:

    =IF(AND(SUMPRODUCT(--(C2:G2>=3),--(C2:G2<=5))>=2,SUMPRODUCT(--(C2:G2>=3),--(C2:G2<=5))<=4),CHAR(252),CHAR(251))

  6. #6
    Valued Forum Contributor sans's Avatar
    Join Date
    10-19-2011
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    550

    Re: IF one to four numbers fall within a range

    Hi NBVC,
    Thank you very very much for your help. The formula works great! Exactly what I was looking for. I am working with excel 2010, sorry about that just updated today my profile. Again , thank you.
    Last edited by sans; 11-06-2011 at 10:20 AM.

+ 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