+ Reply to Thread
Results 1 to 3 of 3

Auto populate cell based on table option

  1. #1
    Registered User
    Join Date
    04-26-2014
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    21

    Auto populate cell based on table option

    Hello

    I am trying to automate a few cell items based on information in another cell. Clearly I would be able to accomplish the following with very long =if() equations, but I would like to avoid that if possible.

    The attachment is a picture of a small table. The left column is a city and the right column is the number of kilometers to that city.

    On a separate sheet, within the same worksheet, I would like to create a drop down menu with each of the cities. Then, when a city is selected, it auto-populates another cell with the kilometer value to the right.

    This will need to happen in 6 different places on the worksheet. Each city could be different in each of those places. And, cities are regularly added to this list. Therefore, I would like to create the drop down menu in such a way that I can just update the master list and all of the drop down menus will be automatically updated.

    I have only been able to accomplish this will extremely long =if statements and it makes that updating process extremely inefficient.

    I would be very grateful to anyone who is able to provide me with some direction on how to accomplish this.

    Thank you in advance!
    Attached Images Attached Images

  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 2406
    Posts
    44,662

    Re: Auto populate cell based on table option

    This is most easily done using a Named Range in Sheet 1 (CTRL-F3 to view it). It is called City. This currently allows a 100-long list of cities. Adjust the formula in the Named Range if needed. I then used DATA/VALIDATION in sheet 2 to allow the user to select only from items in the list of cities (sheet 2 column A). In column B, I used INDEX-MATCH to bring over the appropriate distance.

    Formula for Named Range:
    =Sheet1!$A$2:INDEX(Sheet1!$A$2:$A$100,COUNTA(Sheet1!$A$2:$A$100))

    formula for INDEX-MATCH
    =IFERROR(INDEX(Sheet1!B:B,MATCH(Sheet2!A2,Sheet1!$A$2:$A$100,0)),"")
    Attached Files Attached Files
    Last edited by Glenn Kennedy; 08-02-2016 at 06:44 AM.
    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

  3. #3
    Registered User
    Join Date
    04-26-2014
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Auto populate cell based on table option

    This was a perfect solution. Thank you very much for your time and help.

+ 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. How do I auto populate rows based on one cell value
    By chollo1988 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-26-2016, 05:01 PM
  2. Looking to auto populate a table based on specific cell text
    By ghansonp in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-05-2016, 04:29 PM
  3. [SOLVED] How to auto populate a table by entering a single value in one cell
    By jayc2111 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-10-2015, 12:51 PM
  4. [SOLVED] Trying to auto-populate based on if one column matches data from another table
    By joshley2010 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-21-2014, 11:15 AM
  5. [SOLVED] Auto Populate cell based on auto filter selection from table in same sheet
    By missydanni in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-02-2013, 05:03 PM
  6. Replies: 1
    Last Post: 03-08-2012, 10:07 PM
  7. Replies: 3
    Last Post: 02-28-2012, 11:54 AM

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