Hi Alex,
Thank you for reaching out to us on the Microsoft Q&A forum.
With Excel, you may accomplish this by use the VLOOKUP or IF functions. Here's how to use both approaches to accomplish it:
Using IF
Function:
You can nest multiple IF functions to match numbers to specific text. For example, if you want to display the text in column B based on the number in column A, you can use the following formula in cell B1:
=IF(A1=1, "dinner room", IF(A1=2, "bathroom", IF(A1=3, "hall", "other")))
This formula checks the value in cell A1 and returns the corresponding text. If the value doesn’t match any of the specified numbers, it returns “other”.
Using VLOOKUP
Function:
A more scalable approach is to use the VLOOKUP function with a lookup table. First, create a lookup table with the numbers and their corresponding text. For example, you can place the table in cells D1:E3:
D1: 1 E1: dinner room
D2: 2 E2: bathroom
D3: 3 E3: hall
Then, use the following formula in cell B1 to look up the text based on the number in cell A1:
=VLOOKUP(A1, $D$1:$E$3, 2, FALSE)
This formula searches for the value in cell A1 within the range D1:E3 and returns the corresponding text from the second column of the range.
If the information is helpful, please accept the answer by clicking the "Upvote" and "Accept Answer" on the post. If you are still facing any issue, please let us know in the comments. We are glad to help you.