+ Reply to Thread
Results 1 to 7 of 7

Looking for if between statement

  1. #1
    Forum Contributor
    Join Date
    08-09-2006
    Posts
    147

    Looking for if between statement

    I have tried several formulas on the forum and help, but I can't get them to work.

    I need a formula to read
    if b13 is between 0 and 4 then return 10, or if b13 is between 5 and 9 then return 15 or if b13 if between 10 and 19 return 20.

    I tried this formula but kept getting an error.
    =IF(AND(B13>0,B13<=4),"10",0),IF(AND(B13>=5,B13<=9),"15",0),IF(AND(B13>=10,B13<=19),"20",0)

  2. #2
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: Looking for if between statement

    Try simple LOOKUP

    =LOOKUP(B13,{0,5,10},{10,15,20})
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, ?Born in USSR?
    Vusal M Dadashev

    Baku, Azerbaijan

  3. #3
    Forum Contributor
    Join Date
    05-29-2009
    Location
    Kalgoorlie Australia
    MS-Off Ver
    Excel 2007/10
    Posts
    251

    Re: Looking for if between statement

    Hello R
    Basisally or formula was correct, except the AND will result in a true or false answer,
    =IF(AND(B13>0,B13<=4)=true,"10",0),IF(AND(B13>=5,B13<=9)=true,"15",0),IF(AND(B13>=10,B13<=19)=true,"20",0)
    Regards
    Peter
    You may also need to remove the " "'s.

  4. #4
    Forum Contributor
    Join Date
    08-09-2006
    Posts
    147

    Re: Looking for if between statement

    Well, B13 may be any number. So, if it is 0 thru 4 then put 10, or if its 5 thru 9 then put 15. Does this help?

  5. #5
    Forum Contributor
    Join Date
    08-09-2006
    Posts
    147

    Re: Looking for if between statement

    Peter that return #value!. I even removed the " "

  6. #6
    Registered User
    Join Date
    10-25-2010
    Location
    Phoenix Arizona
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Looking for if between statement

    Here's how I usually write those formulas:

    =IF(B13<5,10,IF(B13<10,15,IF(B13<20,20,"")))

  7. #7
    Forum Contributor
    Join Date
    08-09-2006
    Posts
    147

    Re: Looking for if between statement

    That worked perfect. Thank you so much.

+ 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