Forum Discussion
Using If function to check text and return numerical value
- Mar 25, 2023
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), "")
If I have a specific letter or word in a cell I want to be able to create a formula in another cell to return a specific numerical value depending on the letter.
For example if cell A1 contains the letter C then in cell A2 the formula would return a value of 10.
If the letter was F then a value of 20 and so on.
Hope this makes it a bit clearer.
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), "")