{"id":12134,"date":"2012-04-09T16:37:15","date_gmt":"2012-04-09T16:37:15","guid":{"rendered":"http:\/\/www.learnexcelmacro.com\/?p=1560"},"modified":"2022-08-06T13:53:08","modified_gmt":"2022-08-06T13:53:08","slug":"currency-to-words","status":"publish","type":"post","link":"https:\/\/vmlogger.com\/excel\/2012\/04\/currency-to-words\/","title":{"rendered":"User Defined Function in Excel to Convert Currency to Words"},"content":{"rendered":"
[et_pb_section fb_built=”1″ _builder_version=”4.16″ da_disable_devices=”off|off|off” global_colors_info=”{}” da_is_popup=”off” da_exit_intent=”off” da_has_close=”on” da_alt_close=”off” da_dark_close=”off” da_not_modal=”on” da_is_singular=”off” da_with_loader=”off” da_has_shadow=”on”][et_pb_row _builder_version=”4.16″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” global_colors_info=”{}”][et_pb_column type=”4_4″ _builder_version=”4.16″ custom_padding=”|||” global_colors_info=”{}” custom_padding__hover=”|||”][et_pb_text _builder_version=”4.17.6″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” global_colors_info=”{}”]Many times we require to change the Numbers in Words. For Example 6734862=Sixty Seven Lakhs Thirty-Four Thousand Eight Hundred Sixty Two.<\/strong> In Excel, there is no Formula as such to Convert Numbers into Words. I have written one UDF : User Defined Function<\/strong>. After using this Function, you will be able to change any numbers in Words. Now there can be two ways of converting Numbers into Words in terms of Millions, Billions, etc Another way could be in Lakhs and Crores. <\/p>\n <\/a> Currenct2Word(B5)<\/strong> Numbers to convert in words<\/p><\/div>\n <\/p>\n \n<\/a><\/p>\n [\/et_pb_text][et_pb_cta title=”Download Excel File – Currency in Words” button_url=”\/excel\/wp-content\/downloads\/SpellCurrency-Lakhs&Crore.xls” button_text=”Download Now” _builder_version=”4.17.6″ _module_preset=”a50a16dd-d05f-4ea2-acab-1468d2e4010e” global_colors_info=”{}”]You can download this excel workbook which can convert your numbers into INR, USD, or any. other currency numbers in Words. Enjoy<\/p>\n Many times we require to change the Numbers in Words. For Example 6734862=Sixty Seven Lakhs Thirty-Four Thousand Eight Hundred Sixty Two. In Excel, there is no Formula as such to Convert Numbers into Words. I have written one UDF : User Defined Function. After using this Function, you will be able to change any numbers […]<\/p>\n","protected":false},"author":45,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"on","_et_pb_old_content":"Many times we require to change the Numbers in Words. For Example 6734862=Sixty Seven Lakhs Thirty-Four Thousand Eight Hundred Sixty Two.<\/strong> In Excel, there is no Formula as such to Convert Numbers into Words. I have written one UDF : User Defined Function<\/strong>. After using this Function, you will be able to change any numbers in Words. Now there can be two ways of converting Numbers into Words in terms of Millions, Billions, etc Another way could be in Lakhs and Crores.\r\n\u00a0\r\n
\n <\/p>\n\n
How to Convert Numbers in Words or Currency to Words<\/h2>\n
\nStep 1. <\/strong> Open your Excel Workbook
\nStep 2. <\/strong> Press Alt + F11
\nStep 3. <\/strong> Now Add a Regular Module in Excel
\nStep 4. <\/strong> Now Copy and Paste the Below Code in the Module
\nStep 5. <\/strong> Once you have copied and Pasted the Below Code in a Module, you can use the Below Formula in your Workbook in any WorkSheet as shown in Below Picture:<\/p>\n
\n
\nB5 : <\/strong> Is the Cell Address Where the Number is there<\/p>\n\n
\n\nFunction Currency2Word(ByVal MyNumber)\n\t\n\tDim WithoutCrore, Crore, DecimalPlace\n\tDim DecimalNumber\n\t\n\tMyNumber = Trim(Str(MyNumber))\n\t\n'get the Decimal Position\n\tDecimalPlace = InStr(MyNumber, \".\")\n\t\n'Get the Decimal Part of the whole Number\n\tIf DecimalPlace <> 0 Then\n\t\tDecimalNumber = Right(MyNumber, Len(MyNumber) - DecimalPlace)\n\tElse\n\t\tDecimalNumber = \"\"\n\tEnd If\n\t\n'Get the Decimal Free Number\n\tIf DecimalPlace > 0 Then\n\t\tMyNumber = Trim(Left(MyNumber, DecimalPlace - 1))\n\tEnd If\n\t\n'Divide the Decimal Free Number in 2 part - WithoutCrore and Crore\n'WithoutCrore Will have only that part part which has Less than Crore\n'Crore Will have only Crore Part\n\tIf DecimalNumber <> \"\" Then\n\t\tWithoutCrore = Right(MyNumber, 7) & \".\" & DecimalNumber\n\tElse\n\t\tWithoutCrore = Right(MyNumber, 7)\n\tEnd If\n\tCrore = Left(MyNumber, Len(MyNumber) - Len(Right(MyNumber, 7)))\n\t\n\tIf Crore <> \"\" Then\n\t\t\n'If the amount is greater than Crore\n\t\tCurrency2Word = CurrToWord(Crore) & \" Crore \" & CurrToWord(WithoutCrore)\n\tElse\n\t\t\n'If the amount is lesser than Crore\n\t\tCurrency2Word = CurrToWord(WithoutCrore)\n\tEnd If\nEnd Function\n\nFunction CurrToWord(ByVal MyNumber)\n\t\n\tDim WholeNumber, Deci, Var\n\tDim DecimalPlace, Count\n\t\n\tReDim Place(9) As String\n\tPlace(2) = \" Thousand \"\n\tPlace(3) = \" Lakhs \"\n\t\n'String representation of amount.\n\t\n\tMyNumber = Trim(Str(MyNumber))\n\t\n'Get the Decimal Place if any\n\tDecimalPlace = InStr(MyNumber, \".\")\n\t\n' Convert Deci and set MyNumber to Rupee amount.\n\tIf DecimalPlace > 0 Then\n\t\tDeci = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & _\n\t\t\"00\", 2))\n\t\tMyNumber = Trim(Left(MyNumber, DecimalPlace - 1))\n\tEnd If\n\t\n\tIf Len(Trim(Str(MyNumber))) Mod 2 = 0 Then\n\t\tMyNumber = \"0\" & Trim(Str(MyNumber))\n\tElse\n\t\tMyNumber = Trim(Str(MyNumber))\n\tEnd If\n\t\n\tCount = 1\n\t\n\tIf Len(MyNumber) = 1 Then\n\t\tMyNumber = \"00\" & MyNumber\n\tEnd If\n\t\n\tDo While MyNumber <> \"\"\n\t\tIf Count = 1 Or Count > 7 Then\n\t\t\tVar = GetHundreds(Right(MyNumber, 3))\n\t\tElse\n\t\t\tVar = GetTens(Right(MyNumber, 2))\n\t\tEnd If\n\t\t\n\t\tIf Var <> \"\" Then WholeNumber = Var & Place(Count) & WholeNumber\n\t\tIf Len(MyNumber) >= 1 And Count < 2 Then\n\t\t\tMyNumber = Left(MyNumber, Len(MyNumber) - 3)\n\t\t\t\n\t\tElseIf Len(MyNumber) >= 1 And Count > 1 Then\n\t\t\tMyNumber = Left(MyNumber, Len(MyNumber) - 2)\n\t\tElse\n\t\t\tMyNumber = \"\"\n\t\tEnd If\n\t\tCount = Count + 1\n\t\t\n\tLoop\n\tIf (Deci = \"\") Then\n\t\t\n\t\tCurrToWord = WholeNumber & Deci\n\tElse\n\t\tCurrToWord = WholeNumber & \" and \" & Deci & \" Paise Only\"\n\tEnd If\n\t\nEnd Function\n\n\n\n' Converts a number from 100-999 into text\n\n'***************************************************************\n\nFunction GetHundreds(ByVal MyNumber)\n\tDim Result As String\n\tIf Val(MyNumber) = 0 Then Exit Function\n\tMyNumber = Right(\"000\" & MyNumber, 3)\n' Convert the hundreds place.\n\tIf Mid(MyNumber, 1, 1) <> \"0\" Then\n\t\tResult = GetSingleDigit(Mid(MyNumber, 1, 1)) & \" Hundred \"\n\tEnd If\n\t\n' Convert the tens and ones place.\n\tIf Mid(MyNumber, 2, 1) <> \"0\" Then\n\t\tResult = Result & GetTens(Mid(MyNumber, 2))\n\tElse\n\t\tResult = Result & GetSingleDigit(Mid(MyNumber, 3))\n\tEnd If\n\tGetHundreds = Result\nEnd Function\n\n\n' This will Convert a number from 10 to 99 into text.\n\n'**********************************************************\n\n\nFunction GetTens(TensText)\n\t\n\tDim Result As String\n\tResult = \"\" ' Null out the Varorary function value.\n\tIf Val(Left(TensText, 1)) = 1 Then ' If value between 10-19...\n\t\tSelect Case Val(TensText)\n\t\tCase 10: Result = \"Ten\"\n\t\tCase 11: Result = \"Eleven\"\n\t\tCase 12: Result = \"Twelve\"\n\t\tCase 13: Result = \"Thirteen\"\n\t\tCase 14: Result = \"Fourteen\"\n\t\tCase 15: Result = \"Fifteen\"\n\t\tCase 16: Result = \"Sixteen\"\n\t\tCase 17: Result = \"Seventeen\"\n\t\tCase 18: Result = \"Eighteen\"\n\t\tCase 19: Result = \"Nineteen\"\n\t\tCase Else\n\t\tEnd Select\n\tElse ' If value between 20-99...\n\t\tSelect Case Val(Left(TensText, 1))\n\t\tCase 2: Result = \"Twenty \"\n\t\tCase 3: Result = \"Thirty \"\n\t\tCase 4: Result = \"Forty \"\n\t\tCase 5: Result = \"Fifty \"\n\t\tCase 6: Result = \"Sixty \"\n\t\tCase 7: Result = \"Seventy \"\n\t\tCase 8: Result = \"Eighty \"\n\t\tCase 9: Result = \"Ninety \"\n\t\tCase Else\n\t\tEnd Select\n\t\t\n\t\tResult = Result & GetSingleDigit _\n\t\t(Right(TensText, 1)) ' Retrieve ones place.\n\tEnd If\n\tGetTens = Result\nEnd Function\n\n\n' Converts a number from 1 to 9 into text.\n\n'****************************************************\n\nFunction GetSingleDigit(SingleDigit)\n\tSelect Case Val(SingleDigit)\n\tCase 1: GetSingleDigit = \"One\"\n\tCase 2: GetSingleDigit = \"Two\"\n\tCase 3: GetSingleDigit = \"Three\"\n\tCase 4: GetSingleDigit = \"Four\"\n\tCase 5: GetSingleDigit = \"Five\"\n\tCase 6: GetSingleDigit = \"Six\"\n\tCase 7: GetSingleDigit = \"Seven\"\n\tCase 8: GetSingleDigit = \"Eight\"\n\tCase 9: GetSingleDigit = \"Nine\"\n\tCase Else: GetSingleDigit = \"\"\n\tEnd Select\nEnd Function\n\n<\/code>\n<\/pre>\n
[\/et_pb_cta][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n<\/span>","protected":false},"excerpt":{"rendered":"
\r\n
\r\nHow to Convert Numbers in Words or Currency to Words<\/h2>\r\n<\/a>\r\nStep 1. <\/strong> Open your Excel Workbook\r\nStep 2. <\/strong> Press Alt + F11\r\nStep 3. <\/strong> Now Add a Regular Module in Excel\r\nStep 4. <\/strong> Now Copy and Paste the Below Code in the Module\r\nStep 5. <\/strong> Once you have copied and Pasted the Below Code in a Module, you can use the Below Formula in your Workbook in any WorkSheet as shown in Below Picture:\r\n\r\nCurrenct2Word(B5)<\/strong>\r\n\u00a0\r\nB5 : <\/strong> Is the Cell Address Where the Number is there\r\n\r\n\r\n[caption id=\"attachment_242435\" align=\"aligncenter\" width=\"542\"]
Numbers to convert in words[\/caption]\r\n\r\n
\r\n\r\n\r\n
\r\n\r\nFunction Currency2Word(ByVal MyNumber)\r\n\t\r\n\tDim WithoutCrore, Crore, DecimalPlace\r\n\tDim DecimalNumber\r\n\t\r\n\tMyNumber = Trim(Str(MyNumber))\r\n\t\r\n'get the Decimal Position\r\n\tDecimalPlace = InStr(MyNumber, \".\")\r\n\t\r\n'Get the Decimal Part of the whole Number\r\n\tIf DecimalPlace <> 0 Then\r\n\t\tDecimalNumber = Right(MyNumber, Len(MyNumber) - DecimalPlace)\r\n\tElse\r\n\t\tDecimalNumber = \"\"\r\n\tEnd If\r\n\t\r\n'Get the Decimal Free Number\r\n\tIf DecimalPlace > 0 Then\r\n\t\tMyNumber = Trim(Left(MyNumber, DecimalPlace - 1))\r\n\tEnd If\r\n\t\r\n'Divide the Decimal Free Number in 2 part - WithoutCrore and Crore\r\n'WithoutCrore Will have only that part part which has Less than Crore\r\n'Crore Will have only Crore Part\r\n\tIf DecimalNumber <> \"\" Then\r\n\t\tWithoutCrore = Right(MyNumber, 7) & \".\" & DecimalNumber\r\n\tElse\r\n\t\tWithoutCrore = Right(MyNumber, 7)\r\n\tEnd If\r\n\tCrore = Left(MyNumber, Len(MyNumber) - Len(Right(MyNumber, 7)))\r\n\t\r\n\tIf Crore <> \"\" Then\r\n\t\t\r\n'If the amount is greater than Crore\r\n\t\tCurrency2Word = CurrToWord(Crore) & \" Crore \" & CurrToWord(WithoutCrore)\r\n\tElse\r\n\t\t\r\n'If the amount is lesser than Crore\r\n\t\tCurrency2Word = CurrToWord(WithoutCrore)\r\n\tEnd If\r\nEnd Function\r\n\r\nFunction CurrToWord(ByVal MyNumber)\r\n\t\r\n\tDim WholeNumber, Deci, Var\r\n\tDim DecimalPlace, Count\r\n\t\r\n\tReDim Place(9) As String\r\n\tPlace(2) = \" Thousand \"\r\n\tPlace(3) = \" Lakhs \"\r\n\t\r\n'String representation of amount.\r\n\t\r\n\tMyNumber = Trim(Str(MyNumber))\r\n\t\r\n'Get the Decimal Place if any\r\n\tDecimalPlace = InStr(MyNumber, \".\")\r\n\t\r\n' Convert Deci and set MyNumber to Rupee amount.\r\n\tIf DecimalPlace > 0 Then\r\n\t\tDeci = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & _\r\n\t\t\"00\", 2))\r\n\t\tMyNumber = Trim(Left(MyNumber, DecimalPlace - 1))\r\n\tEnd If\r\n\t\r\n\tIf Len(Trim(Str(MyNumber))) Mod 2 = 0 Then\r\n\t\tMyNumber = \"0\" & Trim(Str(MyNumber))\r\n\tElse\r\n\t\tMyNumber = Trim(Str(MyNumber))\r\n\tEnd If\r\n\t\r\n\tCount = 1\r\n\t\r\n\tIf Len(MyNumber) = 1 Then\r\n\t\tMyNumber = \"00\" & MyNumber\r\n\tEnd If\r\n\t\r\n\tDo While MyNumber <> \"\"\r\n\t\tIf Count = 1 Or Count > 7 Then\r\n\t\t\tVar = GetHundreds(Right(MyNumber, 3))\r\n\t\tElse\r\n\t\t\tVar = GetTens(Right(MyNumber, 2))\r\n\t\tEnd If\r\n\t\t\r\n\t\tIf Var <> \"\" Then WholeNumber = Var & Place(Count) & WholeNumber\r\n\t\tIf Len(MyNumber) >= 1 And Count < 2 Then\r\n\t\t\tMyNumber = Left(MyNumber, Len(MyNumber) - 3)\r\n\t\t\t\r\n\t\tElseIf Len(MyNumber) >= 1 And Count > 1 Then\r\n\t\t\tMyNumber = Left(MyNumber, Len(MyNumber) - 2)\r\n\t\tElse\r\n\t\t\tMyNumber = \"\"\r\n\t\tEnd If\r\n\t\tCount = Count + 1\r\n\t\t\r\n\tLoop\r\n\tIf (Deci = \"\") Then\r\n\t\t\r\n\t\tCurrToWord = WholeNumber & Deci\r\n\tElse\r\n\t\tCurrToWord = WholeNumber & \" and \" & Deci & \" Paise Only\"\r\n\tEnd If\r\n\t\r\nEnd Function\r\n\r\n\r\n\r\n' Converts a number from 100-999 into text\r\n\r\n'***************************************************************\r\n\r\nFunction GetHundreds(ByVal MyNumber)\r\n\tDim Result As String\r\n\tIf Val(MyNumber) = 0 Then Exit Function\r\n\tMyNumber = Right(\"000\" & MyNumber, 3)\r\n' Convert the hundreds place.\r\n\tIf Mid(MyNumber, 1, 1) <> \"0\" Then\r\n\t\tResult = GetSingleDigit(Mid(MyNumber, 1, 1)) & \" Hundred \"\r\n\tEnd If\r\n\t\r\n' Convert the tens and ones place.\r\n\tIf Mid(MyNumber, 2, 1) <> \"0\" Then\r\n\t\tResult = Result & GetTens(Mid(MyNumber, 2))\r\n\tElse\r\n\t\tResult = Result & GetSingleDigit(Mid(MyNumber, 3))\r\n\tEnd If\r\n\tGetHundreds = Result\r\nEnd Function\r\n\r\n\r\n' This will Convert a number from 10 to 99 into text.\r\n\r\n'**********************************************************\r\n\r\n\r\nFunction GetTens(TensText)\r\n\t\r\n\tDim Result As String\r\n\tResult = \"\" ' Null out the Varorary function value.\r\n\tIf Val(Left(TensText, 1)) = 1 Then ' If value between 10-19...\r\n\t\tSelect Case Val(TensText)\r\n\t\tCase 10: Result = \"Ten\"\r\n\t\tCase 11: Result = \"Eleven\"\r\n\t\tCase 12: Result = \"Twelve\"\r\n\t\tCase 13: Result = \"Thirteen\"\r\n\t\tCase 14: Result = \"Fourteen\"\r\n\t\tCase 15: Result = \"Fifteen\"\r\n\t\tCase 16: Result = \"Sixteen\"\r\n\t\tCase 17: Result = \"Seventeen\"\r\n\t\tCase 18: Result = \"Eighteen\"\r\n\t\tCase 19: Result = \"Nineteen\"\r\n\t\tCase Else\r\n\t\tEnd Select\r\n\tElse ' If value between 20-99...\r\n\t\tSelect Case Val(Left(TensText, 1))\r\n\t\tCase 2: Result = \"Twenty \"\r\n\t\tCase 3: Result = \"Thirty \"\r\n\t\tCase 4: Result = \"Forty \"\r\n\t\tCase 5: Result = \"Fifty \"\r\n\t\tCase 6: Result = \"Sixty \"\r\n\t\tCase 7: Result = \"Seventy \"\r\n\t\tCase 8: Result = \"Eighty \"\r\n\t\tCase 9: Result = \"Ninety \"\r\n\t\tCase Else\r\n\t\tEnd Select\r\n\t\t\r\n\t\tResult = Result & GetSingleDigit _\r\n\t\t(Right(TensText, 1)) ' Retrieve ones place.\r\n\tEnd If\r\n\tGetTens = Result\r\nEnd Function\r\n\r\n\r\n' Converts a number from 1 to 9 into text.\r\n\r\n'****************************************************\r\n\r\nFunction GetSingleDigit(SingleDigit)\r\n\tSelect Case Val(SingleDigit)\r\n\tCase 1: GetSingleDigit = \"One\"\r\n\tCase 2: GetSingleDigit = \"Two\"\r\n\tCase 3: GetSingleDigit = \"Three\"\r\n\tCase 4: GetSingleDigit = \"Four\"\r\n\tCase 5: GetSingleDigit = \"Five\"\r\n\tCase 6: GetSingleDigit = \"Six\"\r\n\tCase 7: GetSingleDigit = \"Seven\"\r\n\tCase 8: GetSingleDigit = \"Eight\"\r\n\tCase 9: GetSingleDigit = \"Nine\"\r\n\tCase Else: GetSingleDigit = \"\"\r\n\tEnd Select\r\nEnd Function\r\n\r\n<\/code>\r\n<\/pre>\r\n
\r\n<\/a>\r\n\r\n\r\n