Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
Rao Ratan Singh
 
Posts: n/a
Default Special Code

I want to generate price list with this

G = 1
O = 2
L = 3
D = 4
E = 5
N =6
C= 7
I = 8
T = 9
Y = 0

When i enter 100 it should return GYY

HOW IT IS POSSIBLE

Thanks and regards

RRS
  #2   Report Post  
Posted to microsoft.public.excel.newusers
Don Guillett
 
Posts: n/a
Default Special Code

one way might be to set up a table and use this formula.
1 G 100
2 O
3 L
4 D
5 E
6 N
7 C
8 I
9 T
0 Y

=VLOOKUP(VALUE(LEFT(F1,1)),D1:E10,2,0)&VLOOKUP(VAL UE(MID(F1,2,1)),D1:E10,2,0)&IF(LEN(f1)2,VLOOKUP(V ALUE(MID(F1,3,1)),D1:E10,2,0),"")
--
Don Guillett
SalesAid Software

"Rao Ratan Singh" wrote in message
...
I want to generate price list with this

G = 1
O = 2
L = 3
D = 4
E = 5
N =6
C= 7
I = 8
T = 9
Y = 0

When i enter 100 it should return GYY

HOW IT IS POSSIBLE

Thanks and regards

RRS



  #3   Report Post  
Posted to microsoft.public.excel.newusers
Marcelo
 
Posts: n/a
Default Special Code

hI Rao, I received this code from Aidan,

On the spreadsheet, press ALT+F11 open a new module copy and past this code:

Function GetDigit(Digit As String)
Dim CheckDigit As String
Dim looper
For looper = 1 To Len(Digit)
CheckDigit = Mid(Digit, looper, 1)
Select Case Val(CheckDigit)
Case 1: GetDigit = GetDigit & "G"
Case 2: GetDigit = GetDigit & "O"
Case 3: GetDigit = GetDigit & "L"
Case 4: GetDigit = GetDigit & "D"
Case 5: GetDigit = GetDigit & "E"
Case 6: GetDigit = GetDigit & "N"
Case 7: GetDigit = GetDigit & "C"
Case 8: GetDigit = GetDigit & "I"
Case 9: GetDigit = GetDigit & "T"
Case 0: GetDigit = GetDigit & "Y"
Case Else: GetDigit = ""
End Select
Next
End Function

so, imagine you have the 100 on the cell A1 the formula is:

=getdigit(a1)

regards










"Rao Ratan Singh" escreveu:

I want to generate price list with this

G = 1
O = 2
L = 3
D = 4
E = 5
N =6
C= 7
I = 8
T = 9
Y = 0

When i enter 100 it should return GYY

HOW IT IS POSSIBLE

Thanks and regards

RRS

  #4   Report Post  
Posted to microsoft.public.excel.newusers
CLR
 
Posts: n/a
Default Special Code

Assuming your Price is in cell A1, put this formula in cell B1 and copy it
over to cell K1...........

=IF(LEN($A1)=COLUMN(A1),LOOKUP(MID($A1,COLUMN(A1) ,1)*1,{0,1,2,3,4,5,6,7,8,9},{"Y","G","O","L","D"," E","N","C","I","T"}),"")

Then, if you wish the new "Alpha-code" to all be in one cell, you can put
this formula in cell L1

=CONCATENATE(B1,C1,D1,E1,F1,G1,H1,I1,J1,K1)

All formulas above can be copied down as needed.........

hth
Vaya con Dios,
Chuck, CABGx3




"Rao Ratan Singh" wrote:

I want to generate price list with this

G = 1
O = 2
L = 3
D = 4
E = 5
N =6
C= 7
I = 8
T = 9
Y = 0

When i enter 100 it should return GYY

HOW IT IS POSSIBLE

Thanks and regards

RRS

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
Complicated If Then / V Lookup / Match Statement... ryesworld Excel Worksheet Functions 17 December 10th 05 02:09 PM
VLOOKUP for Zip Code Ranges JerseyJR Excel Worksheet Functions 2 September 6th 05 06:37 PM
Conform a total to a list of results? xmaveric Excel Discussion (Misc queries) 1 August 21st 05 07:22 PM
Macro for changing text to Proper Case JPriest Excel Worksheet Functions 3 August 8th 05 09:31 PM
close form code tkaplan Excel Discussion (Misc queries) 1 June 3rd 05 10:49 PM


All times are GMT +1. The time now is 06:05 PM.

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"