if-statementgoogle-sheetsequality

Relate names with Id's


I'm trying to relate some Ids with names as the image below:

enter image description here

Basically I would like to create a relation between the institutes and their corresponding Ids, at my first thought was doing something like =if(A2 = 81, "Institute example 1", ""), but I would like to know if there is a better way to do it.


Solution

  • Depending on what you are trying to do with it you could use VLOOKUP. I have created this sample spreadsheet where you can just introduce the name of the institution and get the ID based on the name, so that would create the relation between them.

    The formula I used in this sample spreadsheet is:

    = VLOOKUP(G3,B4:D8,3,FALSE)
    

    enter image description here

    Ref: