Reputation: 453
I'm trying create dynamic drop down list in MS Excel O365. I've made 2 tables in 2 different sheets. In below are table in "Workers" sheet:
And in "Order_status" sheet:
As for as these tables are concerned i inserted that data manualy. Now i'd like create dynamic drop down which in "ID_Worker" i get data from "Workers" sheet and when i select ID_WORKER in "Order_status" sheet:
a) not only displays ID_WORKER, FNAME, LNAME (For example 1 Paul Boy)
b) Automatically writes data into ID_WORKER, FNAME and LNAME columns.
I've done dynamic drop down list which it selects only ID_Workers from "Workers" sheet. And that source formula i've written like this:
=Workers!$A$2:$A$1048576
I'll explain what i'd like to do (In example):
1) In "Order status" are 3 columns: "ID_WORKER", "FNAME", "LNAME" but the data in this sheet are empty.
2) When i click on cell in "ID_WORKER" column then it shows like this: "1 Paul Boy".
3) Then i select value in this column later in "FNAME" and "LNAME" column should be written automatically: In "FNAME" is "Paul" and in "LNAME" should be "Boy".
I was searching for any solutions but i have still no clue what to do? Any ideas? Thx for any help! :)
Upvotes: 0
Views: 459
Reputation: 8220
You could try:
Sheet1 A1:C5
.=INDIRECT("tblWorkers[ID_WORKERS]")
.
For example purposes range used is Sheet1 E2:E5
.Formula for:
FNAME:=IF(E2<>"",IFERROR(VLOOKUP(E2,tblWorkers[#All],COLUMN(tblWorkers[FNAME]),FALSE),"Not Matched"),"")
For example purposes range is Sheet1 F2:F5
LNAME:=IF(E2<>"",IFERROR(VLOOKUP(E2,tblWorkers[#All],COLUMN(tblWorkers[LNAME]),FALSE),"Not Matched"),"")
For example purposes range is Sheet1 G2:G5
Image
Upvotes: 1
Reputation: 1
Select a cell where you want to create the drop-down list. Go to Data –> Data Tools –> Data Validation.
Upvotes: 0
Reputation: 175
You could use the field ID_Worker in sheet "Order_status" as a key, and lookup values of FNAME & LNAME from the "Workers" table.
Let's say your structure is as below: Sheet "Workers" Cell A1: 1, B1: Paul, C1: Boy Cell A1: 2, B1: Adam, C1: John Cell A1: 3, B1: Martin, C1: Ricky Cell A1: 4, B1: Adam, C1: King
You already have your dropdown in field ID_Worker, sheet "Order_status" (btw the way you're doing it will cause alot of blanks, best to limit it referencing to the total rowcount)
Input the formula into cell b2, sheet "Order_status":=iferror(vlookup($A2,Workers!$A:$C,2,0)) drag the formula down
Repeat the same for cell c2:=iferror(vlookup($A2,Workers!$A:$C,3,0)) drag the formula down
Upvotes: 0