You can convert a number into English words in Excel with a short VBA function: open the VBA editor with Alt+F11, insert a module, paste a custom function such as AmountInWords, then call it from any cell with =AmountInWords(A1). The function splits the number into groups of three digits and spells each group, adding "thousand", "million", "billion" and so on, plus the currency name and cents. This works in Excel for Microsoft 365, Excel 2021 and Excel 2019 on Windows and Mac; the VBA editor labels can differ slightly by version, but the steps below are the same.
What You'll Need
- Excel with macros enabled (the desktop app, not Excel for the web, which cannot run VBA).
- A workbook saved as
.xlsm(Excel Macro-Enabled Workbook) if you want the code to stay after closing. - Permission to run macros in your organisation; some managed PCs block them.
- The currency name you want to use (for example "dollars" and "cents"), since the code does not know your currency.
Step-by-Step
- Open the workbook that contains the amounts. Save a copy first if the file matters, because macro code changes are hard to undo after saving.
- Press Alt+F11 on Windows, or Fn+Option+F11 on a Mac, to open the Visual Basic Editor. On the left, find your workbook in the Project pane.
- Right-click the workbook name, choose Insert > Module. A blank code window opens. Do not paste code into a sheet module unless you know you need an event macro.
- Paste the function below into the module. Change
DollarsandCentsto your currency if needed.
Function AmountInWords(ByVal Amount As Double, Optional ByVal CurrencyName As String = "Dollars", Optional ByVal SubUnitName As String = "Cents") As String
Dim Whole As Long, Frac As Long
Dim Sign As String
If Amount < 0 Then Sign = "Minus ": Amount = -Amount
Whole = Int(Amount)
Frac = Round((Amount - Whole) * 100, 0)
If Frac = 100 Then Whole = Whole + 1: Frac = 0
AmountInWords = Sign & SpellNumber(Whole) & " " & CurrencyName & " and " & SpellNumber(Frac) & " " & SubUnitName
End Function
Private Function SpellNumber(ByVal n As Long) As String
Dim Ones As Variant, Tens As Variant, Scales As Variant
"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen")
Tens = Array("", "", "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety")
Scales = Array("", "Thousand", "Million", "Billion")
If n = 0 Then SpellNumber = "Zero": Exit Function
Dim s As String, grp As Long, i As Integer
i = 0
Do While n > 0
grp = n Mod 1000
If grp > 0 Then s = SpellGroup(grp, Ones, Tens) & " " & Scales(i) & " " & s
n = n \ 1000
i = i + 1
Loop
SpellNumber = Trim(s)
End Function
Private Function SpellGroup(ByVal g As Long, Ones As Variant, Tens As Variant) As String
Dim h As Long, t As Long, o As Long, s As String
h = g \ 100: t = (g Mod 100) \ 10: o = g Mod 10
If h > 0 Then s = Ones(h) & " Hundred "
If t > 1 Then
s = s & Tens(t) & " " & Ones(o)
ElseIf t = 1 Then
s = s & Ones(g Mod 100)
Else
s = s & Ones(o)
End If
SpellGroup = Trim(s)
End Function
- Press Ctrl+S in the VBA editor to save, then close it with Alt+Q. Return to the sheet.
- Click a cell where you want the words, type
=AmountInWords(A1)and press Enter. To use a different currency, type=AmountInWords(A1,"Euros","Cents"). - Save the workbook as
.xlsmvia File > Save As and choose Excel Macro-Enabled Workbook. If you save as.xlsx, Excel warns that the macro will be removed. - Test with a few values: 0, 1, 21, 100, 1000, 1234.56 and a negative number. Check the output reads correctly before relying on it.
Common Mistakes
- Pasting into the wrong module. Code in a sheet or ThisWorkbook module will not appear in the function list. Use a standard module.
- Saving as .xlsx. The macro is stripped on save. Use .xlsm.
- Macros disabled. If the function returns
#NAME?, check the Trust Center macro settings and that the file is trusted. - Rounding errors. Floating-point maths can make 1234.56 show 55 cents; the code above rounds to the nearest cent, but always verify totals.
- Currency mismatch. The default words say "Dollars and Cents"; change the optional arguments or the default text.
Tips
- Keep the function in a personal macro workbook if you want it available in every file, then call it from any workbook.
- Use
=PROPER(AmountInWords(A1))if you prefer title case. - For invoices, put the amount in one cell and the words in the adjacent cell so the text updates automatically.
- Copy the module to another workbook by dragging it in the Project pane, rather than retyping.
Troubleshooting
If you see #NAME?, the function is not visible: confirm the module is in the same workbook, the code has no red syntax lines, and macros are enabled. If you see #VALUE!, the referenced cell is not a number; check for text or spaces. If the editor will not open, the workbook may be protected or macros blocked by policy; contact your administrator rather than disabling security settings. If the file opens with a security warning, click Enable Content only if you trust the source. If the words are wrong for large numbers, the code handles up to billions; for larger values, extend the Scales array. If nothing changes after editing, press Ctrl+S in the VBA editor and recalculate with F9.
Frequently Asked Questions
Does this work in Excel for the web?
No. Excel for the web cannot run VBA macros; use the desktop app.
Can I use a different currency?
Yes. Pass the currency and subunit names as the second and third arguments, for example =AmountInWords(A1,"Pounds","Pence").
Why does my file lose the function after saving?
It was saved as .xlsx. Save as .xlsm to keep the macro.
Can I convert words back to numbers?
Not with this function; it is one-way. You would need a separate parser, which is error-prone, so keep the original numeric cell.
Is the code safe to use?
The code above only reads a number and returns text; it does not access files or the internet. Still, only run macros from sources you trust.