+ Reply to Thread
Results 1 to 6 of 6

Evaluate input and return three possible outcomes

  1. #1
    Registered User
    Join Date
    01-19-2012
    Location
    Calgary, Alberta
    MS-Off Ver
    Excel 2010
    Posts
    18

    Evaluate input and return three possible outcomes

    I'm having some serious brain farts today in trying to get this to work completely. What I need to do is:

    If A1 < 30, "0-30"
    If A1 > 30 but < 60, "31-60"
    If A1 > 60 "61+"

    What I've got is: =IF(A1<31, "0-30", (IF(AND(A1>30, I2<60),"31-60"),IF(A1>60, "61+")))
    What I keep getting is #VALUE!

    I know it's something simple...but my brain doesn't want to work right it seems, haha.

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: 3 value range

    Try..

    =IF(A1<=30,"0-30",IF(A1<=60,"31-60","61+"))
    or
    =LOOKUP(A1,{0,31,61},{"0-30","31-60","61+"})
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: 3 value range

    How about

    =LOOKUP(A1,{0,30,60},{"0-30","31-60","61+"})
    HTH
    Regards, Jeff

  4. #4
    Registered User
    Join Date
    01-19-2012
    Location
    Calgary, Alberta
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: 3 value range

    Quote Originally Posted by Ace_XL View Post
    Try..

    =IF(A1<=30,"0-30",IF(A1<=60,"31-60","61+"))
    Bingo! We have a winner, thanks!

  5. #5
    Valued Forum Contributor
    Join Date
    09-10-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    929

    Re: Evaluate input and return three possible outcomes

    Try this formula...

    =IF(A1<31, "0-30", (IF(AND(A1>30,A2<60),"31-60",IF(A1>60, "61+"))))

    You had the parentheses on the wrong place...

    You can also create a VLOOKUP table for this... let me know if this is an option for you or if you want to see how it's done...

  6. #6
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Evaluate input and return three possible outcomes

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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