In this article I will show you two quick and free ways to convert currency numbers into English words in Excel 2019, 2016, 2013 and other versions. Continue reading
by Alexander Frolov, updated on
In this article I will show you two quick and free ways to convert currency numbers into English words in Excel 2019, 2016, 2013 and other versions. Continue reading
Comments page 2. Total comments: 530
how to set excel formulas number to word in Lebanese pound
Good day po! I am using Bahrain Dinar currency for coverting number to word. And I have a little problem when it have a cents or "fils" in Bahrain. I manage to convert ten fils but what I need is hundred fils. I rarely see a tutorial on internet that has a Bahrain Dinar currency topic. US Dollars is the common so I don't have any idea on how to make a format for hundred fils which is in Bahrain Dinar. Until I found your link in google and I am really hoping that you can help me with my concern. Thank you in advance. I am looking forward to hearing from you. Have a nice weekend.
How to set excel formulas number to word in Philippine Peso?
replace dollar with peso in the VBA after pasting the formula
Hi Sir,
I would like to have a formula to convert the Bahraini Dinar (BD) as 37.285 (THIRTY SEVEN AND FILS 285/1000 ONLY)
Thanks
please help me on how to put the following format in excel.
Eg: Two thousand and cents ninety two
Thanks,
Hi experts,
I'm looking for a BVA code to convert numbers into words without showing currency and 3 decimal values. i.e. 10,550,125,589.325 (Ten Billion Five Hundred Fifty Million One Hundred Twenty-Five Thousand Five Hundred Eighty-Nine And 325/1000 only).
Thank you
Dipak
For rupees not working
Sir, I have converted 1056 and the result is one thousand fifty-six only. I was wondering if there's any way to make it like this:
One Thousand and Fifty-Six Only
hello sir thank you so much for this but I do have an inquiry instead of converting the cents to words how to make it stay as figure only?
One Hundred Ninety Pesos and 87 /100 Only
Select Case Cents
Case ""
Cents = " Only"
Case "One"
Cents = " and One Cent"
Case Else
Cents = " and " & Cents & " /100 Only"
End Select
How to set as below format:
For example:
RM 3,600.00
in Words: ***THREE THOUSAND SIX HUNDRED ONLY***
Brilliant.
Thank you , made my workload much easier.
??
Thanks for sharing this.
This is very helpful in excel for me.
But still i have one query whenever i am opening a new excel, i need to insert module formula's in each excel and need to save every time to each excel. Is there any solution for my solution, because i don't want to save this module formula for each excel many times.
Hello!
Try saving your custom function in an add-in file as described in this tutorial.
I hope I answered your question. If something is still unclear, please feel free to ask.
How can make it up to 3 decimals, currently it is only 2 desimals, I want it instead of 0.39 thirty nine to be three hundred ninty one
Hi!
To get 0.391 in cell, change the number format as described in this guide.
You may also need to apply to round the number to 3 decimal places.
Hope this is what you need.
Amazing!
Thank you so much!
Made my life supre easy!
Actually all the formula / function don't work in excel program in Android mobile.
As the formula given requires Add In / VBA.
I require a simple formula to convert Number in Words in Indian method
e.g. Rs 99,99 999.99 should be in Words "Rupees Ninety Nine Lakh Ninety Nine Thousand Nine Hundred Ninety Nine Paise Ninety Nine Only"
Please help me to have such formula which works directly in excel cell without any Add ins / VBA.
EXPECTING A FAVORABLE HELP.
Thank you for this! Big Help!
dears,
please need this macro without currency :)
thanks
Hi mine is working perfectly! thank you
but having issue sometime (Seventeen Dollars and Thirty Two Cents) but excel numeric digit show 17.33 anyone help me to find the solution or having only option to change the decimal places 2 to 3
Hello!
Your number is the result of a calculation. If you increase the number of visible decimal places in the cell, you will see 17.3268 or something similar. Excel automatically rounds the number it shows you on the worksheet. But the value in the cell does not change. The SpellNumber function does not round a number. To make the data match, use the ROUND function in your formula.
Sir Alexander Trifuntov
Please help me on this I am using the below VBA code as a result I get the word "Rupees" at the beginning of the result and the word "Only" at the end.
Example
123
=Spell Number(One Hundred and Twenty Three )
Need Result
Rupees One Hundred and Twenty Three Only
(Using Below Code)
Option Explicit
Function SpellNumber(ByVal MyNumber)
Dim uStr As String
Dim uFNum As Integer
Dim uStrPoint
Dim uStrNumber
Dim uPoint As String
Dim uNumber As String
Dim uP() As Variant
Dim uDP
Dim uCnt As Integer
Dim uResult, uT As String
Dim uLen As Integer
On Error Resume Next
uP = Array("", "Thousand ", "Million ", "Billion ", "Trillion ", " ", " ", " ", " ")
uNumber = Trim(Str(MyNumber))
uDP = InStr(uNumber, ".")
uPoint = ""
uStrNumber = ""
If uDP > 0 Then
uPoint = " point "
uStr = Mid(uNumber, uDP + 1)
uStrPoint = Left(uStr, Len(uNumber) - uDP)
For uFNum = 1 To Len(uStrPoint)
uStr = Mid(uStrPoint, uFNum, 1)
uPoint = uPoint & Digits(uStr) & " "
Next uFNum
uNumber = Trim(Left(uNumber, uDP - 1))
End If
uCnt = 0
uResult = ""
uT = ""
uLen = 0
uLen = Int(Len(Str(uNumber)) / 3)
If (Len(Str(uNumber)) Mod 3) = 0 Then uLen = uLen - 1
Do While uNumber ""
If uLen = uCnt Then
uT = HundredsDigits(Right(uNumber, 3), False)
Else
If uCnt = 0 Then
uT = HundredsDigits(Right(uNumber, 3), True)
Else
uT = HundredsDigits(Right(uNumber, 3), False)
End If
End If
If uT "" Then
uResult = uT & uP(uCnt) & uResult
End If
If Len(uNumber) > 3 Then
uNumber = Left(uNumber, Len(uNumber) - 3)
Else
uNumber = ""
End If
uCnt = uCnt + 1
Loop
uResult = uResult & uPoint
SpellNumber = uResult
End Function
Function HundredsDigits(uHDgt, uB As Boolean)
Dim uRStr As String
Dim uStrNum As String
Dim uStr As String
Dim uI As Integer
Dim uBB As Boolean
uStrNum = uHDgt
uRStr = ""
On Error Resume Next
uBB = True
If Val(uStrNum) = 0 Then Exit Function
uStrNum = Right("000" & uStrNum, 3)
uStr = Mid(uStrNum, 1, 1)
If uStr "0" Then
uRStr = Digits(Mid(uStrNum, 1, 1)) & "Hundred "
Else
If uB Then
uRStr = "and "
uBB = False
Else
uRStr = " "
uBB = False
End If
End If
If Mid(uStrNum, 2, 2) "00" Then
uRStr = uRStr & TenDigits(Mid(uStrNum, 2, 2), uBB)
End If
HundredsDigits = uRStr
End Function
Function TenDigits(uTDgt, uB As Boolean)
Dim uStr As String
Dim uI As Integer
Dim uArr_1() As Variant
Dim uArr_2() As Variant
Dim uT As Boolean
uArr_1 = Array("Ten ", "Eleven ", "Twelve ", "Thirteen ", "Fourteen ", "Fifteen ", "Sixteen ", "Seventeen ", "Eighteen ", "Nineteen ")
uArr_2 = Array("", "", "Twenty ", "Thirty ", "Forty ", "Fifty ", "Sixty ", "Seventy ", "Eighty ", "Ninety ")
uStr = ""
uT = True
On Error Resume Next
If Val(Left(uTDgt, 1)) = 1 Then
uI = Val(Right(uTDgt, 1))
If uB Then uStr = "and "
uStr = uStr & uArr_1(uI)
Else
uI = Val(Left(uTDgt, 1))
If Val(Left(uTDgt, 1)) > 1 Then
If uB Then uStr = "and "
uStr = uStr & uArr_2(Val(Left(uTDgt, 1)))
uT = False
End If
If uStr = "" Then
If uB Then
uStr = "and "
End If
End If
If Right(uTDgt, 1) "0" Then
uStr = uStr & Digits(Right(uTDgt, 1))
End If
End If
TenDigits = uStr
End Function
Function Digits(uDgt)
Dim uStr As String
Dim uArr_1() As Variant
uArr_1 = Array("Zero ", "One ", "Two ", "Three ", "Four ", "Five ", "Six ", "Seven ", "Eight ", "Nine ")
uStr = ""
On Error Resume Next
uStr = uArr_1(Val(uDgt))
Digits = uStr
End Function
hello all genius,
can anyone help me?
100000 ... when i tried this code it is coming "one hundred thousand".
i need it as "one lakh"/ or "Point million"
how can i add this extra requirement??
SO Helping ... Specially by pics....
I don't know what to say. This worked for me like magic. I was looking for this for hours and at last, I found you. WOW! Let me salute you, Mr. Admin. Thank you very much.
Please help me with the formula for shillings
Hi there,
As far as VBA is often disabled for security reasons, I have written the FORMULA which spells sums up to 999 billion dollars, e.g.:
907 654 000 012,99
nine hundred and seven billion six hundred and fifty four million twelve dollars and 99 cents
The formula is sensitive to Zero thousands/mln/bln (omits thousands/mln/bln if they are 000)
Also spells "dollar" or "dollars" depending if the last digit of dollars is 1 or more (21 dollar, and 17 dollars)
Simply replace "A1" in tjhe code with the name of the cell you need (better with Ctrl-H)
---
=CONCATENATE(IF(INT(A1/1000000000)>=1;CONCATENATE(TRIM(CONCATENATE(IF(INT(A1/1000000000)>99;CONCATENATE(CHOOSE(INT(INT(A1/1000000000)/100);"one";"two";"three";"four";"five";"six";"seven";"eight";"nine");" hundred ");"");IF(AND(INT(A1/1000000000)>100;MOD(INT(A1/1000000000);100)>0);"and ";"");IF(MOD(INT(A1/1000000000);100)=0;"";IF(MOD(INT(A1/1000000000);100)=1;CONCATENATE(TRIM(CONCATENATE(IF(INT(MOD(A1;1000000000)/1000000)>99;CONCATENATE(CHOOSE(INT(INT(MOD(A1;1000000000)/1000000)/100);"one";"two";"three";"four";"five";"six";"seven";"eight";"nine");" hundred ");"");IF(AND(INT(MOD(A1;1000000000)/1000000)>100;MOD(INT(MOD(A1;1000000000)/1000000);100)>0);"and ";"");IF(MOD(INT(MOD(A1;1000000000)/1000000);100)=0;"";IF(MOD(INT(MOD(A1;1000000000)/1000000);100)=1;CONCATENATE(TRIM(CONCATENATE(IF(INT(MOD(A1;1000000)/1000)>99;CONCATENATE(CHOOSE(INT(INT(MOD(A1;1000000)/1000)/100);"one";"two";"three";"four";"five";"six";"seven";"eight";"nine");" hundred ");"");IF(AND(INT(MOD(A1;1000000)/1000)>100;MOD(INT(MOD(A1;1000000)/1000);100)>0);"and ";"");IF(MOD(INT(MOD(A1;1000000)/1000);100)=0;"";IF(MOD(INT(MOD(A1;1000000)/1000);100)=1;CONCATENATE(TRIM(CONCATENATE(IF(INT(MOD(A1;1000))>99;CONCATENATE(CHOOSE(INT(INT(MOD(A1;1000))/100);"one";"two";"three";"four";"five";"six";"seven";"eight";"nine");" hundred ");"");IF(AND(INT(MOD(A1;1000))>100;MOD(INT(MOD(A1;1000));100)>0);"and ";"");IF(MOD(INT(MOD(A1;1000));100)=0;"";IF(MOD(INT(MOD(A1;1000));100)<20;CHOOSE(MOD(INT(MOD(A1;1000));100);"one";"two";"three";"four";"five";"six";"seven";"eight";"nine";"ten";"eleven";"twelve";"thirteen";"fourteen";"fifteen";"sixteen";"seventeen";"eighteen";"nineteen");CONCATENATE(CHOOSE(INT(MOD(INT(MOD(A1;1000));100)/10);"ERROR";"twenty";"thirty";"forty";"fifty";"sixty";"seventy";"eighty";"ninety";"MORE");CHOOSE(INT(MOD(INT(MOD(A1;1000));10))+1;"";" one";" two";" three";" four";" five";" six";" seven";" eight";" nine"))))));" ");"");IF(INT(MOD(A1;10))=1;"dollar and ";"dollars and ");ROUND(MOD(A1;1)*100;0);" cents")
Sorry, the code somehow ripped.
Write once more:
=CONCATENATE(IF(INT(A1/1000000000)>=1;CONCATENATE(TRIM(CONCATENATE(IF(INT(A1/1000000000)>99;CONCATENATE(CHOOSE(INT(INT(A1/1000000000)/100);"one";"two";"three";"four";"five";"six";"seven";"eight";"nine");" hundred ");"");IF(AND(INT(A1/1000000000)>100;MOD(INT(A1/1000000000);100)>0);"and ";"");IF(MOD(INT(A1/1000000000);100)=0;"";IF(MOD(INT(A1/1000000000);100)=1;CONCATENATE(TRIM(CONCATENATE(IF(INT(MOD(A1;1000000000)/1000000)>99;CONCATENATE(CHOOSE(INT(INT(MOD(A1;1000000000)/1000000)/100);"one";"two";"three";"four";"five";"six";"seven";"eight";"nine");" hundred ");"");IF(AND(INT(MOD(A1;1000000000)/1000000)>100;MOD(INT(MOD(A1;1000000000)/1000000);100)>0);"and ";"");IF(MOD(INT(MOD(A1;1000000000)/1000000);100)=0;"";IF(MOD(INT(MOD(A1;1000000000)/1000000);100)=1;CONCATENATE(TRIM(CONCATENATE(IF(INT(MOD(A1;1000000)/1000)>99;CONCATENATE(CHOOSE(INT(INT(MOD(A1;1000000)/1000)/100);"one";"two";"three";"four";"five";"six";"seven";"eight";"nine");" hundred ");"");IF(AND(INT(MOD(A1;1000000)/1000)>100;MOD(INT(MOD(A1;1000000)/1000);100)>0);"and ";"");IF(MOD(INT(MOD(A1;1000000)/1000);100)=0;"";IF(MOD(INT(MOD(A1;1000000)/1000);100)=1;CONCATENATE(TRIM(CONCATENATE(IF(INT(MOD(A1;1000))>99;CONCATENATE(CHOOSE(INT(INT(MOD(A1;1000))/100);"one";"two";"three";"four";"five";"six";"seven";"eight";"nine");" hundred ");"");IF(AND(INT(MOD(A1;1000))>100;MOD(INT(MOD(A1;1000));100)>0);"and ";"");IF(MOD(INT(MOD(A1;1000));100)=0;"";IF(MOD(INT(MOD(A1;1000));100)<20;CHOOSE(MOD(INT(MOD(A1;1000));100);"one";"two";"three";"four";"five";"six";"seven";"eight";"nine";"ten";"eleven";"twelve";"thirteen";"fourteen";"fifteen";"sixteen";"seventeen";"eighteen";"nineteen");CONCATENATE(CHOOSE(INT(MOD(INT(MOD(A1;1000));100)/10);"ERROR";"twenty";"thirty";"forty";"fifty";"sixty";"seventy";"eighty";"ninety";"MORE");CHOOSE(INT(MOD(INT(MOD(A1;1000));10))+1;"";" one";" two";" three";" four";" five";" six";" seven";" eight";" nine"))))));" ");"");IF(INT(MOD(A1;10))=1;"dollar and ";"dollars and ");ROUND(MOD(A1;1)*100;0);" cents")
sorry again, the code rips while publishing... half the text simply disappears :(
Hi Friends,
Could you tell me the code where I can mention "and" before the last figures e.g. Rs 1,987,290
(Rupees one million nine Hundred eighty seven thousand two hundred and ninety only)
Hi,
First of all thanks for the wonderful formulas. May I get the formula for UAE dirham and Indian Rupees as well
Thanks from yours formula
hi can you help me
I want to convert amount like this;
Php. 1,982.56
one thousand nine hundred eighty two pesos & 56/100 only
I'd like to convert the digits to words but without the "dollar or cents"
i.e. 342,880 will be:
"Three Hundred Forty Two Thousand Eight Hundred and Eighty"
and not
"Three Hundred Forty Two Thousand Eight Hundred Eighty Dollars and No Cents"
how do I do that? thank you!
Hi, Please insert INR in currency too.
There's Error ????
Option Explicit
'Main Function
Function SpellNumber(ByVal MyNumber)
Dim Dollars, Cents, Temp
Dim DecimalPlace, Count
ReDim Place(9) As String
Place(2) = " Thousand "
Place(3) = " Million "
Place(4) = " Billion "
Place(5) = " Trillion "
' String representation of amount.
MyNumber = Trim(Str(MyNumber))
' Position of decimal place 0 if none.
DecimalPlace = InStr(MyNumber, ".")
' Convert cents and set MyNumber to dollar amount.
If DecimalPlace > 0 Then
Cents = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & _ "00", 2))
MyNumber = Trim(Left(MyNumber, DecimalPlace - 1))
End If
Count = 1
Do While MyNumber ""
Temp = GetHundreds(Right(MyNumber, 3))
If Temp "" Then Dollars = Temp & Place(Count) & Dollars
If Len(MyNumber) > 3 Then
MyNumber = Left(MyNumber, Len(MyNumber) - 3)
Else
MyNumber = ""
End If
Count = Count + 1
Loop
Select Case Dollars
Case ""
Dollars = "No Dollars"
Case "One"
Dollars = "One Dollar"
Case Else
Dollars = Dollars & " Dollars"
End Select
Select Case Cents
Case ""
Cents = " and No Cents"
Case "One"
Cents = " and One Cent"
Case Else
Cents = " and " & Cents & " Cents"
End Select
SpellNumber = Dollars & Cents
End Function
' Converts a number from 100-999 into text
Function GetHundreds(ByVal MyNumber)
Dim Result As String
If Val(MyNumber) = 0 Then Exit Function
MyNumber = Right("000" & MyNumber, 3)
' Convert the hundreds place.
If Mid(MyNumber, 1, 1) "0" Then
Result = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred "
End If
' Convert the tens and ones place.
If Mid(MyNumber, 2, 1) "0" Then
Result = Result & GetTens(Mid(MyNumber, 2))
Else
Result = Result & GetDigit(Mid(MyNumber, 3))
End If
GetHundreds = Result
End Function
' Converts a number from 10 to 99 into text.
Function GetTens(TensText)
Dim Result As String
Result = "" ' Null out the temporary function value.
If Val(Left(TensText, 1)) = 1 Then ' If value between 10-19...
Select Case Val(TensText)
Case 10: Result = "Ten"
Case 11: Result = "Eleven"
Case 12: Result = "Twelve"
Case 13: Result = "Thirteen"
Case 14: Result = "Fourteen"
Case 15: Result = "Fifteen"
Case 16: Result = "Sixteen"
Case 17: Result = "Seventeen"
Case 18: Result = "Eighteen"
Case 19: Result = "Nineteen"
Case Else
End Select
Else ' If value between 20-99...
Select Case Val(Left(TensText, 1))
Case 2: Result = "Twenty "
Case 3: Result = "Thirty "
Case 4: Result = "Forty "
Case 5: Result = "Fifty "
Case 6: Result = "Sixty "
Case 7: Result = "Seventy "
Case 8: Result = "Eighty "
Case 9: Result = "Ninety "
Case Else
End Select
Result = Result & GetDigit _
(Right(TensText, 1)) ' Retrieve ones place.
End If
GetTens = Result
End Function
' 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
Can any body help for Omani Rials Formulae, for digit to word conversion?
I am trying to copy Bahraini Dinar formulae but getting syntax error : do while Mynumber " ".
thanks
For Bahrani dinar i'm getting error- compile error: syntax error. Do While MyNumber " "
Please assist
Hello Brother....
I wanna change numbers to arabic text .... like this:
40 will be اربعون
can you help me please
How about Philippine Peso? How can I Convert excel number to Word. Thank you
Changes dollar words to Peso and Cents to Centavos.
the debugging taking to long.
It works...great...!!
I just want small correction in the formula:
When I am trying to convert Number 11726.27 it gives me the answer as:
Eleven Thousand Seven Hundred Twenty Six Dollars and Twenty Seven Cents
I need Dollars to be mention at the starting as well Cents to be mentioned at starting. i.e.
USD Eleven Thousand Seven Hundred Twenty Six and Cents Twenty Seven only.
Can I get the code for this? Please.
how to set excel formulas number to word in lebanese pound only ?
How can I change to Omani Riyal & Baise or no currency either one will be helpful.
Thanks
How can I change the Currency from Dollars to Kenya shillings. Is there a way when using visual basic
Thanks, Worked perfectly
MyNumber = Trim(Str(MyNumber))
DecimalPlace = InStr(MyNumber, ".")
If DecimalPlace > 0 Then
Paise = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & _
"00", 2))
MyNumber = Trim(Left(MyNumber, DecimalPlace - 1))
End If
Count = 1
Do While MyNumber ""
Temp = GetHundreds(Right(MyNumber, 3))
If Temp "" Then Rupees = Temp & Place(Count) & Rupees
If Len(MyNumber) > 3 Then
MyNumber = Left(MyNumber, Len(MyNumber) - 3)
Else
MyNumber = ""
End If
Count = Count + 1
Do While MyNumber ""
Temp = GetHundreds(Right(MyNumber, 2))
If Temp "" Then Rupees = Temp & Place(Count) & Rupees
If Len(MyNumber) > 2 Then
MyNumber = Left(MyNumber, Len(MyNumber) - 2)
Else
MyNumber = ""
End If
Count = Count + 1
Loop
In this code something wrong where we use in Indian Currency there it should come as "one laksh twenty six thousand seven hundred rupees only" but the output is like
"one hundred twenty six thousand seven hundred rupees only.
where exactly the code has to change ... can anyone support me for clear the issue.
Option Explicit
'Main Function
Function SpellNumber(ByVal MyNumber)
Dim Rupees, Paise, Temp
Dim DecimalPlace, Count
ReDim Place(9) As String
Place(2) = " Thousand "
Place(3) = " Lakh "
Place(4) = " Crore "
MyNumber = Trim(Str(MyNumber))
DecimalPlace = InStr(MyNumber, ".")
If DecimalPlace > 0 Then
Paise = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & _
"00", 2))
MyNumber = Trim(Left(MyNumber, DecimalPlace - 1))
End If
Count = 1
Do While MyNumber ""
Temp = GetHundreds(Right(MyNumber, 3))
If Temp "" Then Rupees = Temp & Place(Count) & Rupees
If Len(MyNumber) > 3 Then
MyNumber = Left(MyNumber, Len(MyNumber) - 3)
Else
MyNumber = ""
End If
Count = Count + 1
Do While MyNumber ""
Temp = GetHundreds(Right(MyNumber, 2))
If Temp "" Then Rupees = Temp & Place(Count) & Rupees
If Len(MyNumber) > 2 Then
MyNumber = Left(MyNumber, Len(MyNumber) - 2)
Else
MyNumber = ""
End If
Count = Count + 1
Loop
Loop
Select Case Rupees
Case ""
Rupees = ""
Case "One"
Rupees = "One Rupee"
Case Else
Rupees = Rupees & " Rupee"
End Select
Select Case Paise
Case ""
Paise = " Only"
Case "One"
Paise = " One Paise Only"
Case Else
Paise = " and " & Paise & " Paise Only"
End Select
SpellNumber = Rupees & Paise
End Function
Function GetHundreds(ByVal MyNumber)
Dim Result As String
If Val(MyNumber) = 0 Then Exit Function
MyNumber = Right("000" & MyNumber, 3)
' Convert the hundreds place.
If Mid(MyNumber, 1, 1) "0" Then
Result = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred "
End If
' Convert the tens and ones place.
If Mid(MyNumber, 2, 1) "0" Then
Result = Result & GetTens(Mid(MyNumber, 2))
Else
Result = Result & GetDigit(Mid(MyNumber, 3))
End If
GetHundreds = Result
End Function
Function GetTens(TensText)
Dim Result As String
Result = "" ' Null out the temporary function value.
If Val(Left(TensText, 1)) = 1 Then ' If value between 10-19...
Select Case Val(TensText)
Case 10: Result = "Ten"
Case 11: Result = "Eleven"
Case 12: Result = "Twelve"
Case 13: Result = "Thirteen"
Case 14: Result = "Fourteen"
Case 15: Result = "Fifteen"
Case 16: Result = "Sixteen"
Case 17: Result = "Seventeen"
Case 18: Result = "Eighteen"
Case 19: Result = "Nineteen"
Case Else
End Select
Else ' If value between 20-99...
Select Case Val(Left(TensText, 1))
Case 2: Result = "Twenty "
Case 3: Result = "Thirty "
Case 4: Result = "Forty "
Case 5: Result = "Fifty "
Case 6: Result = "Sixty "
Case 7: Result = "Seventy "
Case 8: Result = "Eighty "
Case 9: Result = "Ninety "
Case Else
End Select
Result = Result & GetDigit _
(Right(TensText, 1)) ' Retrieve ones place.
End If
GetTens = Result
End Function
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
In this code something wrong where we use in Indian Currency there it should come as "one laksh twenty six thousand seven hundred rupees only" but the output is like
"one hundred twenty six thousand seven hundred rupees only.
where exactly the code has to change ... can anyone support me for clear the issue.
Hi
how to set excel formulas number to word in Malaysia Ringgit.
sample: RM 3181.60
three thousand one hundred eighty one and cents sixty only
sample: RM20.00
twenty ringgit only
(how to set?) please help to set this.
it works only those files where I applied this code. but when I open another/new file it not works.
Hi,
You need to place the code in each file, or use add-in as described in the manual above.
Please check out the following article on our blog, it’ll be sure to help you with your task: Personal Macro Workbook in Excel - make macros available in all workbooks.
Thank you. Very useful utility
3 Decimal.
Bahraini Dinar
Option Explicit
'Main Function
Function SpellNumber(ByVal MyNumber)
Dim Dinar, fils, Temp
Dim DecimalPlace, Count
ReDim Place(9) As String
Place(2) = " Thousand "
Place(3) = " Million "
Place(4) = " Billion "
Place(5) = " Trillion "
' String representation of amount.
MyNumber = Trim(Str(MyNumber))
' Position of decimal place 0 if none.
DecimalPlace = InStr(MyNumber, ".")
' Convert cents and set MyNumber to Dinar amount.
If DecimalPlace > 0 Then
fils = GetHundreds(Left(Mid(MyNumber, DecimalPlace + 1) & _
"000", 3))
MyNumber = Trim(Left(MyNumber, DecimalPlace - 1))
End If
Count = 1
Do While MyNumber ""
Temp = GetHundreds(Right(MyNumber, 3))
If Temp "" Then Dinar = Temp & Place(Count) & Dinar
If Len(MyNumber) > 3 Then
MyNumber = Left(MyNumber, Len(MyNumber) - 3)
Else
MyNumber = ""
End If
Count = Count + 1
Loop
Select Case Dinar
Case ""
Dinar = "No Dinar"
Case "One"
Dinar = "One Dinar"
Case Else
Dinar = Dinar & " Dinar"
End Select
Select Case fils
Case ""
fils = " and No fils"
Case "One"
fils = " and One fils"
Case Else
fils = " and " & fils & " fils"
End Select
SpellNumber = Dinar & fils
End Function
' Converts a number from 100-999 into text
Function GetHundreds(ByVal MyNumber)
Dim Result As String
If Val(MyNumber) = 0 Then Exit Function
MyNumber = Right("000" & MyNumber, 3)
' Convert the hundreds place.
If Mid(MyNumber, 1, 1) "0" Then
Result = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred "
End If
' Convert the tens and ones place.
If Mid(MyNumber, 2, 1) "0" Then
Result = Result & GetTens(Mid(MyNumber, 2))
Else
Result = Result & GetDigit(Mid(MyNumber, 3))
End If
GetHundreds = Result
End Function
' Converts a number from 10 to 99 into text.
Function GetTens(TensText)
Dim Result As String
Result = "" ' Null out the temporary function value.
If Val(Left(TensText, 1)) = 1 Then ' If value between 10-19...
Select Case Val(TensText)
Case 10: Result = "Ten"
Case 11: Result = "Eleven"
Case 12: Result = "Twelve"
Case 13: Result = "Thirteen"
Case 14: Result = "Fourteen"
Case 15: Result = "Fifteen"
Case 16: Result = "Sixteen"
Case 17: Result = "Seventeen"
Case 18: Result = "Eighteen"
Case 19: Result = "Nineteen"
Case Else
End Select
Else ' If value between 20-99...
Select Case Val(Left(TensText, 1))
Case 2: Result = "Twenty "
Case 3: Result = "Thirty "
Case 4: Result = "Forty "
Case 5: Result = "Fifty "
Case 6: Result = "Sixty "
Case 7: Result = "Seventy "
Case 8: Result = "Eighty "
Case 9: Result = "Ninety "
Case Else
End Select
Result = Result & GetDigit _
(Right(TensText, 1)) ' Retrieve ones place.
End If
GetTens = Result
End Function
' 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
hi i cannot make it any one can help
hi this is zaka working in Dubai, how i convert number to AED in excel
my number is +971 555 246 286
Sir,
I Need a formulae for qty Incl Kgs, Ltrs and Nos & Amount all. Will you help me
Hi
how to set excel formulas number to word in Malaysia Ringgit.
sample: RM 3181.6
three thousand one hundred eighty one and cents sixty only (how to set?)
How to set excel formulas number to word in a Malaysian Ringgit MYR?
Hi Md.Delwar,
Try this for indian rupees and paises:
Option Explicit
'Main Function
Function SpellNumber(ByVal MyNumber)
Dim Rupees, Paise, Temp
Dim DecimalPlace, Count
ReDim Place(9) As String
Place(2) = " Thousand "
Place(3) = " Lakh "
Place(4) = " Crore "
MyNumber = Trim(Str(MyNumber))
DecimalPlace = InStr(MyNumber, ".")
If DecimalPlace > 0 Then
Paise = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & _
"00", 2))
MyNumber = Trim(Left(MyNumber, DecimalPlace - 1))
End If
Count = 1
Do While MyNumber ""
Temp = GetHundreds(Right(MyNumber, 3))
If Temp "" Then Rupees = Temp & Place(Count) & Rupees
If Len(MyNumber) > 3 Then
MyNumber = Left(MyNumber, Len(MyNumber) - 3)
Else
MyNumber = ""
End If
Count = Count + 1
Do While MyNumber ""
Temp = GetHundreds(Right(MyNumber, 2))
If Temp "" Then Rupees = Temp & Place(Count) & Rupees
If Len(MyNumber) > 2 Then
MyNumber = Left(MyNumber, Len(MyNumber) - 2)
Else
MyNumber = ""
End If
Count = Count + 1
Loop
Loop
Select Case Rupees
Case ""
Rupees = ""
Case "One"
Rupees = "One Rupee"
Case Else
Rupees = Rupees & " Rupee"
End Select
Select Case Paise
Case ""
Paise = " Only"
Case "One"
Paise = " One Paise Only"
Case Else
Paise = " and " & Paise & " Paise Only"
End Select
SpellNumber = Rupees & Paise
End Function
Function GetHundreds(ByVal MyNumber)
Dim Result As String
If Val(MyNumber) = 0 Then Exit Function
MyNumber = Right("000" & MyNumber, 3)
' Convert the hundreds place.
If Mid(MyNumber, 1, 1) "0" Then
Result = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred "
End If
' Convert the tens and ones place.
If Mid(MyNumber, 2, 1) "0" Then
Result = Result & GetTens(Mid(MyNumber, 2))
Else
Result = Result & GetDigit(Mid(MyNumber, 3))
End If
GetHundreds = Result
End Function
Function GetTens(TensText)
Dim Result As String
Result = "" ' Null out the temporary function value.
If Val(Left(TensText, 1)) = 1 Then ' If value between 10-19...
Select Case Val(TensText)
Case 10: Result = "Ten"
Case 11: Result = "Eleven"
Case 12: Result = "Twelve"
Case 13: Result = "Thirteen"
Case 14: Result = "Fourteen"
Case 15: Result = "Fifteen"
Case 16: Result = "Sixteen"
Case 17: Result = "Seventeen"
Case 18: Result = "Eighteen"
Case 19: Result = "Nineteen"
Case Else
End Select
Else ' If value between 20-99...
Select Case Val(Left(TensText, 1))
Case 2: Result = "Twenty "
Case 3: Result = "Thirty "
Case 4: Result = "Forty "
Case 5: Result = "Fifty "
Case 6: Result = "Sixty "
Case 7: Result = "Seventy "
Case 8: Result = "Eighty "
Case 9: Result = "Ninety "
Case Else
End Select
Result = Result & GetDigit _
(Right(TensText, 1)) ' Retrieve ones place.
End If
GetTens = Result
End Function
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