How to convert Indian rupees from numeric to words in Excel


When we create some important documents like the invoice or any other documents which need numeric values in words also. So in this tutorial, we will learn how can we convert a numeric value to words in some easy steps. So Let's start.

1. Open your excel sheet

Open your excel sheet which needs to convert the numeric data to the string.


2. Microsoft Visual Basic

Now we will write code for this and create a function that will convert the numeric data to strings(words). Whenever we need to do this in the same excel sheet we just need to call the function that is intToString.

Open the Microsoft Visual Basic in your excel sheet. To open this press Alt+F11. Now go the Insert Menu and select Module.

 


3. Use the code

Copy the code given below and past it to the Microsoft Visual Basic Module and save it. Now go to your excel sheet and to access the code call intToString function like given in the image.


 Function IntToString(amt As Variant) As Variant
Dim FIGURE As Variant
Dim LENFIG As Integer
Dim i As Integer
Dim Str(19) As String
Dim tens(9) As String
Str(1) = "One"
Str(2) = "Two"
Str(3) = "Three"
Str(4) = "Four"
Str(5) = "Five"
Str(6) = "Six"
Str(7) = "Seven"
Str(8) = "Eight"
Str(9) = "Nine"
Str(10) = "Ten"
Str(11) = "Eleven"
Str(12) = "Twelve"
Str(13) = "Thirteen"
Str(14) = "Forteen"
Str(15) = "Fifteen"
Str(16) = "Sixteen"
Str(17) = "Seventeen"
Str(18) = "Eighteen"
Str(19) = "Nineteen"
tens(2) = "Twenty"
tens(3) = "Thirty"
tens(4) = "Forty"
tens(5) = "Fifty"
tens(6) = "Sixty"
tens(7) = "Seventy"
tens(8) = "Eighty"
tens(9) = "Ninety"
FIGURE = amt
FIGURE = Format(FIGURE, "FIXED")
FIGLEN = Len(FIGURE)
If FIGLEN < 12 Then
FIGURE = Space(12 - FIGLEN) & FIGURE
End If
If Val(Left(FIGURE, 9)) > 1 Then
IntToString = "Rupees "
ElseIf Val(Left(FIGURE, 9)) = 1 Then
IntToString = "Rupee "
End If
For i = 1 To 3
If Val(Left(FIGURE, 2)) < 20 And Val(Left(FIGURE, 2)) > 0 Then
IntToString = IntToString & Str(Val(Left(FIGURE, 2)))
ElseIf Val(Left(FIGURE, 2)) > 19 Then
IntToString = IntToString & tens(Val(Left(FIGURE, 1)))
IntToString = IntToString & Str(Val(Right(Left(FIGURE, 2), 1)))
End If
If i = 1 And Val(Left(FIGURE, 2)) > 0 Then
IntToString = IntToString & " Crore "
ElseIf i = 2 And Val(Left(FIGURE, 2)) > 0 Then
IntToString = IntToString & " Lakh "
ElseIf i = 3 And Val(Left(FIGURE, 2)) > 0 Then
IntToString = IntToString & " Thousand "
End If
FIGURE = Mid(FIGURE, 3)
Next i
If Val(Left(FIGURE, 1)) > 0 Then
IntToString = IntToString & Str(Val(Left(FIGURE, 1))) + " Hundred "
End If
FIGURE = Mid(FIGURE, 2)
If Val(Left(FIGURE, 2)) < 20 And Val(Left(FIGURE, 2)) > 0 Then
IntToString = IntToString & Str(Val(Left(FIGURE, 2)))
ElseIf Val(Left(FIGURE, 2)) > 19 Then
IntToString = IntToString & " " & tens(Val(Left(FIGURE, 1)))
IntToString = IntToString & " " & Str(Val(Right(Left(FIGURE, 2), 1)))
End If
FIGURE = Mid(FIGURE, 4)
If Val(FIGURE) > 0 Then
IntToString = IntToString & " Paise "
If Val(Left(FIGURE, 2)) < 20 And Val(Left(FIGURE, 2)) > 0 Then
IntToString = IntToString & Str(Val(Left(FIGURE, 2)))
ElseIf Val(Left(FIGURE, 2)) > 19 Then
IntToString = IntToString & " " & tens(Val(Left(FIGURE, 1)))
IntToString = IntToString & " " & Str(Val(Right(Left(FIGURE, 2), 1)))
End If
End If
FIGURE = amt
FIGURE = Format(FIGURE, "FIXED")
If Val(FIGURE) > 0 Then
IntToString = IntToString & " Only "
End If
End Function

4. Final Output

After writing the function press Enter. Great!!! Now you can see that numeric Grand Total change to words.


Hope you enjoyed this tutorial, feel free to ask in the comment box if you get any problem.


Susmita devnath
Accountant in a Japanes MNC
42616