To convert a numeric amount into words (e.g., $123.45 → 'One Hundred Twenty-Three Dollars and Forty-Five Cents') in Excel, you must use a custom VBA function like SpellNumber because Excel has no built-in function for this. You need to enable macros and paste the code into the VBA editor first.
What You'll Need
- Microsoft Excel (Windows only—this method does not work in Excel for Mac, Excel Online, or mobile apps)
- Macro security set to enable macros (you must allow VBA code execution)
- Access to the Visual Basic for Applications (VBA) editor (via Developer tab)
- A numeric value in a cell (e.g., A1 contains 1234.56)
Step-by-Step
- Open your Excel workbook and go to the Developer tab. If you don’t see this tab, right-click any ribbon area > Customize the Ribbon > check Developer > OK.
- Click Visual Basic in the Developer tab, or press Alt + F11 to open the VBA editor.
- In the VBA editor, go to Insert > Module to create a new blank module sheet.
- Copy the entire
SpellNumberfunction code below and paste it into the module window: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 " 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 SpellNumber = Dollars & Cents 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" Case Else 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" Case Else End Select If Val(Right(TensText, 1)) <> 0 Then Result = Result & " " & GetDigit(Right(TensText, 1)) End If GetTens = Result End Function Function GetHundreds(HundredsText) Dim Result As String If Val(Left(HundredsText, 1)) <> 0 Then Result = GetDigit(Left(HundredsText, 1)) & " Hundred" End If If Val(Mid(HundredsText, 2, 1)) <> 0 Or Val(Right(HundredsText, 1)) <> 0 Then Result = Result & " " & GetTens(Mid(HundredsText, 2)) End If GetHundreds = 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 - Close the VBA editor window to return to Excel.
- In a blank cell (e.g., B1), enter the formula
=SpellNumber(A1), where A1 is the cell containing the number you want to convert. - Press Enter. The number in A1 will now appear as words in B1 (e.g., "One Hundred Twenty-Five Dollars and Thirty Cents").
Common Mistakes
- Using Excel Online, Mac, or mobile apps—the
SpellNumberfunction only works in desktop Excel for Windows because VBA is not supported elsewhere. - Macro security blocking the code—if macros are disabled, the function will show as
#NAME?. Set macro security to "Enable all macros" (temporarily for testing) via File > Options > Trust Center > Trust Center Settings > Macro Settings. - Cell reference errors—if A1 contains text, a non-numeric value, or is blank, the function may return unexpected output or an error. Ensure the cell holds a valid number.
- Forgetting to save as macro-enabled—if you save the file as .xlsx instead of .xlsm, the VBA code will be lost. Always save as Excel Macro-Enabled Workbook (.xlsm).
- Extra spaces or commas in numbers—the function fails on values like "1,234.5" or " 123.45". Clean data first (e.g., use
=VALUE(SUBSTITUTE(A1,",",""))to clean commas).
Tips
- Use
=IF(ISNUMBER(A1),SpellNumber(A1),"")to avoid errors when A1 is empty or non-numeric. - For currency formatting, combine with
TEXT:=SpellNumber(A1) & " only"adds "only" after the amount (common on checks). - For cents precision beyond two decimals, adjust the line
Mid(MyNumber, DecimalPlace + 1) & "00"to pad more zeros, but note the current code only handles two decimal places. - Test with small numbers first (e.g., 1, 10, 100, 1000) to verify the logic before scaling up.
- Back up your workbook before adding VBA code—corrupted modules can break formulas.
Troubleshooting
If SpellNumber returns #NAME?, follow these steps:
- Restart Excel—sometimes VBA functions aren’t recognized until the workbook is reopened after enabling macros.
- Check macro settings: File > Options > Trust Center > Trust Center Settings > Macro Settings > select "Enable all macros" (and "Trust access to the VBA project object model" if prompted).
- Verify the code is in the correct module: Press Alt + F11 > in the Project Explorer (View > Project Explorer), expand VBAProject > Microsoft Excel Objects > double-click "ThisWorkbook" or a sheet name to ensure no duplicate function definitions. Confirm the code is in a standard Module (not Sheet1, ThisWorkbook, etc.).
- Re-paste the code: Delete the module (right-click it in Project Explorer > Remove), then reinsert a new module and paste the code again.
- Check for typos: Ensure no quotes or line breaks were altered during pasting. The function is case-sensitive for internal logic, but VBA ignores case—so focus on missing characters or extra spaces in strings like "Thousand" or "Hundred".
- Test with a simple formula: In a new workbook, paste the code and use
=SpellNumber(100). If it works there, your original file may have corruption—copy sheets to a new workbook.
If the function returns incorrect amounts (e.g., "One Two Three" instead of "One Hundred Twenty-Three"), double-check the GetTens and GetHundreds functions for typos, especially in the Select Case blocks.
Frequently Asked Questions
Does this work in Excel for Mac?
No, VBA is not fully supported in Excel for Mac, and the SpellNumber function will not run. Use Excel for Windows instead.
Can I convert amounts in other currencies (e.g., Euros, Pounds)?
Yes, but you must edit the function. Replace "Dollars" and "Cents" with "Euros" and "Cents" (or "Pounds" and "Pence") in the SpellNumber function’s Select Case blocks. For example, change " Dollars" to " Euros".
Why does it show "No Dollars and No Cents" for zero?
This is expected behavior. The function treats 0 as "No Dollars and No Cents". If you prefer "Zero", modify the first Select Case block to handle 0 explicitly.
Does it handle negative numbers?
No. The function assumes positive values. To support negatives, wrap your cell reference: =IF(A1<0,"Negative ","") & SpellNumber(ABS(A1)).
What’s the largest number this can convert?
Up to trillions (e.g., 999,999,999,999,999). The code includes places up to "Trillion". Numbers larger than this will cause an error or unexpected output.
Can I use this in a pivot table or conditional formatting?
Yes, but only after the cell with =SpellNumber(A1) is calculated. Pivot tables cannot use custom VBA functions directly in their values area—you must add the formula to a helper column first.