+ Reply to Thread
Results 1 to 6 of 6

Excel Drop Down Help needed

  1. #1
    Registered User
    Join Date
    09-23-2015
    Location
    Bangalore
    MS-Off Ver
    2013
    Posts
    2

    Excel Drop Down Help needed

    Kindly help me in a scenario like below.

    Assume, Column A has list of countries say, A, B, C and Column B has its cities say, A1, A2, A3, B1, B2, C1,C2,C3, C4, ( A1,2,3 belong to A, and so on). Now in Column C, I want to list 'C2' cell with a drop down of countries. and in Column 4, I want to get the list of cities as a drop down again based on the country selected in C2 cell.

    How can this be done using excel dropdown funtion. Please guide me asap. Thanks.

  2. #2
    Forum Contributor
    Join Date
    08-04-2014
    Location
    Riga
    MS-Off Ver
    2010
    Posts
    579

    Re: Excel Drop Down Help needed

    Create a list of countries and corresponding cities.
    Use Define Name and create a list for countries and separate lists for cities in each country.

    Use Data validation to set up a drop down for the country.
    Use Data validation and set up a dropdown for the city using, in this case =INDIRECT(E2) formula so that the city dropdown will correspond to the country chosen.
    Attached Files Attached Files

  3. #3
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Excel Drop Down Help needed

    Hi, welcome to the forum.

    You need to create linked dropdowns by using Named Ranges, so that your second drop-down can refer to the Name selected in the first one.
    Set up four columns, with the headers like this:
    Countries | CountryA | CountryB | CountryC

    In Column A, you have the following:
    1 Countries (the header row)
    2 CountryA
    3 CountryB
    4 CountryC
    I've used 'CountryA' not just 'A' as these will be the Names later and it's not good to use just single letters.

    In Column B, you have:
    1 CountryA (the header row)
    2 A1
    3 A2
    4 A3
    5 A4
    In columns C and D you have the same as B, but using CountryB/B1/B2/B3/B4 and CountryC/C1/C2/C3/C4 instead.

    Now, name your ranges: select B2:B5 (the names of the CountryA cities) and type 'CountryA' into the Name box to the left of the formula bar. Repeat for C2:C5 and D2:D5. You can do the same for the countries by selecting A2:A4 with the name 'Countries'.

    Now set up your first drop-down list. Click in the cell you want this in (let's say it's F2), go to the 'Data' tab and click 'Data Validation'. Select 'List' in the 'Allow' box then click in the 'Source' box and select the range A2:A5. If you Named this range, you can type '=Countries' instead (without the inverted commas). Click OK.

    Now set up your second, linked, drop-down. Let's put it in G2. Click 'Data Validation' again and select 'List' again, then click in the 'Source' box. Now enter '=INDIRECT(F2)' (without the inverted commas).
    When you click OK you'll probably get an error saying 'The Source currently evaluates to an error. Do you want to continue?' - click 'Yes' - this just means that you haven't selected anything in the first drop-down box yet, so Excel gets confused by the blank cell.

    Now you can select your country in F2 and the choice in G2 will change to match it.

    The attached file shows this working: Multiple linked dropdowns _ for praveen_excellor.xlsx


    If there's a chance you will be adding more cities to the countries later, you could make the Named Ranges into dynamic ranges.
    You can find instructions for doing that here: https://support.microsoft.com/en-us/kb/830287

    Hope that all helps.
    Regards,
    Aardigspook

    I recently started a new job so am a bit busy and may not reply quickly. Sorry - it's not personal - I will reply eventually.
    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark this Thread as Solved'.
    If you use commas as your decimal separator (1,23 instead of 1.23) then please replace commas with semi-colons in your formulae.
    You don't need to give me rep if I helped, but a thank-you is nice.

  4. #4
    Registered User
    Join Date
    09-23-2015
    Location
    Bangalore
    MS-Off Ver
    2013
    Posts
    2

    Re: Excel Drop Down Help needed

    Thanks a ton people..!! Quite helpful

  5. #5
    Registered User
    Join Date
    09-23-2015
    Location
    SYDNEY
    MS-Off Ver
    2010
    Posts
    2

    Re: Excel Drop Down Help needed

    Quote Originally Posted by Aardigspook View Post
    Hi, welcome to the forum.

    You need to create linked dropdowns by using Named Ranges, so that your second drop-down can refer to the Name selected in the first one.
    Set up four columns, with the headers like this:
    Countries | CountryA | CountryB | CountryC

    In Column A, you have the following:
    1 Countries (the header row)
    2 CountryA
    3 CountryB
    4 CountryC
    I've used 'CountryA' not just 'A' as these will be the Names later and it's not good to use just single letters.

    In Column B, you have:
    1 CountryA (the header row)
    2 A1
    3 A2
    4 A3
    5 A4
    In columns C and D you have the same as B, but using CountryB/B1/B2/B3/B4 and CountryC/C1/C2/C3/C4 instead.

    Now, name your ranges: select B2:B5 (the names of the CountryA cities) and type 'CountryA' into the Name box to the left of the formula bar. Repeat for C2:C5 and D2:D5. You can do the same for the countries by selecting A2:A4 with the name 'Countries'.

    Now set up your first drop-down list. Click in the cell you want this in (let's say it's F2), go to the 'Data' tab and click 'Data Validation'. Select 'List' in the 'Allow' box then click in the 'Source' box and select the range A2:A5. If you Named this range, you can type '=Countries' instead (without the inverted commas). Click OK.

    Now set up your second, linked, drop-down. Let's put it in G2. Click 'Data Validation' again and select 'List' again, then click in the 'Source' box. Now enter '=INDIRECT(F2)' (without the inverted commas).
    When you click OK you'll probably get an error saying 'The Source currently evaluates to an error. Do you want to continue?' - click 'Yes' - this just means that you haven't selected anything in the first drop-down box yet, so Excel gets confused by the blank cell.

    Now you can select your country in F2 and the choice in G2 will change to match it.

    The attached file shows this working: Attachment 420787


    If there's a chance you will be adding more cities to the countries later, you could make the Named Ranges into dynamic ranges.
    You can find instructions for doing that here: https://support.microsoft.com/en-us/kb/830287

    Hope that all helps.
    Hope that all helps.[/QUOTE]
    Last edited by bonaparte2459; 09-23-2015 at 10:08 PM.

  6. #6
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Excel Drop Down Help needed

    @ praveen
    You're welcome.
    Last edited by Aardigspook; 09-24-2015 at 04:56 AM.

+ 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. Help needed : Dependent Drop down List
    By mysaraa in forum Excel General
    Replies: 3
    Last Post: 09-01-2015, 01:10 AM
  2. [SOLVED] Drag & Drop Chart Series Points At Run Time (Help Needed From Excel VBA Gurus)
    By NeedForExcel in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-08-2015, 07:08 AM
  3. needed macro for dynamic drop down
    By balu.vasa in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-17-2013, 10:25 AM
  4. Help needed for drop-down list
    By stuckandneedhelp in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-21-2012, 04:28 PM
  5. help needed - removing blanks from drop-down list
    By pelzak in forum Excel General
    Replies: 4
    Last Post: 02-08-2012, 07:35 AM
  6. Assistance needed with drop downs in excel 2007
    By wooley2000 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-12-2010, 04:35 AM
  7. Drop down list or combo box help needed
    By metrueblood in forum Excel General
    Replies: 1
    Last Post: 01-12-2005, 06: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