Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 119
  • Last Modified:

Excel 2010

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?
0
darrellbuckley
Asked:
darrellbuckley
  • 5
  • 3
1 Solution
 
Jim RiddlesPrepress/OMS SpecialistCommented:
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.
VLookup-Sample.xlsx
0
 
darrellbuckleyAuthor Commented:
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.
0
 
darrellbuckleyAuthor Commented:
=VLOOKUP(F11,GA,2)
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Jim RiddlesPrepress/OMS SpecialistCommented:
Is it possible to share your sheet?  I will troubleshoot it for you.
0
 
darrellbuckleyAuthor Commented:
0
 
Jim RiddlesPrepress/OMS SpecialistCommented:
Darrell,

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:

State
=VLOOKUP(F9,GA,3)

Open in new window

City
=VLOOKUP(F9,GA,2)

Open in new window



Let me know if you have any other questions.
0
 
darrellbuckleyAuthor Commented:
Yahtzee! Thanks Jim, its working.
0
 
darrellbuckleyAuthor Commented:
Great Help!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now