Yes, you can do this using a custom VBA function or the newer TEXTAFTER and TEXTBEFORE functions in modern Excel versions, which automatically translates a cell value like 123 into "One Hundred Twenty-Three" without needing any external add-ins.
What You'll Need
- Microsoft Excel installed on your computer (desktop or online version).
- The data you wish to convert, typically in a single column of cells.
- A basic understanding of where to go to view and edit VBA code if you use the older method, or access the Formulas tab if using the new method.
Step-by-Step
Excel does not have a built-in, static formula for this task that works across all versions without adding code. The approach depends on which version of Excel you have installed.
Method 1: Using TEXTAFTER and TEXTBEFORE (Excel 365, Excel 2021, or Web)
This method uses Excel's dynamic array functions to separate the whole number from its decimal part, converts each part to text, and then joins them together with a word for the decimal point.
- Click on an empty cell where you want the text result to appear.
- Type the following formula into the cell, replacing "A1" with the cell containing your number:
=TEXTAFTER(A1, ".") & " point " & TEXTAFTER(TEXTBEFORE(A1, "."), " ") - Press Enter on your keyboard. Excel will calculate the result immediately.
- Drag the fill handle (the small square at the bottom-right corner of the cell) down to apply the formula to other rows.
Note: This formula works for positive numbers. If your cell contains negative numbers, you can wrap the formula in an IF statement to add the word "negative" at the beginning:
=IF(A1<0, "negative " & TEXTAFTER(A1, ".") & " point " & TEXTAFTER(TEXTBEFORE(A1, "."), " "), TEXTAFTER(A1, ".") & " point " & TEXTAFTER(TEXTBEFORE(A1, "."), " "))
Method 2: Using VBA (All Versions of Excel)
For users on older versions of Excel or those who prefer a single reusable function, a VBA (Visual Basic for Applications) macro is the standard solution. This creates a custom function named "NumberToWords" that works just like a built-in formula.
- Open your Excel workbook.
- Press Alt + F11 on your keyboard to open the VBA editor window.
- In the editor menu, go to Insert > Module.
- Copy and paste the following code into the large white window on the right:
- Close the VBA editor window by clicking the X in the top right.
- Return to your Excel spreadsheet.
- Click on the cell where you want the text result to appear.
- Type the following formula, replacing "A1" with your number cell:
=NumberToWords(A1) - Press Enter. The formula will now return the full text representation of the number.
Function NumberToWords(ByVal MyNumber)
Dim Dollars, Cents, Temp
Dim DecimalPlace, Count
Dim arraySigns()
ReDim arraySigns(15)
arraySigns(0) = ""
arraySigns(1) = "One "
arraySigns(2) = "Two "
arraySigns(3) = "Three "
arraySigns(4) = "Four "
arraySigns(5) = "Five "
arraySigns(6) = "Six "
arraySigns(7) = "Seven "
arraySigns(8) = "Eight "
arraySigns(9) = "Nine "
arraySigns(10) = "Ten "
arraySigns(11) = "Eleven "
arraySigns(12) = "Twelve "
arraySigns(13) = "Thirteen "
arraySigns(14) = "Fourteen "
arraySigns(15) = "Fifteen "
arraySigns(16) = "Sixteen "
arraySigns(17) = "Seventeen "
arraySigns(18) = "Eighteen "
arraySigns(19) = "Nineteen "
ReDim arraySigns(2)
arraySigns(0) = ""
arraySigns(1) = "Ten "
arraySigns(2) = "Twenty "
ReDim arraySigns(7)
arraySigns(0) = ""
arraySigns(1) = "Hundred "
arraySigns(2) = "Thousand "
arraySigns(3) = "Million "
arraySigns(4) = "Billion "
arraySigns(5) = "Trillion "
arraySigns(6) = "Quadrillion "
arraySigns(7) = "Quintillion "
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 & arraySigns(Count) & Dollars
If Len(MyNumber) > 3 Then
MyNumber = Left(MyNumber, Len(MyNumber) - 3)
Else
MyNumber = ""
End If
Count = Count + 1
Loop
Dollars = Dollars & Cents
If Dollars = "" Then Dollars = "Zero"
NumberToWords = Dollars
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 = arraySigns(Val(Mid(MyNumber, 1, 1))) & "Hundred "
End If
If Mid(MyNumber, 2, 1) <> "0" Then
Result = Result & GetTens(Val(Mid(MyNumber, 2, 2)))
Else
Result = Result & GetTens(Val(Mid(MyNumber, 3, 1)))
End If
GetHundreds = Result
End Function
Function GetTens(ByVal TensText)
Dim Result As String
Result = ""
If Val(Left(TensText, 1)) = 1 Then
Result = arraySigns(Val(Left(TensText, 2)))
Else
If Val(Left(TensText, 1)) = 2 Then
Result = "Twenty "
Else
If Mid(TensText, 1, 1) <> "0" Then
Result = arraySigns(Val(Mid(TensText, 1, 1))) & "Ten "
End If
End If
If Mid(TensText, 2, 1) <> "0" Then
Result = Result & arraySigns(Val(Mid(TensText, 2, 1)))
End If
End If
GetTens = Result
End Function
Common Mistakes
When working with large datasets or specific formatting, users often encounter issues that can be avoided by checking these common pitfalls early.
- Formatting Cells as Text First: If you type a number like 123 into a cell and then apply the formula, Excel might interpret the result as a number, stripping off the leading zeros if you have any. Always ensure the source data is in a standard Number format (General or Number) before applying the conversion formula.
- Forgetting to Lock Cell References: When dragging the formula down a column, you must ensure the cell reference (e.g., A1) is not accidentally shifted to B2 or C3. In the VBA method, the function is self-contained, so this is not an issue, but with the TEXTAFTER method, double-check that the column letter remains static.
- Ignoring Negative Numbers: The basic TEXTAFTER method described earlier does not handle negative signs automatically. If you copy-paste a column of negative numbers into the formula, it will likely return an error or a nonsensical string. Always apply an IF statement to check for negatives, as shown in the step-by-step guide.
- Using the Wrong Function Name: In the VBA method, if you mistype the function name (e.g., typing "NumberToWord" instead of "NumberToWords"), Excel will display a
#NAME?error. Ensure the spelling matches exactly what is pasted into the module.
Tips
Mastering this feature requires a little knowledge of how Excel handles data types and string manipulation.
- Use Number Formatting for Readability: Once the number is converted to text, you can place it inside a merged cell or a text box to make it easier to read in a report without having to adjust the column width constantly.
- Combine with Conditional Formatting: You can use conditional formatting to highlight specific numbers. For example, if you convert a number to text, you can look for cells containing the word "Billion" and change the font color to red to flag large figures.
- Handle Large Numbers: The VBA code provided is designed to handle numbers up to the quintillions. If you are working with astronomical figures or extremely large datasets, you may need to expand the dimension of the arraySigns array in the code, but for standard accounting and general use, the provided code is sufficient.
- Copy-Paste Values: Once you have the final text in the cell, you might want to paste it somewhere else without the formula. Right-click the cell, select Copy, then right-click the destination and choose Paste Special > Values. This converts the text result into static text that cannot be changed back to a number by editing.
Troubleshooting
If the formula returns an error or an unexpected result, check these specific areas to identify the cause.
- #VALUE! Error: This error usually appears if the source cell is empty or contains text that cannot be converted to a number. Ensure that the cell you are referencing actually contains a numeric value. If the cell contains a formula that results in a text string (like "N/A"), the conversion function will fail.
- #NAME? Error: If you are using the VBA method and see this error, it means Excel cannot find the function. This usually happens if the module was not saved correctly or if the function name was typed incorrectly in the spreadsheet cell. Go back to the VBA editor, ensure the code is there, and try saving the file as an .xlsm (Macro-Enabled Workbook) to ensure the function is retained.
- Formula Returns Zero: If the formula returns "Zero" or an empty string, the input number is likely zero. This is usually correct behavior, but double-check the source cell to ensure it wasn't accidentally formatted as text or if a decimal point was entered when a comma should have been used (depending on your regional settings).
- Leading Zeros Lost: If you are converting a number like 00123 and you expect the result to start with "One Hundred...", it is likely because Excel interpreted the cell as text before the formula was applied. Re-type the number in the cell, ensuring the cell format is set to General, and try the formula again.
Frequently Asked Questions
Can I convert a specific cell range, like A1:A10, all at once?
Yes. If you are using the VBA method, you can type the formula in the first cell and then drag the fill handle down to the bottom of your range. If you are using the TEXTAFTER method, the same drag-and-drop technique applies to the first cell in the column.
Does this work for currency amounts (e.g., $1,250.50)?
The formulas provided convert the raw number. To convert currency, you should first format your source cell as Currency using the Number Format menu. Then, apply the conversion formula to the text result. Alternatively, you can use the VBA function to create a more sophisticated version that appends the word "dollars" and "cents" automatically.
Why does the VBA code look like a foreign language?
The code uses Visual Basic for Applications (VBA), which is Microsoft's programming language for Excel. It contains loops and arrays that tell Excel exactly how to break down a number into hundreds, thousands, and millions. While it looks complex, it is a standard, reliable method for this task because it does not rely on specific version updates like the newer TEXTAFTER function.
Can I use this on a Mac?
Yes. The VBA method works on both Windows and Mac versions of Excel, provided you have enabled Macros in your Excel Trust Center settings. The TEXTAFTER method is also available on Excel 365 for Mac.
How do I handle numbers with commas (e.g., 1,000)?
Excel usually treats comma-separated numbers as text strings, not numbers. If you encounter this, you must first remove the commas using the Find and Replace feature (Ctrl+H) before running the conversion formula, or use the TRIM and SUBSTITUTE functions to clean the data first.