Google Sheets – Change Cell Value Based on Drop Down Selection

google sheetsgoogle-apps-script

I have a dropdown in sheet 1 which has the values "cat","dog", and "horse". On selection of a value, I want it to take the adjacent column as a key and search on it in another sheet and write the corresponding value next to it. For example:

This is sheet 1. Upon selection of "Cat" in A1, it takes the value of adjoining column i.e., "house1" and in sheet 2, a search is done for "house1" and in the adjoining column animal, the value "Cat" is written.

Best Answer

When I select "Cat" option in the drop-down list of A1 in sheet 1, it should write "Cat" in B2 of Sheet 2 using the "house1" as the key to write it there.

Sheet2!B2:

=ARRAYFORMULA(VLOOKUP(A2:A4,{Sheet1!B1:B3,Sheet1!A1:A3},2,0))