Forum Discussion

robindspain's avatar
robindspain
Copper Contributor
Mar 25, 2023
Solved

Using If function to check text and return numerical value

Hi community, I am tryng to create a formula, failing miserably, to read a certain text string and then return a numerical value depending on the text in the cell.   Any ideas would be greatly rec...
  • HansVogelaar's avatar
    HansVogelaar
    Mar 25, 2023

    robindspain

    You should create a list with two columns - the first containing the letters and the second the corresponding number:

    A 10
    F 20

    Select the list, click in the name/address box on the left hand side of the formula bar, enter a name, for example List, and press Enter.

     

    With a letter in cell A1, you can then use the formula

    =IFERROR(VLOOKUP(A1, List, 2, FALSE), "")

Resources