Index Match to convert alphanumeric to pure numberic

dj123171

New Member
Joined
Feb 16, 2018
Messages
3
Hello, I am having a consistent #N/A error when I try to convert a Base36 alpha numeric string into a pure numeric string that represents where in the Base36 alphabet the digit represents. For example, for Base 36, the number 0 is 0, the letter F would represent 15 and W would represent 32. The alphabet is "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" and I listed it in Column A, with numeric representations in Column B, represented here:
Column AColumn B
00
11
22
33
44
55
66
77
88
99
A10
B11
C12
D13
E14
F15
G16
H17
I18
J19
K20
L21
M22
N23
O24
P25
Q26
R27
S28
T29
U30
V31
W32
X33
Y34
Z35

<tbody>
</tbody>

If have C3 = W on the same sheet, I wanted to use the Index-Match to do the following:

D3=Index($A$1:$B$36,match(C3,$A$1:$A$36,0),2)

I am expecting the value of D3 = 32 but I get #N/A. Any suggestions here? Greatly appreciated!
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Your formula seems to be correct but you can use VLOOKUP function also, which is simpler and shorter.

Code:
=VLOOKUP(C3,A1:B36,2,0)
 
Last edited:
Upvote 0
The list is sorted, so you can do a binary search, and the data is sequential, so you don't need the second column:

=MATCH(C3, $A$1:$A$36) - 1
 
Upvote 0
:confused:
d3=INDEX($B$1:$B$36,MATCH(C3,$A$1:$A$36,0))

Thanks everyone, I agree that the formula works, but ONLY for numbers and not the letters in the Base36 alphabet when trying to back convert to a number. Here is the result of an example:

77
66
W#N/A
F#N/A
33

<tbody>
</tbody>

So, it works when it looks up a number but not a letter. Any insights? Vlookup can work, but there's issues with A->Z and other complications that I'd like to avoid with Index match.
 
Upvote 0
Don't see the problem:

A​
B​
C​
D​
E​
1​
0​
2​
1​
2​
2​
D2: =MATCH(C2, $A$1:$A$36) - 1
3​
2​
A​
10​
4​
3​
W​
32​
5​
4​
Z​
35​
6​
5​
7​
6​
8​
7​
9​
8​
10​
9​
11​
A​
12​
B​
13​
C​
14​
D​
15​
E​
16​
F​
17​
G​
18​
H​
19​
I​
20​
J​
21​
K​
22​
L​
23​
M​
24​
N​
25​
O​
26​
P​
27​
Q​
28​
R​
29​
S​
30​
T​
31​
U​
32​
V​
33​
W​
34​
X​
35​
Y​
36​
Z​
 
Upvote 0
Match function worked great, thank you! Here is the result, side by side:

Colmn 1Colum 2Column 3
000
111
222DataIndexMatch
333777
444666
555W#N/A32
666F#N/A15
777333
888
999
10A10
11B11
12C12
13D13
14E14
15F15
16G16
17H17
18I18
19J19
20K20
21L21
22M22
23N23
24O24
25P25
26Q26
27R27
28S28
29T29
30U30
31V31
32W32
33X33
34Y34
35Z35

<!--StartFragment--> <colgroup><col width="65" span="7" style="width:65pt"> </colgroup><tbody>
<!--EndFragment--></tbody>

<colgroup><col width="65" span="7" style="width:65pt"></colgroup><tbody><!--EndFragment--></tbody>
 
Upvote 0
Or dispense with the list and use

=SEARCH(C2, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ") - 1
 
Upvote 0
To go from a Decimal digit to Base36 "digit"...

=CHAR(A1+48+7*(A1>9))

To go from Base36 "digit" to Decimal digit...

=CODE(A1)-48-7*ISTEXT(B1)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,976
Messages
6,122,541
Members
449,089
Latest member
davidcom

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