I want to build a simple word translator which may look like this:
- COLUMN A: I have a list of words, each on a row. (1:Airplane, 2:Car, 3:Cat, 4:Dog etc..)
- COLUMN B: I have a list of the same words in another language, each on a row. (1:Aereoplano, 2: Macchina, 3:Gatto, 4:Cane etc..)
-
Then I have two cells. In the first one, I can type any word. The second cell is the formula that I want to create. The formula should:
- check if "my word"(the word that I type) is in the list of column A
- if it exists, it should return its adjacent word of the second column
- If no words match, the formula should not return anything.
I'm struggling with finding the correct functions to accomplish this, any pointers are welcome.
UPDATE
I finally found the solution. Best solution for me is
=IFERROR(VLOOKUP(B7;'Table 1-1'::B4:D53;3;FALSE);0)
REALLY thanks for your help.
Best Answer
This answer to a related question explains how to use
VLOOKUP
in combination withIFERROR
.If
VLOOKUP
cannot find theexact match
, then it throws an error. To catch this error, wrapping the formula in theIFERROR
function allows the author to supply a default (in the OP's case, an empty string""
) to display in the event of no match.The following example uses a third table to display the translation. That table is then locked so as to protect the formula from being inadvertently overwritten. The words
NOT FOUND
are used here to show the error event.If match is found:
No match:
From the documentation: