PC Review


Reply
Thread Tools Rate Thread

Compound Formula for Substitution

 
 
Chris
Guest
Posts: n/a
 
      7th Jan 2010
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:J2,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 With Quote
 
 
 
 
T. Valko
Guest
Posts: n/a
 
      7th Jan 2010
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))

Where:
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" <(E-Mail Removed)> wrote in message
news:A251E1E6-BDD3-4C4E-BE59-(E-Mail Removed)...
>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:J2,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 With Quote
 
T. Valko
Guest
Posts: n/a
 
      7th Jan 2010
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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))
>
> Where:
> 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" <(E-Mail Removed)> wrote in message
> news:A251E1E6-BDD3-4C4E-BE59-(E-Mail Removed)...
>>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:J2,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 With Quote
 
Jacob Skaria
Guest
Posts: n/a
 
      7th Jan 2010
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:J2,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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with parameter substitution in formula (&value), vbScript circuit_breaker Microsoft Excel Worksheet Functions 1 10th Sep 2009 03:02 PM
variable substitution in a formula NHRunner Microsoft Excel Misc 5 11th May 2007 01:56 PM
Cell Formula substitution. id3372 Microsoft Excel Misc 3 8th Jul 2006 04:36 PM
why does ON = Ambiguous in substitution formula? =?Utf-8?B?d2FsYWRk?= Microsoft Excel Worksheet Functions 5 6th May 2005 05:29 PM
wildcard substitution in formula =?Utf-8?B?SmVmZg==?= Microsoft Excel Programming 1 24th Dec 2004 02:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:28 PM.