Excel does not have a built-in function to convert digits to words (such as changing 125 to "One Hundred Twenty Five"). To achieve this, you must use a VBA (Visual Basic for Applications) macro to create a Custom User Defined Function (UDF). Once this code is added to your workbook, you can use a formula like =SpellNumber(A1) just as you would with any standard Excel function.

What You'll Need

  • A desktop version of Microsoft Excel (Excel for Web and mobile apps do not support VBA macros).
  • A workbook saved in the Excel Macro-Enabled Workbook format (.xlsm).
  • Administrative permissions to enable macros on your computer.
  • Basic access to the Developer tab or the Visual Basic Editor shortcut.

Step-by-Step

  1. Prepare Your Workbook: Open your Excel file. Before adding the code, go to File > Save As and change the file extension from .xlsx to .xlsm (Excel Macro-Enabled Workbook). If you save it as a standard workbook, the conversion formula will be deleted as soon as you close the file.
  2. Open the Visual Basic Editor: Press Alt + F11 on your keyboard. This is the fastest way to open the VBA window. Alternatively, if you have the Developer tab enabled, click the Visual Basic button on the far left of the ribbon.
  3. Insert a New Module: In the VBA Editor window, look at the top menu bar. Click on Insert > Module. A blank white window will appear; this is where the custom logic for the digit-to-word conversion will live.
  4. Enter the SpellNumber Code: Copy and paste a reliable SpellNumber script into this module. Because the logic for handling hundreds, thousands, and millions is extensive, the code typically defines arrays for units (One, Two, Three), teens (Eleven, Twelve), and tens (Twenty, Thirty). The script must include a main function—usually named Function SpellNumber(ByVal MyNumber)—which breaks the number into chunks of three digits and processes them recursively.
  5. Define the Currency Logic: Within the code, ensure the currency labels (such as "Dollars" and "Cents") are set to your preference. You can find these strings toward the end of the script. If you need the output to be plain numbers without currency, you can modify the code to replace "Dollars" with an empty string "" and remove the cents logic.
  6. Save and Exit the Editor: Once the code is pasted, press Ctrl + S to save the project, then close the VBA window by clicking the X in the top right corner or pressing Alt + Q.
  7. Apply the Formula in the Sheet: Go back to your Excel worksheet. In any empty cell, type =SpellNumber(A1), replacing A1 with the cell containing the digit you want to convert. Press Enter, and the number will be converted to words.
  8. Drag to Fill: To convert a whole column of numbers, click the small green square (fill handle) at the bottom right of the cell containing your formula and drag it down to apply the conversion to all relevant rows.

Common Mistakes

The most frequent error is saving the file as a .xlsx file. Standard Excel files strip out all VBA code for security reasons. If you do this, your =SpellNumber formula will suddenly return a #NAME? error because the underlying function no longer exists in the workbook. Always verify that the file extension is .xlsm.

Another common mistake is trying to use this formula in Excel Online or the mobile app. VBA is a legacy technology that runs on the local machine's processor; it cannot be executed by the cloud-based version of Excel. If you share the file with a colleague who opens it in a web browser, the formula will not work for them.

Users often forget to enable macros when opening the file for the first time. When you open a .xlsm file, Excel usually displays a yellow security warning bar at the top of the screen stating "Macros have been disabled." If you do not click "Enable Content," the custom formula will not execute, and you will see an error in the cell.

Incorrectly copying the code is also common. If you miss a single "End Function" or "End If" statement during the copy-paste process, the VBA editor will throw a "Compile Error," and the function will fail to load entirely.

Tips

To make the formula available across all your Excel files without having to paste the code every time, save the module as an Excel Add-In (.xlam). Once saved as an add-in and enabled via the Excel Options > Add-ins menu, the =SpellNumber function becomes a global command on your specific computer, regardless of which workbook you are using.

If you need the output to be in Proper Case (e.g., "One Hundred Twenty Five") rather than all uppercase or lowercase, wrap your custom formula in the PROPER function: =PROPER(SpellNumber(A1)). This ensures a professional look for invoices or formal checks.

For those dealing with very large numbers, check that the VBA variable is declared as a "Double" or "Currency" rather than an "Integer." An Integer in VBA has a maximum value of 32,767. If you try to convert 50,000 using an Integer variable, the code will crash with an "Overflow" error.

If you want to combine the word conversion with other text, use the ampersand (&) symbol. For example: ="The total amount due is " & SpellNumber(A1). This allows you to create full sentences automatically based on numerical data.

Troubleshooting

If you see a #NAME? error, it means Excel cannot find the function. First, check if the file is saved as .xlsm. Second, go back into the VBA Editor (Alt + F11) and ensure the code is located in a "Module" and not inside the "ThisWorkbook" or "Sheet1" object. Code placed in sheet objects is often treated as event-driven rather than a callable function.

If the formula returns a #VALUE! error, the cell you are referencing likely contains text or a symbol (like a currency sign) that Excel is treating as a string instead of a number. Ensure the source cell is formatted as "Number" or "General" and contains only digits and a decimal point.

If the VBA editor displays a "Compile Error: Variable not defined," it is likely because the script has "Option Explicit" turned on at the top. This requires every single variable to be declared. You can either add the missing declarations or simply delete the line "Option Explicit" from the very top of the module to allow the code to run more flexibly.

If the results are slightly incorrect (e.g., it says "One Hundred Twenty" instead of "One Hundred and Twenty"), you will need to edit the code logic. Look for the section of the VBA script that handles the transition from hundreds to tens and insert the word " and " into the string concatenation logic.

Frequently Asked Questions

Can I use this formula in Google Sheets?

No, Google Sheets uses Apps Script (JavaScript), not VBA. To achieve this in Sheets, you would need to write a similar script in the Extensions > Apps Script menu using JavaScript syntax.

Does this work for decimals and cents?

Yes, provided the VBA script you use includes a section for decimals. Most standard SpellNumber scripts split the number at the decimal point and process the remainder as "Cents" or "Hundredths."

Is there a way to do this without VBA?

Technically yes, but it requires an incredibly long and complex nested IF and CHOOSE formula that is difficult to maintain and often hits the character limit for cells. VBA is the industry-standard method for this task.

Will this work on a Mac?

Yes, VBA is supported on Excel for Mac, though the keyboard shortcuts may differ (use Option instead of Alt). The process of inserting a module and pasting the code remains the same.

Can I convert numbers to words in other languages?

Yes, but you must use a specific script written for that language. The logic for converting numbers to words varies significantly between English, Spanish, French, and other languages due to different grammatical rules.

Is it safe to enable macros from the internet?

You should only enable macros in files you created yourself or received from a trusted source. Macros can contain malicious code, so always review the VBA script to ensure it only contains the SpellNumber logic before running it.