Search code examples
google-sheetsgoogle-sheets-formulasubstitution

Substituting Names in Google Sheets


I am looking for the best away to transfer and change to name in a cell.

Example: I have a table of acronyms such as: LRG, LAA, LBG I want to create a function that lists the full names in a table next to it.

I want it it to read "LRG" and know to insert "Large" in the cell next two it. The table with the acronyms will change daily and I would like the corresponding full names to change with it.

Any help would be greatly appreciated.

I tried to use the substitute function =substitute(B34, "LRG", "Large". However, as the acronym table will change I have to keep updating the names that I am substituting.


Solution

  • As you have lookup table then could use XLOOKUP().

    =XLOOKUP(A2,D:D,E:E)
    

    For dynamic array use BYROW() or MAP() function.

    =BYROW(A2:A4,LAMBDA(x,XLOOKUP(x,D:D,E:E)))
    

    enter image description here