从多列中获取的Excel下拉列表

时间:2017-04-21 16:16:46

标签: excel validation drop-down-menu

我一直试图解决这个问题两个小时,我只需要寻求帮助。我想在Excel中有一个下拉列表,当你选择一个项目时,它也会从它旁边的列中提取信息。

第1页

Name | City | State
John | Cty1 | CA
Luke | Cty2 | IA
Kris | Cty3 | TX

第2页

Name | City | State
___v | ____ | __

所以我要做的就是当你在SHEET 2上选择名字时,它将从SHEET 1中取出城市和州,并自动将其填入SHEET 2的行。有人可以帮我这个吗?我疯了。

谢谢。

1 个答案:

答案 0 :(得分:0)

试试这个: -

To create dropdown for Name

1. First copy paste values of NAme from Sheet1 in Sheet2. Say you pasted them in A1 to A3.
2. Under name (say D3 cell in sheet2) column go to D4 cell just below name,then Go the 'Data validation' tab under 'data' tab. Select 'data validation' again, a dialog box will appear.
3. In the dialog box under 'Allow' select 'List' and then in 'Source' make a selection from A1 to A3.


    Now Use this formula in sheet2 
    for city 
    =IFERROR(VLOOKUP(D4,Sheet1!$D$15:$F$18,2,0)," ")

    for state
    =IFERROR(VLOOKUP(D4,Sheet1!$D$15:$F$18,3,0)," ")

    This is assuming in Sheet1 D15 to D18 has values for column Name & D4 is value of Name or Name dropdown in Sheet2

希望这会有所帮助: - )