+ Reply to Thread
Results 1 to 11 of 11

Equation to Take a Zip code and Convert it to a City and State

  1. #1
    Registered User
    Join Date
    07-01-2015
    Location
    Tennessee
    MS-Off Ver
    MS Office 13
    Posts
    24

    Equation to Take a Zip code and Convert it to a City and State

    Hi,

    I have tried to do this a few different ways with out success. I have a list of zip codes and I want to convert it to a City and State. I have a master list of Zip Codes and their corresponding City and States. zip_code_image.JPG


    I have attached an image above ^ that hopefully shows this. I assume I would have to use VLOOKUP or INDEX(MATCH)?

    Thanks for any help and hopefully the image gives enough information.
    Attached Files Attached Files
    Last edited by jkfoxworth; 12-11-2015 at 01:01 PM. Reason: Adding Attachment

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Equation to Take a Zip code and Convert it to a City and State

    No one is going to want to retype your data for you (to test a solution). Please attach an Excel sheet, not a picture of one.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    12-08-2015
    Location
    Ottawa
    MS-Off Ver
    2010
    Posts
    25

    Re: Equation to Take a Zip code and Convert it to a City and State

    A Vlookup function will work, make sure to convert your Zip code columns to the same format( I see the green triangle in the top left corner of the cells you might have to fix that).

  4. #4
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Equation to Take a Zip code and Convert it to a City and State

    Quote Originally Posted by ImokatExcel View Post
    I see the green triangle in the top left corner of the cells you might have to fix that.
    That green triangle is warning the user of numbers stored as text (to prevent leading zeros being dropped).

    Given that all of the relevant data is in the same format, there would be nothing to fix.

  5. #5
    Registered User
    Join Date
    07-01-2015
    Location
    Tennessee
    MS-Off Ver
    MS Office 13
    Posts
    24

    Re: Equation to Take a Zip code and Convert it to a City and State

    I just added the excel attachment, I tried previously but it exceeded the size requirement so I reduced it a bit, thanks again for any help!

  6. #6
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Equation to Take a Zip code and Convert it to a City and State

    Enter formula in C2 and pull it to the right and then down.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  7. #7
    Registered User
    Join Date
    07-01-2015
    Location
    Tennessee
    MS-Off Ver
    MS Office 13
    Posts
    24

    Re: Equation to Take a Zip code and Convert it to a City and State

    Thanks AlKey, and everyone else, this gives me what I need, the data is a bit off like for state it's giving me the zipcode again and country it's giving me the state, but I can modify that. Thank you so much, this forum is awesome and will be adding reputations.

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Equation to Take a Zip code and Convert it to a City and State

    State:
    =IFERROR(VLOOKUP($B2,$G:$I,3,0),"Not Found")

    City;
    =IFERROR(VLOOKUP($B2,$G:$I,2,0),"Not Found")

    Don't use whole column ranges for the LOOKUP, as Excel will waste ages looking in empty cells.

  9. #9
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Equation to Take a Zip code and Convert it to a City and State

    Quote Originally Posted by jkfoxworth View Post
    Thanks AlKey, and everyone else, this gives me what I need, the data is a bit off like for state it's giving me the zipcode again and country it's giving me the state, but I can modify that. Thank you so much, this forum is awesome and will be adding reputations.
    Actually it does provide correct results.

    Please see attached file
    Attached Files Attached Files

  10. #10
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Equation to Take a Zip code and Convert it to a City and State

    As the data is already formatted as a table, then you could simply use

    =INDEX(Table2[State Abbreviation],MATCH(B2,Table2[ZIP Code],0))

    and

    =INDEX(Table2[City],MATCH(B2,Table2[ZIP Code],0))

  11. #11
    Registered User
    Join Date
    11-08-2018
    Location
    New York
    MS-Off Ver
    2010
    Posts
    1

    Re: Equation to Take a Zip code and Convert it to a City and State

    This is awesome, thanks so much.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. autofill city and state when typing in zip code
    By shughes6288 in forum Excel General
    Replies: 7
    Last Post: 01-07-2016, 12:35 PM
  2. City, State, Zip, Area Code - with - Company Name match
    By gmjhunter in forum Excel General
    Replies: 1
    Last Post: 02-05-2015, 07:08 PM
  3. Parsing City State and Zip Code
    By sandy1977 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-27-2014, 11:58 AM
  4. zip code to city, state function
    By xip in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-07-2012, 10:12 PM
  5. Web lookup query (have: city & state | want: zip code)
    By avatarr in forum Excel General
    Replies: 0
    Last Post: 04-07-2010, 10:49 PM
  6. zip code to city, state function
    By xcelentform in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-18-2006, 07:10 PM
  7. Replies: 6
    Last Post: 02-06-2005, 10:06 PM

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