Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Hi
I need a funtion to convert Number to words literally, I mean 1241 (One Two four one) I found many examples for currency but I need literal every number to word. Thanks in advance. |
#2
![]() |
|||
|
|||
![]() http://tinyurl.com/8n4fz by Bob Phillips Mangesh -- mangesh_yadav ------------------------------------------------------------------------ mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470 View this thread: http://www.excelforum.com/showthread...hreadid=378884 |
#3
![]() |
|||
|
|||
![]()
just wondering - can you use use excel's text to columns feature to split
your numbers into individual cells, use the currency examples you found to convert each number to text, then concatenate the resulting strings back together? or, once you split the number, use a macro w/a case statement to convert the numbers to words - as long as there would only be 10 cases (0-9), then concatenate the strings back together? "JCP" wrote: Hi I need a funtion to convert Number to words literally, I mean 1241 (One Two four one) I found many examples for currency but I need literal every number to word. Thanks in advance. |
#4
![]() |
|||
|
|||
![]()
Hi
Thanks but is not literal, I need for example if the number is 7648 I need Six four eight. The common is Six hundred... I dont' need that just every number as is. Thanks. "mangesh_yadav" wrote: http://tinyurl.com/8n4fz by Bob Phillips Mangesh -- mangesh_yadav ------------------------------------------------------------------------ mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470 View this thread: http://www.excelforum.com/showthread...hreadid=378884 |
#5
![]() |
|||
|
|||
![]()
change the argument data type if you need to.
Function Words(Arg As Long) As String For i = 1 To Len(CStr(Arg)) Select Case CInt(Mid(Arg, i, 1)) Case 1: Words = Words & "One " Case 2: Words = Words & "Two " Case 3: Words = Words & "Three " Case 4: Words = Words & "Four " Case 5: Words = Words & "Five " Case 6: Words = Words & "Six " Case 7: Words = Words & "Seven " Case 8: Words = Words & "Eight " Case 9: Words = Words & "Nine " Case 0: Words = Words & "Zero " End Select Next i Words = Trim(Words) End Function "JCP" wrote: Hi I need a funtion to convert Number to words literally, I mean 1241 (One Two four one) I found many examples for currency but I need literal every number to word. Thanks in advance. |
#6
![]() |
|||
|
|||
![]()
Added a routine to Bob's ..
' Converts a number from 1 to 9 into text. Function GetDigit(Digit) Select Case Val(Digit) Case 1: GetDigit = "One" Case 2: GetDigit = "Two" Case 3: GetDigit = "Three" Case 4: GetDigit = "Four" Case 5: GetDigit = "Five" Case 6: GetDigit = "Six" Case 7: GetDigit = "Seven" Case 8: GetDigit = "Eight" Case 9: GetDigit = "Nine" Case Else: GetDigit = "" End Select End Function Function NumWord(x) For i = 1 To Len(x) If i < 2 Then NumWord = GetDigit(Mid(x, i, 1)) Else NumWord = NumWord & " " & GetDigit(Mid(x, i, 1)) End If Next i End Function Use the above two functions. The first one (GetDigit) is by Bob Phillips. A1 = 123 usage: =numword(A1) Mangesh "JCP" wrote in message ... Hi Thanks but is not literal, I need for example if the number is 7648 I need Six four eight. The common is Six hundred... I dont' need that just every number as is. Thanks. "mangesh_yadav" wrote: http://tinyurl.com/8n4fz by Bob Phillips Mangesh -- mangesh_yadav ------------------------------------------------------------------------ mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470 View this thread: http://www.excelforum.com/showthread...hreadid=378884 |
#7
![]() |
|||
|
|||
![]()
Mangesh
Sorry for not answer you, this exactly what I need. I really appreciate your time. God bless. "Mangesh Yadav" wrote: Added a routine to Bob's .. ' Converts a number from 1 to 9 into text. Function GetDigit(Digit) Select Case Val(Digit) Case 1: GetDigit = "One" Case 2: GetDigit = "Two" Case 3: GetDigit = "Three" Case 4: GetDigit = "Four" Case 5: GetDigit = "Five" Case 6: GetDigit = "Six" Case 7: GetDigit = "Seven" Case 8: GetDigit = "Eight" Case 9: GetDigit = "Nine" Case Else: GetDigit = "" End Select End Function Function NumWord(x) For i = 1 To Len(x) If i < 2 Then NumWord = GetDigit(Mid(x, i, 1)) Else NumWord = NumWord & " " & GetDigit(Mid(x, i, 1)) End If Next i End Function Use the above two functions. The first one (GetDigit) is by Bob Phillips. A1 = 123 usage: =numword(A1) Mangesh "JCP" wrote in message ... Hi Thanks but is not literal, I need for example if the number is 7648 I need Six four eight. The common is Six hundred... I dont' need that just every number as is. Thanks. "mangesh_yadav" wrote: http://tinyurl.com/8n4fz by Bob Phillips Mangesh -- mangesh_yadav ------------------------------------------------------------------------ mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470 View this thread: http://www.excelforum.com/showthread...hreadid=378884 |
#8
![]() |
|||
|
|||
![]()
JMB
Even I use the code of Mangesh, I appreciate your time and valuable advise, Thanks. "JMB" wrote: change the argument data type if you need to. Function Words(Arg As Long) As String For i = 1 To Len(CStr(Arg)) Select Case CInt(Mid(Arg, i, 1)) Case 1: Words = Words & "One " Case 2: Words = Words & "Two " Case 3: Words = Words & "Three " Case 4: Words = Words & "Four " Case 5: Words = Words & "Five " Case 6: Words = Words & "Six " Case 7: Words = Words & "Seven " Case 8: Words = Words & "Eight " Case 9: Words = Words & "Nine " Case 0: Words = Words & "Zero " End Select Next i Words = Trim(Words) End Function "JCP" wrote: Hi I need a funtion to convert Number to words literally, I mean 1241 (One Two four one) I found many examples for currency but I need literal every number to word. Thanks in advance. |
#9
![]() |
|||
|
|||
![]()
Hi JCP,
no problem. Thanks for the feedback. Mangesh "JCP" wrote in message ... Mangesh Sorry for not answer you, this exactly what I need. I really appreciate your time. God bless. "Mangesh Yadav" wrote: Added a routine to Bob's .. ' Converts a number from 1 to 9 into text. Function GetDigit(Digit) Select Case Val(Digit) Case 1: GetDigit = "One" Case 2: GetDigit = "Two" Case 3: GetDigit = "Three" Case 4: GetDigit = "Four" Case 5: GetDigit = "Five" Case 6: GetDigit = "Six" Case 7: GetDigit = "Seven" Case 8: GetDigit = "Eight" Case 9: GetDigit = "Nine" Case Else: GetDigit = "" End Select End Function Function NumWord(x) For i = 1 To Len(x) If i < 2 Then NumWord = GetDigit(Mid(x, i, 1)) Else NumWord = NumWord & " " & GetDigit(Mid(x, i, 1)) End If Next i End Function Use the above two functions. The first one (GetDigit) is by Bob Phillips. A1 = 123 usage: =numword(A1) Mangesh "JCP" wrote in message ... Hi Thanks but is not literal, I need for example if the number is 7648 I need Six four eight. The common is Six hundred... I dont' need that just every number as is. Thanks. "mangesh_yadav" wrote: http://tinyurl.com/8n4fz by Bob Phillips Mangesh -- mangesh_yadav ------------------------------------------------------------------------ mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470 View this thread: http://www.excelforum.com/showthread...hreadid=378884 |
#10
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]() "JCP" wrote: Hi I need a funtion to convert Number to words literally, I mean 1241 (One Two four one) I found many examples for currency but I need literal every number to word. Thanks in advance. |
#11
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]() "JCP" wrote: Hi I need a funtion to convert Number to words literally, I mean 1241 (One Two four one) I found many examples for currency but I need literal every number to word. Thanks in advance. |
#12
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]() "JCP" wrote: Hi I need a funtion to convert Number to words literally, I mean 1241 (One Two four one) I found many examples for currency but I need literal every number to word. Thanks in advance. Vijay Chary, India 26-11-2006 Hi JCP !, You could write a Function or a Macro In VBA That will Compose in words (literal) any given number in words as you have shown in your posting. Prepare a worksheet in the workbook with a word for each digit in one column. (e.g.) one, two, three etc. in column A. The Macro (or Function) chooses the contents of the nth cell in column A. Then the Words are concatenated to give you (e.g.) One Two Four One if you Input 1241. You are Welcome ! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Number Field to Text or Words | Excel Discussion (Misc queries) | |||
How do you sort words in Excel by the number of letters in a word | New Users to Excel | |||
how do I find an average number of specific words in a column | New Users to Excel | |||
GET.CELL | Excel Worksheet Functions | |||
Count the number of words in a cell! | Excel Worksheet Functions |