How to assign a word to a number

ithinkkbluee

New Member
Joined
Nov 24, 2023
Messages
1
Office Version
  1. 365
  2. 2021
  3. 2019
Platform
  1. Windows
  2. MacOS
Hi,
As the title says I am trying to assign words to a number.

For example, in one column I want the number 1 to automate into the word ankle, 2 to automate into knee, etc.
So essentially its, 1=ankle, 2=knee, 3=leg... The key point is that I don't want to type in ankle/knee/leg repeatedly, just the number.

Is there a formula in excel for this?
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
First, make a predefined list of your words at somewhere else. Then the formula will be:
Excel Formula:
=VLOOKUP(A1,$D$1:$E$4,2,0)

1700804713503.png
 
Upvote 0
Is there a formula in excel for this?
@Flashbond has provided the formula you asked for. If you were willing to look at a VBA option, then try the following. Right click the sheet tab of the sheet you want it to apply to, select View Code & paste the code into the window that appears on the right of the screen. The code is written to work anywhere in Column A, and I think you can see where you can add additional options.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Cells.CountLarge = 1 And Not Intersect(Range("A:A"), Target) Is Nothing Then
    On Error GoTo Escape
    Application.EnableEvents = False
    Select Case Target
        Case 1: Target = "ankle"
        Case 2: Target = "knee"
        Case 3: Target = "leg"
    End Select
    End If
Continue:
    Application.EnableEvents = True
    Exit Sub
Escape:
    MsgBox "Error " & Err.Number & ": " & Err.Description
    Resume Continue
End Sub
 
Upvote 0
Welcome to the MrExcel Message Board!

Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at:

There is no need to repeat the link(s) provided above but if you have posted the question at other places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0

Forum statistics

Threads
1,215,195
Messages
6,123,572
Members
449,108
Latest member
rache47

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top