Convert Given Number to String Code

29sandesh

New Member
Joined
Sep 5, 2013
Messages
49
I have coded the price numbers against alphabet below, so if I put price as 9456 in input cell, I should get value AOSP in output cell. Please also keep in mind the ZERO its troubling me in formulas.

How can I do this, please help

1K
2M
3H
4O
5S
6P
7I
8T
9A
0L

<colgroup><col width="64" span="2" style="width:48pt"> </colgroup><tbody>
</tbody>
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Put 0 first in your list, and try

=LOOKUP(MID(A1,1,1)+0,E1:F10)&LOOKUP(MID(A1,2,1)+0,E1:F10)&LOOKUP(MID(A1,3,1)+0,E1:F10)&LOOKUP(MID(A1,4,1)+0,E1:F10)



Excel 2010
ABCDEF
19456AOSP0L
21K
32M
43H
54O
65S
76P
87I
98T
109A
Sheet1
Cell Formulas
RangeFormula
B1=LOOKUP(MID(A1,1,1)+0,E1:F10)&LOOKUP(MID(A1,2,1)+0,E1:F10)&LOOKUP(MID(A1,3,1)+0,E1:F10)&LOOKUP(MID(A1,4,1)+0,E1:F10)
 
Upvote 0
Only works for 4 digit numbers, what if price is single digit/double/triple eg 456

Put 0 first in your list, and try

=LOOKUP(MID(A1,1,1)+0,E1:F10)&LOOKUP(MID(A1,2,1)+0,E1:F10)&LOOKUP(MID(A1,3,1)+0,E1:F10)&LOOKUP(MID(A1,4,1)+0,E1:F10)


Excel 2010
ABCDEF
19456AOSP0L
21K
32M
43H
54O
65S
76P
87I
98T
109A

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
B1=LOOKUP(MID(A1,1,1)+0,E1:F10)&LOOKUP(MID(A1,2,1)+0,E1:F10)&LOOKUP(MID(A1,3,1)+0,E1:F10)&LOOKUP(MID(A1,4,1)+0,E1:F10)

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0
What are the limits of how many digits?
At least 1, no more than 4 ?
And which version of Excel are you using?
 
Last edited:
Upvote 0
Try
=LOOKUP(MID(A1,1,1)+0,E1:F10)&IFERROR(LOOKUP(MID(A1,2,1)+0,E1:F10),"")&IFERROR(LOOKUP(MID(A1,3,1)+0,E1:F10),"")&IFERROR(LOOKUP(MID(A1,4,1)+0,E1:F10),"")
 
Upvote 0
Or,

=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,0,"L"),1,"K"),2,"M"),3,"H"),4,"O"),5,"S"),6,"P"),7,"I"),8,"T"),9,"A")
 
Upvote 0

Forum statistics

Threads
1,215,370
Messages
6,124,526
Members
449,169
Latest member
mm424

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