+ Reply to Thread
Results 1 to 4 of 4

So Many Numbers, Too Little Knowledge. What to do with more than 7 "IF,OR" statements?

  1. #1
    Registered User
    Join Date
    06-29-2012
    Location
    Florida, US
    MS-Off Ver
    Excel 2007
    Posts
    1

    So Many Numbers, Too Little Knowledge. What to do with more than 7 "IF,OR" statements?

    I have looked through forum after forum and I have come to the conclusion that I need something that would combine IF and "In between" functions hundreds of times. I have a list of numbers and I am trying to see if each number falls into any of a list of ranges...for example these are 10 of my ranges (A:B), with 3 of my numbers being tested (C), and what should happen in the D column. Even in this example each number would need to be tested 10 times with YES occurring if it happens to fall within any one of the ranges.

    .....A............B..........C.......D
    1419.579 1422.421 1382 YES
    1413.585 1416.415 1270 NO
    1381.617 1384.383 1421 YES
    1375.623 1378.377
    1344.654 1347.346
    1332.666 1335.334
    1308.69 1311.31
    1302.696 1305.304
    1272.726 1275.274
    1266.732 1269.268

    I don't need to know which range a random number falls in, but I need to know if the number is included in any of the ranges. I thought an IF with a MEDIAN statement would do it with the formula...

    =if(or(C1=MEDIAN(A1:B1),C1=MEDIAN(A2:B2),"Yes","No")

    The idea behind this formula works, but I have about 800 ranges and about 2000 numbers to test whether or not they exist in any of the ranges and working with excel I know there has got to be an easier way.
    Last edited by brokerbreaker; 06-29-2012 at 10:49 AM.

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

    Re: So Many Numbers, Too Little Knowledge. What to do with more than 7 "IF,OR" statements?

    Try:

    =IF(COUNTIFS($A$2:$A$11,"<="&C2,$B$2:$B$11,">="&C2),"YES","NO")

    adjusting ranges to suit... and copy down.
    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
    Valued Forum Contributor
    Join Date
    10-13-2010
    Location
    Sunderland, England
    MS-Off Ver
    Excel 2007 (Home) / 2003 (Work)
    Posts
    740

    Re: So Many Numbers, Too Little Knowledge. What to do with more than 7 "IF,OR" statements?

    =if(sumproduct(--($a$1:$a$10<c1)*--($b$1:$b$10>c1))>0,"yes","no")

  4. #4
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: So Many Numbers, Too Little Knowledge. What to do with more than 7 "IF,OR" statements?

    Try this:

    Please Login or Register  to view this content.
    Well, that depends on the ranges being sorted in descending order.

+ 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