Convert Letter / Words to Given Numeric values. Please help

ChadW

New Member
Joined
Apr 11, 2005
Messages
13
I had originally posted this in another thread, but my initial description of what I wanted was about as clear as mud. :) Below is what I want to accomplish. The user enters their name in a cell, and in the next column, the numeric value is shown (based on the values list also shown on the image) How would I go about doing this please? And once again, thank you in advance for any and all help.
name_calc.xls
ABCDEF
1LettersValues
2A1
3B2
4C3
5D4
6E5
7F6John1685
8G7Michael4938153
9H8Doe465
10I9
11J1
12K2
13L3
14M4
15N5
16O6
17P7
18Q8
19R9
20S1
21T2
22U3
23V4
24W5
25X6
26Y7
27Z8
Values
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
You could use this formula in F7 copied down...

it requires MCONCAT for which you need the MOREFUNC addin

=MCONCAT(LOOKUP(MID(E7,ROW(INDIRECT("1:"&LEN(E7))),1),$A$2:$B$27))

This is an array formula which needs to be confirmed with CTRL+SHIFT+ENTER so that braces appear around the formula in formula bar
 
Upvote 0
Right hand click your sheet tab

and choose view code..

now paste in the below code (Theres probably a quicker way, but the below works fine.. It works when you type in column E rows 2 - 200)

Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range

Set KeyCells = Range("E2:E200")

If Target.Count > 1 Then Exit Sub

If Not Application.Intersect(KeyCells, Range(Target.Address)) _
Is Nothing Then
On Error Resume Next
Target.Offset(0, 1) = Target.Value
Target.Offset(0, 1).Replace What:=Range("A2").Value, Replacement:=Range("B2").Value, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Target.Offset(0, 1).Replace What:=Range("A3").Value, Replacement:=Range("B3").Value, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Target.Offset(0, 1).Replace What:=Range("A4").Value, Replacement:=Range("B4").Value, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Target.Offset(0, 1).Replace What:=Range("A5").Value, Replacement:=Range("B5").Value, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Target.Offset(0, 1).Replace What:=Range("A6").Value, Replacement:=Range("B6").Value, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Target.Offset(0, 1).Replace What:=Range("A7").Value, Replacement:=Range("B7").Value, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Target.Offset(0, 1).Replace What:=Range("A8").Value, Replacement:=Range("B8").Value, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Target.Offset(0, 1).Replace What:=Range("A9").Value, Replacement:=Range("B9").Value, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Target.Offset(0, 1).Replace What:=Range("A10").Value, Replacement:=Range("B10").Value, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Target.Offset(0, 1).Replace What:=Range("A11").Value, Replacement:=Range("B11").Value, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Target.Offset(0, 1).Replace What:=Range("A12").Value, Replacement:=Range("12").Value, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Target.Offset(0, 1).Replace What:=Range("A13").Value, Replacement:=Range("B13").Value, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Target.Offset(0, 1).Replace What:=Range("A14").Value, Replacement:=Range("B14").Value, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Target.Offset(0, 1).Replace What:=Range("A15").Value, Replacement:=Range("B15").Value, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Target.Offset(0, 1).Replace What:=Range("A16").Value, Replacement:=Range("B16").Value, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Target.Offset(0, 1).Replace What:=Range("A17").Value, Replacement:=Range("B17").Value, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Target.Offset(0, 1).Replace What:=Range("A18").Value, Replacement:=Range("B18").Value, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Target.Offset(0, 1).Replace What:=Range("A19").Value, Replacement:=Range("B19").Value, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Target.Offset(0, 1).Replace What:=Range("A20").Value, Replacement:=Range("B20").Value, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Target.Offset(0, 1).Replace What:=Range("A21").Value, Replacement:=Range("B21").Value, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Target.Offset(0, 1).Replace What:=Range("A22").Value, Replacement:=Range("B22").Value, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Target.Offset(0, 1).Replace What:=Range("A23").Value, Replacement:=Range("B23").Value, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Target.Offset(0, 1).Replace What:=Range("A24").Value, Replacement:=Range("B24").Value, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Target.Offset(0, 1).Replace What:=Range("A25").Value, Replacement:=Range("B25").Value, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Target.Offset(0, 1).Replace What:=Range("A26").Value, Replacement:=Range("B26").Value, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Target.Offset(0, 1).Replace What:=Range("A27").Value, Replacement:=Range("B27").Value, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
End If

End Sub
 
Upvote 0
Try this code.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim valLen As Integer
Dim I As Integer
Dim c As String
Dim strResult As String

    If Not Intersect(Target, Columns(5)) Is Nothing Then
        valLen = Len(Target.Value)
        For I = 1 To valLen
            c = UCase(Mid(Target, I, 1))
            
            strResult = strResult & Range("B" & (Asc(c) - 63))
            
        Next I
        Target.Offset(0, 1) = strResult
        
    End If
    
End Sub
 
Upvote 0
Also:

=SUMPRODUCT((MOD(CODE(UPPER(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)))-65,9)+1)*10^(LEN(A1)-ROW(INDIRECT("1:"&LEN(A1)))))
 
Upvote 0
Thank you all again, for your quick responses. I guess it helps when i phrase my question properly :)
 
Upvote 0

Forum statistics

Threads
1,215,140
Messages
6,123,266
Members
449,093
Latest member
Vincent Khandagale

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