To convert a numeric amount to its written form in Excel (e.g., 1234.50 to "One Thousand Two Hundred Thirty-Four Dollars and Fifty Cents"), you need a custom VBA function because Excel has no built-in command for this. First, enable the Developer tab and insert a VBA module, then paste the provided code. Once saved, use the new function like any Excel formula.
What You'll Need
- Microsoft Excel (2010 or later; works on Windows and Mac, but VBA support differs slightly)
- Administrator access to install or modify Excel settings
- Enabled Developer tab in Excel (required for VBA access)
- Basic familiarity with entering formulas and cell references
Step-by-Step
- Open your Excel workbook and navigate to the worksheet containing the numeric amount you want to convert (e.g., $1,234.50 in cell A2).
- Enable the Developer tab if it is not already visible: Go to File > Options > Customize Ribbon, then check the box next to “Developer” on the right side and click OK.
- Open the VBA editor by clicking the Developer tab, then selecting Visual Basic (or press Alt + F11 on Windows; on Mac, go to Tools > Macro > Visual Basic Editor).
- Insert a new module: In the VBA editor, go to Insert > Module. A blank code window will appear on the right.
- Paste the AmountInWords function code into the module window. Use the exact code below—this is a tested, widely used implementation that handles dollars and cents, commas in large numbers, and zero values:
Function AmountInWords(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 " MyNumber = Trim(Str(MyNumber)) DecimalPlace = InStr(MyNumber, ".") 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 AmountInWords = Dollars & Cents End Function Function GetHundreds(ByVal MyNumber) Dim Result As String If Val(MyNumber) = 0 Then Exit Function MyNumber = Right("000" & MyNumber, 3) If Mid(MyNumber, 1, 1) <> "0" Then Result = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred " End If If Mid(MyNumber, 2, 1) <> "0" Then Result = Result & GetTens(Mid(MyNumber, 2)) Else Result = Result & GetDigit(Mid(MyNumber, 3)) End If GetHundreds = Trim(Result) End Function Function GetTens(TensText) Dim Result As String Result = "" If Val(Left(TensText, 1)) = 1 Then 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" End Select Else 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 " End Select Result = Result & GetDigit(Right(TensText, 1)) 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 - Save and close the VBA editor: Press Ctrl + S (or Cmd + S on Mac), then close the editor window and return to Excel.
- Use the function in a cell: In any cell (e.g., B2), enter the formula
=AmountInWords(A2)(replace A2 with your reference). Press Enter. The result for 1234.50 will appear as "One Thousand Two Hundred Thirty-Four Dollars and Fifty Cents". - Format output consistently: To avoid extra spaces or inconsistent capitalization, ensure your input numbers use only digits and one decimal point (no currency symbols or commas). Excel will automatically truncate numbers with more than two decimal places, so round first if needed.
Common Mistakes
- Forgetting to enable the Developer tab—you cannot access VBA without it on a fresh Excel install.
- Pasting code into a worksheet cell instead of the VBA module—this will cause a syntax error and prevent the function from working.
- Using cell references with currency symbols (e.g., "$1,234")—the function expects a pure numeric value. Remove formatting before applying the formula, or wrap the reference in VALUE() like
=AmountInWords(VALUE(SUBSTITUTE(A2,"$",""))). - Not saving the workbook as macro-enabled (.xlsm)—if you save as .xlsx, Excel will remove the VBA function upon closing.
- Entering non-numeric text or multiple decimals—the function may return #VALUE! or incomplete text.
Tips
- For recurring use, add the function to a personal macro workbook (PERSONAL.XLSB) so it appears in all workbooks.
- To handle other currencies, modify the "Dollars" and "Cents" text in the main function—for instance, replace "Dollars" with "Euros" and "Cents" with "Cents".
- Use
=ROUND(A2,2)before feeding into the function to avoid rounding errors (e.g., 0.005 becoming "One Cent" instead of "Zero Cents"). - For large numbers, test with values like 1000000 (One Million) and 1000000000 (One Billion) to verify scaling works.
- On Mac, ensure macro security is set to "Enable all macros" temporarily in Excel > Preferences > Security > Macro Security before running VBA.
Troubleshooting
If the function returns #NAME?, #VALUE!, or unexpected text, follow these checks in order:
- Verify the function name spelling in your formula: Excel is case-insensitive, but typos like "AmountinWords" (missing capital W) will fail.
- Confirm macro security settings: Go to File > Options > Trust Center > Trust Center Settings > Macro Settings and select "Enable all macros" (temporarily for testing). Revert to "Disable all macros with notification" afterward for safety.
- Check for .xlsm extension: Save the workbook as Excel Macro-Enabled Workbook (.xlsm); otherwise, Excel deletes VBA code on close.
- Ensure no hidden characters in the source cell: Copy a working cell, right-click your target cell, and choose Paste Special > Values to eliminate invisible spaces or formatting.
- Re-paste the code: Delete the existing module, re-insert a new one, and paste the full code again—sometimes line breaks or encoding issues cause silent errors.
- Test with a simple value: Enter 1 in A1 and use
=AmountInWords(A1). If it returns "One Dollar and No Cents", the function works, so the issue lies with your original cell’s value or format.