Search code examples
excelvalidationdropdown

Reference other cells based on value from dropdown list


I have a sheet in which I store information about many variables (call this the reference sheet). I then have another sheet where I want to populate a column based on IDs from this other sheet, and then reference the other columns in the sheet depending on which ID is selected (either directly by pulling the values in - this may be easiest, or indirectly by using the values in a formula).

Example:

Reference Sheet:

Reference Sheet

What I'd like to create:

Main Sheet

Where the id "C" was created using Data Validation from the Reference Sheet ID column. What I want is for Var1 - Var3 to be created by referring to the row in the reference sheet corresponding to "C". Alternatively, a calculation (in this case it's the sum of var 1 + var 2 divided by var 3) based on these values could be done in this sheet. Note: for this example, I just copied the output I want - but I do not know how to create this dynamically (which is my question).

Is this something that is possible in Excel? If so, how would I do that?


Solution

  • Assuming that the reference sheet is called sheet1, you can put this formula in the other sheet (in cell B2): =INDEX(Sheet1!$B$2:$D$6,MATCH($A2,Sheet1!$A$2:$A$6,0),MATCH(B$1,Sheet1!$B$1:$D$1,0)). Use the fill handle to copy the formula to the cells to the right (until D2).

    And this formula in cell E2: =(B2+C2)/D2.

    enter image description here