Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 788
Default Compound Formula for Substitution

I need to try to create a formula to convert numbers to letters using the
following scale:

0 = A
1 = B
2 = C
3 = D
4 = E
5 = F
6 = G
7 = H
8 = I
9 = J

Such that 12.34 would be transformed to BCDE.

This is the formula I had tried, but it won't accept:

=CONCATENATE(HLOOKUP(RIGHT(ROUNDDOWN(M2/10000,1),1),A1:J2,2),HLOOKUP(RIGHT(ROUNDDOWN(M2/1000,1),1),A1:J2,2),HLOOKUP(RIGHT(ROUNDDOWN(M2/100,1),1),A1:J2,2),HLOOKUP(RIGHT(ROUNDDOWN(M2/10,1),1),A1:J2,2),HLOOKUP(RIGHT(ROUNDDOWN(M2,1),1) ,A1:J2,2),HLOOKUP(RIGHT(ROUNDDOWN(M2*10,1),1),A1:J 2,2))

M2 is my starting number and the table array is the Number/Letter Conversion
Chart.

I truly hope someone can help me.

Thank you,
Chris
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Compound Formula for Substitution

If you can download and install the free add-in Morefunct.xll from:

http://xcell05.free.fr/morefunc/english/index.htm

Alternate download site:

http://www.download.com/Morefunc/300...-10423159.html

Then you can use an array formula** like this:

=MCONCAT(LOOKUP(--MID(SUBSTITUTE(C1,".",""),ROW(INDIRECT("1:"&LEN(C1 )-COUNT(FIND(".",C1)))),1),A1:B10))

Whe
C1 = some number
A1:B10 = lookup table

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT
key then hit ENTER.

--
Biff
Microsoft Excel MVP


"Chris" wrote in message
...
I need to try to create a formula to convert numbers to letters using the
following scale:

0 = A
1 = B
2 = C
3 = D
4 = E
5 = F
6 = G
7 = H
8 = I
9 = J

Such that 12.34 would be transformed to BCDE.

This is the formula I had tried, but it won't accept:

=CONCATENATE(HLOOKUP(RIGHT(ROUNDDOWN(M2/10000,1),1),A1:J2,2),HLOOKUP(RIGHT(ROUNDDOWN(M2/1000,1),1),A1:J2,2),HLOOKUP(RIGHT(ROUNDDOWN(M2/100,1),1),A1:J2,2),HLOOKUP(RIGHT(ROUNDDOWN(M2/10,1),1),A1:J2,2),HLOOKUP(RIGHT(ROUNDDOWN(M2,1),1) ,A1:J2,2),HLOOKUP(RIGHT(ROUNDDOWN(M2*10,1),1),A1:J 2,2))

M2 is my starting number and the table array is the Number/Letter
Conversion
Chart.

I truly hope someone can help me.

Thank you,
Chris



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Compound Formula for Substitution

P.S.

If your number is *always* only 4 digits then this can be done with a much
simpler formula. You should have posted several examples of the numbers
you're dealing with.

--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
If you can download and install the free add-in Morefunct.xll from:

http://xcell05.free.fr/morefunc/english/index.htm

Alternate download site:

http://www.download.com/Morefunc/300...-10423159.html

Then you can use an array formula** like this:

=MCONCAT(LOOKUP(--MID(SUBSTITUTE(C1,".",""),ROW(INDIRECT("1:"&LEN(C1 )-COUNT(FIND(".",C1)))),1),A1:B10))

Whe
C1 = some number
A1:B10 = lookup table

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the
SHIFT key then hit ENTER.

--
Biff
Microsoft Excel MVP


"Chris" wrote in message
...
I need to try to create a formula to convert numbers to letters using the
following scale:

0 = A
1 = B
2 = C
3 = D
4 = E
5 = F
6 = G
7 = H
8 = I
9 = J

Such that 12.34 would be transformed to BCDE.

This is the formula I had tried, but it won't accept:

=CONCATENATE(HLOOKUP(RIGHT(ROUNDDOWN(M2/10000,1),1),A1:J2,2),HLOOKUP(RIGHT(ROUNDDOWN(M2/1000,1),1),A1:J2,2),HLOOKUP(RIGHT(ROUNDDOWN(M2/100,1),1),A1:J2,2),HLOOKUP(RIGHT(ROUNDDOWN(M2/10,1),1),A1:J2,2),HLOOKUP(RIGHT(ROUNDDOWN(M2,1),1) ,A1:J2,2),HLOOKUP(RIGHT(ROUNDDOWN(M2*10,1),1),A1:J 2,2))

M2 is my starting number and the table array is the Number/Letter
Conversion
Chart.

I truly hope someone can help me.

Thank you,
Chris





  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Compound Formula for Substitution

How about a UDF (User Defined function). From workbook launch VBE using
Alt+F11. From menu Insert a Module and paste the below function.Close and get
back to workbook and try the below formula.

In cell A1 = 12.34
In cell B1 try the below formula
=convertdata(A1)

Function ConvertData(varData As Variant) As String
Dim intCount As Integer
For intCount = 1 To Len(varData.Value)
If IsNumeric(Mid(varData.Value, intCount, 1)) Then
ConvertData = ConvertData & Chr(65 + Mid(varData.Value, intCount, 1))
End If
Next
End Function

--
Jacob


"Chris" wrote:

I need to try to create a formula to convert numbers to letters using the
following scale:

0 = A
1 = B
2 = C
3 = D
4 = E
5 = F
6 = G
7 = H
8 = I
9 = J

Such that 12.34 would be transformed to BCDE.

This is the formula I had tried, but it won't accept:

=CONCATENATE(HLOOKUP(RIGHT(ROUNDDOWN(M2/10000,1),1),A1:J2,2),HLOOKUP(RIGHT(ROUNDDOWN(M2/1000,1),1),A1:J2,2),HLOOKUP(RIGHT(ROUNDDOWN(M2/100,1),1),A1:J2,2),HLOOKUP(RIGHT(ROUNDDOWN(M2/10,1),1),A1:J2,2),HLOOKUP(RIGHT(ROUNDDOWN(M2,1),1) ,A1:J2,2),HLOOKUP(RIGHT(ROUNDDOWN(M2*10,1),1),A1:J 2,2))

M2 is my starting number and the table array is the Number/Letter Conversion
Chart.

I truly hope someone can help me.

Thank you,
Chris

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with parameter substitution in formula (&value), vbScript circuit_breaker Excel Worksheet Functions 1 September 10th 09 03:02 PM
variable substitution in a formula linking to external workbook my Excel Discussion (Misc queries) 2 August 29th 07 03:05 PM
variable substitution in a formula NHRunner Excel Discussion (Misc queries) 5 May 11th 07 01:56 PM
Cell Formula substitution. id3372 Excel Discussion (Misc queries) 3 July 8th 06 04:36 PM
why does ON = Ambiguous in substitution formula? waladd Excel Worksheet Functions 5 May 6th 05 05:29 PM


All times are GMT +1. The time now is 09:24 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"