numerosaletras

Number to words in Excel.

Excel has no function for this, so here is the code. Pick your options and copy — a macro, a LAMBDA for where macros are blocked, or Apps Script for Google Sheets.

Options

Preview — what =NumberToWords(1234.56) returns

Copied

01 · the gap

Excel does not ship with this.

There is no worksheet function that spells a number out — not in any version, and there never has been.

TEXT formats a number; it does not name it. So every solution is somebody's code, and the quality varies enormously. The versions that circulate on forums tend to share the same three weaknesses: they miss the hyphen in twenty-one through ninety-nine, they occasionally pluralise the scale words, and they stop at the plain words, leaving anyone writing a check to assemble the amount line by hand.

The code above handles all three, and the options genuinely change it rather than post-processing a fixed result.

02 · three ways

Which version you want.

The three targets are not ranked. Which one is right depends entirely on where the sheet will be opened, and by whom.

Version Runs on Supports Watch out for
VBA macro Desktop Excel, Windows and Mac Everything, including the check format Blocked by the Trust Centre and by the Mark of the Web
LAMBDA Excel 365 and Excel for the web Everything except a very long number Needs a recent Excel; lives in the file, so it travels
Apps Script Google Sheets only Everything Runs on Google servers, so a slow first call

The short version: if the file stays on your machine, take the macro. If it will be emailed, shared or opened in a browser, take the LAMBDA — it lives inside the workbook and nothing blocks it. If the sheet is in Google Drive, Apps Script is the only option that applies.

03 · installing it

Four steps.

01

Pick the options

Currency, capitalisation and how the cents should look. The code changes with them — this is not a fixed snippet with a preview on top.

02

Choose where it runs

A VBA macro for desktop Excel, a LAMBDA for anywhere macros are blocked, or Apps Script for Google Sheets.

03

Paste it in

For VBA: Alt+F11, Insert > Module, paste, and save the file as .xlsm. For LAMBDA: Formulas > Name Manager > New. For Sheets: Extensions > Apps Script.

04

Use it on the sheet

Type =NumberToWords(A1) — or =NUMBERTOWORDS(A1) for the LAMBDA and Apps Script versions, which are named in capitals.

04 · the .xlsm trap

Save it as .xlsm, or lose it.

The single most common reason a working macro stops working is that the file was saved as .xlsx. That format cannot hold code, so Excel discards it — with a warning dialog that almost everybody clicks through, because it appears at the moment they are trying to leave.

The code is gone, not hidden. Reopening the file will not bring it back and neither will undoing. Save as Excel Macro-Enabled Workbook (.xlsm) the first time and the problem never arises.

The second most common reason is the Trust Centre blocking a file that came from outside your machine, which produces a red banner with no button to click. That one has its own fix, and the LAMBDA sidesteps it entirely.

05 · the details

Three things the forum versions miss.

Most of the code circulating for this task descends from a handful of posts written many years ago, and it inherits the same three gaps. None of them stops the macro running; all of them show up in the output.

The hyphen

Twenty-one through ninety-nine are hyphenated compounds, and a great deal of generated code emits "twenty one". It looks close enough to pass a glance and wrong to anyone reading carefully, which on a contract is the audience that counts.

Singular scale words

Hundred, thousand, million and billion do not take an "s" after a number. Code that builds the plural by appending one produces "two millions", which is the sort of error that survives because the loop that made it looked correct.

The check line

Almost every version stops at the plain words and leaves the amount line to the user, who then writes a second formula to bolt on "and 45/100". That line has its own rules — no currency word, Title Case, the fraction padded to two digits — and assembling it by hand is where the mistakes come in.

There is a reason this code avoids all three, and it is not care alone. The generator here produces JavaScript for Google Sheets from the same rules the site converter uses, and the test suite runs that generated JavaScript and compares its output against the converter, number by number. The VBA is a line-by-line translation of the version that passes. The code is checked by execution rather than by reading, which is the only way to be sure about something a visitor will paste into a document that matters.

06 · questions

Frequently asked questions.

  1. Q01

    Does Excel have a built-in function to convert numbers to words?

    No, and it never has. There is no worksheet function that spells a number out, in any version of Excel. Everything you find online is somebody’s macro, which is why the code varies so much in quality — and why the version you paste in matters.

  2. Q02

    Can I convert numbers to words in Excel without macros?

    Yes, with a LAMBDA. It is a named formula rather than code, so the Trust Centre has nothing to block, it survives a file arriving from outside, and it travels inside the workbook. It needs Excel 365 or Excel for the web; older desktop versions do not have LAMBDA.

  3. Q03

    Why does my macro stop working after I close the file?

    Almost certainly the file was saved as .xlsx, which cannot hold code. Excel discards the macro on save and warns you in a dialog most people click through. Save as .xlsm — an Excel Macro-Enabled Workbook — and it will still be there tomorrow.

  4. Q04

    What is the check format option?

    It writes the line a bank expects on the amount row: Title Case words, then the cents as a fraction over one hundred, as in "One Hundred Twenty-Three and 45/100". The word "Dollars" is left out because it is preprinted on the check. It is a different string from the ordinary spelled-out amount, not just a capitalisation of it.

  5. Q05

    Will this code work in Excel for Mac?

    The VBA does. The editor opens from Tools > Macro > Visual Basic Editor rather than Alt+F11, and the file still has to be saved as .xlsm. The LAMBDA works in any Excel 365 build, Mac included. Only Apps Script is platform-specific, since it belongs to Google Sheets.

  6. Q06

    How large a number can it handle?

    Up to the trillions, which is where the scale words in the code stop. Beyond that you would need quadrillion and above, and Excel itself starts losing precision on integers past about fifteen digits — so the limit is really Excel’s, not the code’s.

  7. Q07

    Why is this code different from the ones on forums?

    Mostly in three places: it hyphenates twenty-one through ninety-nine, it keeps the scale words singular, and it produces the check format directly. The forum versions usually get the first two right by accident and leave the third to the user, who then assembles the line by hand in a second formula.

  8. Q08

    Can I use it in Word instead?

    The same VBA runs in Word with a small change to how it is called, since Word has no cells to reference. There is a separate page here for the Word version, including the field code that Word has built in and its limits.

Copy it, paste it, save as .xlsm.

Or take the LAMBDA if the file is going anywhere. Both produce the same words, including the check line, and neither needs anything installed.