+ Reply to Thread
Results 1 to 9 of 9

Lookup up state abbreviations

  1. #1
    Registered User
    Join Date
    03-19-2009
    Location
    Columbus, OH
    MS-Off Ver
    Excel 2007
    Posts
    7

    Lookup up state abbreviations

    I have a spreadsheet that is used for sales territories. In column A, I have customer names, in column B, I have the State abbrev., In column C I would like to return as salesperson's name based on the State.

    Aco IL John Smith
    ABco OH Jane Doe
    Cco WI John Smith
    Czco IL John Smith
    Dco WY Adam Scott
    Fco UT Adam Scott
    FDco CT Bill Jones
    etc WI John Smith

    So I need a formula to enter in column C, that will return the correct salesperson based on the state in column B. (when auto filled down)

    For example: IL,WI,MN,IA,ND,SD = John Smith
    OH,PA,KY,MI, = Jane Doe
    etc

    Thanks!
    Last edited by Chakon; 08-04-2009 at 11:35 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: Not sure which function to use lookup, match or other

    If you create a list in the sheet with 2 columns... one containing the state abbreviations and the next containing the associated names then you can use Vlookup()

    e.g

    if in X1 you have:

    IL,WI,MN,IA,ND,SD

    and in Y1 you have:

    John Smith

    and in X2 you have:

    OH,PA,KY,MI

    and in Y2 you have:

    Jane Doe... etc..

    then use

    =VLOOKUP("*"&B2&"*",$X$1:$Y$100,2,0)

    where B2 contains State to lookup in your data and X1:Y100 contains the table described above...

    then 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
    Registered User
    Join Date
    03-19-2009
    Location
    Columbus, OH
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Lookup up state abbreviations

    Thanks! Worked perfectly.

    Was hoping there was an easy way to do it in cell without other reference cells, but we can make it work.

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

    Re: Lookup up state abbreviations

    Well there is a way you can do that if you are in XL2007... it would be a long and messy formula and difficult to update if needed in the future

    you can use LOOKUP() and list all 50 states with the associated people...



    e.g.

    =Lookup(B2,{"AL","AK","AR","AZ","CA","CO", etc.},{"John Smith","John Smith","Jane Doe","John Smith","John Smith","Jane Doe", etc...})

    Note: States have to be listed in Alphabetic order and in quotes and associated names have to be corresponding to order of states....

  5. #5
    Registered User
    Join Date
    03-19-2009
    Location
    Columbus, OH
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Lookup up state abbreviations

    Ahh I see, I had tried that, but didn't use the quotes.

    Thanks for the extra help!

  6. #6
    Registered User
    Join Date
    03-19-2009
    Location
    Columbus, OH
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Lookup up state abbreviations

    Actually, with regards to the Vlookup posted earlier, I was able to get it to work on my work CPU (Excel 2007), but I couldn't get it to work on my personal. (Excel 2003)

    Any idea why that may be?

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

    Re: Lookup up state abbreviations

    It should work exactly the same... are you getting error?

  8. #8
    Registered User
    Join Date
    03-19-2009
    Location
    Columbus, OH
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Lookup up state abbreviations

    #/NA was showing up for some reason. I triple checked the location as well.

    I might try it again from scratch when I get home.

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

    Re: Lookup up state abbreviations

    That error is returned if a match is not found.. so make sure actual state abbreviation exists in your side table and it is correct and that there are no extra spaces in the B2 reference..

    If you still have problems, post the workbook of likeness thereof.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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