2017-04-21 87 views
0

我一直試圖弄清楚這兩個小時,現在我只需要尋求幫助。我想在Excel中有一個下拉列表,當你選擇一個項目時,它也會從它旁邊的列中獲取信息。從多列中提取Excel的下拉列表

表1

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

SHEET 2

Name | City | State 
___v | ____ | __ 

所以我試圖做的是,當你選擇在表2中的名字,它會採取城市和國家從表1和自動將其填充到SHEET 2的行中。有人可以幫我解決這個問題嗎?我瘋了。

謝謝。

回答

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 

希望這有助於:-)

+0

這就是它!謝謝你,謝謝你,謝謝你! – evenmonkeys

+0

歡迎您! –