+ Reply to Thread
Results 1 to 3 of 3

Way:If Statement

  1. #1
    Registered User
    Join Date
    11-12-2008
    Location
    Iowa
    Posts
    32

    Way:If Statement

    I have a spreadsheet where the area column has numbers between 1 and 22.

    What I want to do is to add a column to the right of that and based on the number, it puts a value. For example, if it is numbers 1 through 7, it will say South. 8-9, it will say West, etc etc.

    I stared to do this with an If statement, but given that there are 22 numbers, it was an incredibly long if statement. Is there a shorter way to do this? I found a way to do is using the Vlookup function, but i need to send the solution to somebody to use for their spreadsheets, and teaching them the Vlookup function is near impossible.

    Is there an easy way to do this? here are the values:


    1 South
    2 South
    3 South
    4 South
    5 South
    6 South
    7 South
    8 West
    9 West
    10 East
    11 East
    12 East
    13 East
    14 East
    15 East
    16 West
    17 West
    18 North
    19 North
    20 North
    21 North
    22 North


    Thank you in advance.

  2. #2
    Forum Contributor bentleybob's Avatar
    Join Date
    02-27-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    644

    re: Way:If Statement

    =IF(A1<8,"South",IF(A1<10, "West",IF(A1<16,"East",IF(A1<18,"West","North"))))

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

    re: Way:If Statement

    If you want one that you probably won't get questioned on, then try:

    =IF(A2="","",IF(A2>=20,"North",IF(A2>=16,"West",IF(A2>=10,"East",IF(A2>=8,"West","South"))

    a simple nested if.

    or you could also use:

    =LOOKUP(A2,{0,1,8,10,16,18},{"","South","West","East","West","North"})
    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.

+ 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