Excel does not have a built-in function that converts a number into words. In Excel for Microsoft 365 on Windows, the practical way to do it is to add a small VBA user-defined function, then use a formula such as =NumberToWords(A2) in a cell; the example below spells out whole numbers.
Why Excel does not spell out numbers by default
Excel stores numbers as values for calculations and provides functions to display or transform them, but it does not include a standard worksheet function that turns a value such as 123 into “one hundred twenty-three.” Number formatting can add commas, currency symbols, or decimal places, but it cannot convert digits into written words. In particular, applying a format such as Currency changes how a number looks; it does not create a text description of the amount.
This distinction matters when preparing checks, invoices, certificates, or reports. A formatted value like $123.00 is still numeric, so Excel can add it or compare it. A phrase like “one hundred twenty-three dollars” is text. The text is useful for people, but it will not behave like a number in arithmetic. Decide whether you need a display label, a calculated value, or both before choosing a method.
Add a VBA function in Excel for Windows
The function below converts integer values from zero through 999,999,999,999,999 into English words. It uses the American-style convention without “and” between hundreds and tens—for example, “one hundred twenty-three.” It also handles negative values. It deliberately does not interpret decimals as cents or currency; fractional inputs return a message rather than silently rounding them.
- If the Developer tab is missing, open File > Options > Customize Ribbon, check Developer, and select OK.
- Choose Developer > Visual Basic. In the Visual Basic Editor, select Insert > Module.
- Paste the complete code below into the module, then close or minimize the editor to return to Excel.
- Save the workbook as an Excel Macro-Enabled Workbook (
.xlsm) so the VBA code is retained.
Public Function NumberToWords(ByVal value As Variant) As String
Dim n As Variant
Dim groupValue As Long
Dim groupIndex As Long
Dim result As String
Dim chunk As String
Dim isNegative As Boolean
On Error GoTo InvalidInput
If IsEmpty(value) Then
NumberToWords = ""
Exit Function
End If
If IsError(value) Or Not IsNumeric(value) Then GoTo InvalidInput
n = CDec(value)
If n <> Fix(n) Then
NumberToWords = "Whole numbers only"
Exit Function
End If
If Abs(n) > CDec(999999999999999#) Then GoTo InvalidInput
isNegative = (n < 0)
n = Abs(n)
If n = 0 Then
NumberToWords = "zero"
Exit Function
End If
Do While n > 0
groupValue = CLng(n - Fix(n / 1000) * 1000)
If groupValue > 0 Then
chunk = ThreeDigitWords(groupValue)
Select Case groupIndex
Case 1: chunk = chunk & " thousand"
Case 2: chunk = chunk & " million"
Case 3: chunk = chunk & " billion"
Case 4: chunk = chunk & " trillion"
End Select
If result = "" Then
result = chunk
Else
result = chunk & " " & result
End If
End If
n = Fix(n / 1000)
groupIndex = groupIndex + 1
Loop
If isNegative Then result = "negative " & result
NumberToWords = result
Exit Function
InvalidInput:
NumberToWords = "Invalid number"
End Function
Private Function ThreeDigitWords(ByVal n As Long) As String
Dim result As String
Dim remainder As Long
If n >= 100 Then
result = OneOrTeen(n \ 100) & " hundred"
remainder = n Mod 100
If remainder > 0 Then result = result & " "
Else
remainder = n
End If
If remainder >= 20 Then
result = result & TensWord(remainder \ 10)
If remainder Mod 10 > 0 Then
result = result & "-" & OneOrTeen(remainder Mod 10)
End If
ElseIf remainder > 0 Then
result = result & OneOrTeen(remainder)
End If
ThreeDigitWords = result
End Function
Private Function OneOrTeen(ByVal n As Long) As String
Select Case n
Case 1: OneOrTeen = "one"
Case 2: OneOrTeen = "two"
Case 3: OneOrTeen = "three"
Case 4: OneOrTeen = "four"
Case 5: OneOrTeen = "five"
Case 6: OneOrTeen = "six"
Case 7: OneOrTeen = "seven"
Case 8: OneOrTeen = "eight"
Case 9: OneOrTeen = "nine"
Case 10: OneOrTeen = "ten"
Case 11: OneOrTeen = "eleven"
Case 12: OneOrTeen = "twelve"
Case 13: OneOrTeen = "thirteen"
Case 14: OneOrTeen = "fourteen"
Case 15: OneOrTeen = "fifteen"
Case 16: OneOrTeen = "sixteen"
Case 17: OneOrTeen = "seventeen"
Case 18: OneOrTeen = "eighteen"
Case 19: OneOrTeen = "nineteen"
End Select
End Function
Private Function TensWord(ByVal n As Long) As String
Select Case n
Case 2: TensWord = "twenty"
Case 3: TensWord = "thirty"
Case 4: TensWord = "forty"
Case 5: TensWord = "fifty"
Case 6: TensWord = "sixty"
Case 7: TensWord = "seventy"
Case 8: TensWord = "eighty"
Case 9: TensWord = "ninety"
End Select
End Function
The code contains one public function for worksheet use and three private helper functions that build the hundreds, tens, and smaller number names. The maximum is intentionally limited to 15 digits, consistent with Excel’s documented numeric precision. It returns “Invalid number” for nonnumeric input or values outside the supported range. VBA functions are not undone with Ctrl+Z, so save a copy of your workbook before adding or changing code.
Use the function in a worksheet
With an integer in cell A2, enter this formula in another cell:
=NumberToWords(A2)
For example, if A2 contains 123456, the result is “one hundred twenty-three thousand four hundred fifty-six.” If A2 contains -42, the result is “negative forty-two.” If A2 is blank, the function returns a blank string. Because the function reads the referenced cell, changing A2 updates the result when Excel recalculates.
You can also type a numeric value directly into the formula, but referring to a cell is usually easier to maintain. Copy the formula down a column to convert a list of values, just as you would with an ordinary worksheet function. If the formula displays #NAME?, check that the code is in a standard module in the same open workbook, that the function name is spelled correctly, and that macros are enabled for that file.
Decimals, currency, and wording choices
The sample function is for whole numbers, not an amount-to-words currency converter. If you enter 123.45, it returns “Whole numbers only.” That is intentional: there is no single universal rule for reading decimal values. The value could be read as “one hundred twenty-three point four five,” or as “one hundred twenty-three dollars and forty-five cents,” depending on what the number represents.
For a check or invoice, do not assume that spelling the whole-number part is enough. You must also decide how to represent cents, the currency name, zero cents, and any rounding. A value stored as 123.456 might be displayed as $123.46 while retaining more digits internally. Confirm the intended rounding and wording requirements for your document, and avoid treating this general-purpose example as a formal check-writing or accounting tool.
Number names also vary by locale and style. This function uses “billion” in the modern short-scale sense and hyphenates values such as “forty-two.” It omits “and,” which is common in American usage; other English conventions may prefer “one hundred and twenty-three.” If your organization follows a house style, update the code and test representative values before using it in finished documents.
Save, reopen, and share the workbook safely
Save the workbook in .xlsm format; saving it as a regular .xlsx file removes VBA code. When reopening the file, Excel may show a security notice and require you to enable macros. Only enable macros in workbooks from sources you trust. A recipient who does not enable macros, or who opens the file in an application that does not run VBA, may see #NAME? instead of the converted text.
Excel for the web can open and edit many macro-enabled workbooks, but it cannot create, run, or edit VBA macros. Use desktop Excel to run this custom function. Excel for Mac supports VBA, though the ribbon and editor layout can differ; in current Microsoft 365 for Mac, enable the Developer tab through Excel > Preferences > Ribbon & Toolbar, then open Developer > Visual Basic. Menu labels can vary slightly by release.
For repeated use across multiple workbooks, a VBA add-in saved as an .xlam file can make a custom function available in Excel when the add-in is loaded. That is more convenient for an individual workflow, but it does not make the function portable to Excel for the web or users who lack the add-in. For shared templates, explain the macro requirement and provide a non-macro copy of any final text that recipients need to read.
Alternatives to VBA
If macros are not allowed, consider whether you need a one-time conversion or a reusable live formula. For a short list, you can type the words manually and retain the original number in a separate column for checking. A vetted Excel add-in may offer number-to-words functionality, but check its publisher, permissions, supported currencies, language conventions, and compatibility before installing it. Availability and behavior depend on the particular add-in.
Another option is to use an external conversion tool and paste the resulting text into Excel, but this creates a static result that will not update when the source number changes. Avoid assuming that Excel’s TEXT function can spell a number: it formats numeric values as text using number-format codes, but it does not translate digits into English words. For a recurring process that must work without VBA, a carefully maintained lookup or a separately developed solution may be appropriate, though it needs testing for the full range of values and wording rules.
Common problems and checks
#NAME?appears: Confirm that the function is in a standard VBA module, the workbook is saved as.xlsm, and macros are enabled. The formula cannot call code that Excel does not load.- The result says “Whole numbers only”: The source contains a fractional value. Decide whether to round, convert decimals digit by digit, or handle cents separately; do not silently change the source amount.
- The output differs from a document’s preferred style: The sample uses American-style wording without “and.” Change and verify the wording rules if your audience expects a different convention.
- A large number is inaccurate: Excel preserves only 15 significant digits for numeric values. If an identifier has leading zeros or more digits than Excel can preserve, store it as text; it is not an ordinary number to convert arithmetically.
- The result does not update: Check the cell reference and calculation settings. If calculation is manual, press F9 to recalculate in Windows Excel; on Mac, use the corresponding Excel recalculation command or shortcut for your version.
Before relying on converted output, compare it with the source value and test boundaries such as zero, 19, 20, 100, 1,000, a negative number, and the largest supported value. This catches errors in both the conversion code and the data being converted.
Frequently Asked Questions
Is there a built-in Excel formula to convert numbers to words?
No. Excel for Microsoft 365 does not include a standard worksheet function for spelling out numbers. A VBA user-defined function, an add-in, or a manual/external method is needed.
Can I use this function in Excel for the web?
No. Excel for the web does not run VBA macros. Open the macro-enabled workbook in desktop Excel, or use a conversion method that does not depend on VBA.
Will the function convert dollars and cents?
Not as written. It accepts whole numbers and returns a message for fractional values. A currency-specific function must separately define how to round and spell the major and minor currency units.
Why does Excel show #NAME? after I enter the formula?
Excel cannot find the custom function. Verify the spelling, module location, file type, and macro security settings, and make sure you are using desktop Excel with the workbook’s VBA code available.
Can I use the formula in Google Sheets?
No. Google Sheets does not run Excel VBA. It requires a separate Sheets-compatible script, add-on, or another conversion method; this VBA function is specifically for desktop Excel.
Related
- Excel EIN Number Format: Keep All 9 Digits Visible
- Excel Dependent Drop-Down Lists: Setup and Fixes
- Excel DOS Keyboard Shortcuts: What Actually Works
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Excel Date Format: Change Defaults and Cell SettingsTo change how dates appear in Excel, select the date cells, press Ctrl+1, choose Date or Custom on…
- How to Compare Two Excel Sheets: A Practical GuideTo compare two Excel sheets, first make sure corresponding data is in the same positions, then use a…
- Hide and Unhide Columns in Excel: ShortcutsIn Excel for Microsoft 365 on Windows, select a column or any cell in it and press Ctrl+0…
- Excel Not Responding? How to Protect and Recover WorkIf Excel says “Not Responding,” stop clicking and give it time to finish; it may be busy calculating,…
- Excel Custom Number Format: Show Zero as a DashYes. In Excel for Microsoft 365 on Windows, select the cells, press Ctrl+1, choose Number > Custom, and…
- Excel Shortcut to Select All Rows in a Column at OnceIn Excel for Microsoft 365 on Windows, press Ctrl+Spacebar to select the entire column containing the active cell,…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.