I have a Google Spreadsheet with 2 sheets. “Table1” and “Table2”.
Table 1 looks like this:
Column A = Name
Column B = Gender
In table2, I created a dropdown list in cilumn A that gets all the values from Table1, column1, rows 1-100. (Using Data > Validation > Criteria > Items from a list) Now in table2, column B, I want to display the value from table1, column B that is in the same row as the value I selected in the dropdown list.
So, let’s say in table1 I have
A B
John male
Kate female
Steve male
If I select “Steve” in the dropdown list on table2, column A, row 1, I want table 2, column B, row 1 to display “male”.
I tried to do it with Index, like I did in Excel, but then I get a value error, saying that the value in the dropdown is not a number.
Any help on this one? Thanks a lot!
The function that you want to use is
VLOOKUP. (Read about it here).So your cell in the second sheet, you would want to use this.
The following example table might help explain the “array” parameter.
Your lookup array would be the entire dataset. (Note: The first column of your array is where it searches). You would then provide
2as theindexbecause that is the column from the array that you want to output.So
VLOOKUPsearches through the first column of the array for whatever value you provide. When it finds it, it takes the cell in that row, and in the column you specify, and outputs that.