+ Reply to Thread
Results 1 to 5 of 5

Trying to Use VLOOKUP to Pull City & State from Zip Code Database

  1. #1
    Registered User
    Join Date
    01-31-2024
    Location
    Fairfax, Virginia
    MS-Off Ver
    Microsoft Office Standard 2019
    Posts
    4

    Trying to Use VLOOKUP to Pull City & State from Zip Code Database

    I am trying to use zip code locations to pull city and state data on each zip code. I downloaded a zip code database but the zip codes are in text format in the database. VLOOKUP formula is correct as far as I can tell -- =VLOOKUP(F2,ZipCode!A:D,3,FALSE) -- but I keep getting "Value is not available to the formula or function" error message (#N/A). I believe the issue is that the zip code database has the zip codes in text rather than number format. So, when I try to pull a value from the database compared to my zip code list (which is in number format), Excel does not read the value.

    My question is: how can I convert a column of zip codes in text format to number format?

    Thanks.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,733

    Re: Trying to Use VLOOKUP to Pull City & State from Zip Code Database

    Rather than trying to change them all, you can change the reference to F2 directly in the formula, like this:

    =VLOOKUP(F2&"",ZipCode!A:D,3,FALSE)

    which will convert the numeric F2 value into a text value.

    You might have to use the TEXT function if your zip codes are not pure numbers (e.g. if there are spaces in them).

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    01-31-2024
    Location
    Fairfax, Virginia
    MS-Off Ver
    Microsoft Office Standard 2019
    Posts
    4

    Thumbs up Re: Trying to Use VLOOKUP to Pull City & State from Zip Code Database

    Your suggestion worked perfectly. Thanks! Please let me know how I can support the forum with a donation. Much appreciated!

  4. #4
    Registered User
    Join Date
    01-31-2024
    Location
    Fairfax, Virginia
    MS-Off Ver
    Microsoft Office Standard 2019
    Posts
    4

    Thumbs up Re: Trying to Use VLOOKUP to Pull City & State from Zip Code Database

    Worked perfectly -- thanks!

    Please let me know how I can support the forum with a donation.

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,733

    Re: Trying to Use VLOOKUP to Pull City & State from Zip Code Database

    All contributions to the forum are offered free of charge - none of us get paid, and so do not solicit such rewards.

    There are two things you could do, however, to wrap up the thread:

    If that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post in this thread, and mark the thread as SOLVED.

    Also, since you are relatively new to the forum, you might like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

+ 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. Equation to Take a Zip code and Convert it to a City and State
    By jkfoxworth in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 11-08-2018, 03:25 PM
  2. [SOLVED] City & State from Zip Code
    By brucemc777 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-24-2017, 02:51 PM
  3. 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
  4. Parsing City State and Zip Code
    By sandy1977 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-27-2014, 11:58 AM
  5. [SOLVED] Combine VLOOKUP, LEFT, and ISNA to pull area code, place state, leave out #VALUE's?
    By chonchos in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-27-2013, 12:27 PM
  6. zip code to city, state function
    By xip in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-07-2012, 10:12 PM
  7. zip code to city, state function
    By xcelentform in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-18-2006, 07:10 PM

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