Excel 2010

Posted on 2015-01-16
Last Modified: 2015-01-16
I have three cells, city, state and zip. Id like to be able to enter a zip and have the city and state populated, anyway to do this within excel?
Question by:darrellbuckley
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3

Expert Comment

by:Jim Riddles
ID: 40554108
Yes, this can be accomplished with the VLOOKUP function.

For it to work, you need to have a sheet within your Excel file that includes the ZIP Code, City and State.  It is definitely recommended to give it a named range for reference.

Once that is done, on the sheet where you will be entering information, simply include a VLOOKUP function for the City and State cells.  I am attaching a sample XLSX file for your review.

IMPORTANT: You need to have your full list of ZIP Codes sorted numerically for this to function correctly!

If you have any questions about the file, let me know.

Author Comment

ID: 40554215
So I've selected my GA Cities, City, State and Zip from my Cities worksheet define the name as GA, went back to my test state tab where I have Zip State City, selected the state cell and inserted vlookup, when the userform pops up I put Zip cell in for lookup value the GA name for Table_array and 2 for the Col_index but nothing populates when I put in a zipcode.

Author Comment

ID: 40554216
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Expert Comment

by:Jim Riddles
ID: 40554221
Is it possible to share your sheet?  I will troubleshoot it for you.

Author Comment

ID: 40554235

Accepted Solution

Jim Riddles earned 500 total points
ID: 40554260

Okay, it looks like there are two issues.  First is to make sure the value you want to look up is in the left most cell.  Cut and paste your ZIP Code field in the "A" column.

Second, I didn't see a named range for "GA".  In your "Cities" sheet, after moving Zip to the first column, select the entire range of cells from A1:C974.  Once you have that done, right click on the cells and choose "Name a Range".  A dialog box will pop-up.  Enter "GA" as the name, make sure Workbook is selected as the scope, add whatever comment you desire (if any) and click "OK".

Now go back to the "Test State" sheet and " AVONDALE ESTATES" should be populated into the State field.  That is because the state is now in the the third column...simply adjust your function to reference the 3rd column and you are set.  Your function should look like the following:


Open in new window


Open in new window

Let me know if you have any other questions.

Author Comment

ID: 40554291
Yahtzee! Thanks Jim, its working.

Author Closing Comment

ID: 40554293
Great Help!

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This article describes a serious pitfall that can happen when deleting shapes using VBA.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question