How to Write Numbers in Words in Excel: A Step-by-Step Guide

how to write numbers in words in excel

Ever wondered how to convert numbers into words in Excel? It’s actually simpler than you might think! To accomplish this, you’ll need to use a combination of Excel functions and a bit of creativity. You can either use a built-in VBA (Visual Basic for Applications) script or a custom function to turn numbers into text. We’ll walk you through the steps so you can master this handy trick.

How to Write Numbers in Words in Excel

The following steps will guide you to convert numbers into words in Excel using a VBA script. This approach will make Excel speak your numbers in text form, making your spreadsheets more dynamic and easier to understand.

Step 1: Open Your Excel Workbook

Open the Excel workbook where you want to convert numbers into words.

Having your workbook open is essential to start the process. You can’t work on it if it’s not open, right?

Step 2: Press ALT + F11 to Open the VBA Editor

This key combination opens the VBA editor, where you’ll write the script.

The VBA editor might seem intimidating, but it’s your playground for writing custom scripts. It’s like a backstage pass to Excel’s inner workings.

Step 3: Insert a New Module

Go to the "Insert" menu and click on "Module."

Inserting a new module is like opening a new blank page where you’ll write the VBA script.

Step 4: Copy and Paste the VBA Script

Copy the following VBA script and paste it into the module:

Function NumToWords(ByVal MyNumber)
Dim Units As String
Dim Teens As String
Dim Tens As String
Dim Hundreds As String
Dim Thousands As String

' Define words for units
Units = Array("", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine")
' Define words for teens
Teens = Array("Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen")
' Define words for tens
Tens = Array("", "", "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety")
' Define words for hundreds and thousands
Hundreds = " Hundred"
Thousands = " Thousand"

Dim i, TempNum, DecimalPlace, Count

ReDim Place(9) As String
Place(2) = Thousands

MyNumber = Trim(CStr(MyNumber))

DecimalPlace = InStr(MyNumber, ".")

If DecimalPlace > 0 Then
    TempNum = Left(MyNumber, DecimalPlace - 1)
Else
    TempNum = MyNumber
End If

Count = 1
Do While TempNum  ""
    TempNum = Right("000" & TempNum, 3)
    i = Int(TempNum / 100)
    If i > 0 Then
        Place(Count) = Units(i) & Hundreds & Place(Count)
    End If

    i = TempNum Mod 100
    If i > 0 Then
        If i < 10 Then
            Place(Count) = Place(Count) & " " & Units(i)
        ElseIf i < 20 Then
            Place(Count) = Place(Count) & " " & Teens(i - 10)
        Else
            Place(Count) = Place(Count) & " " & Tens(Int(i / 10))
            If (i Mod 10) > 0 Then
                Place(Count) = Place(Count) & "-" & Units(i Mod 10)
            End If
        End If
    End If
    TempNum = Left(TempNum, Len(TempNum) - 3)
    Count = Count + 1
Loop

For i = Count - 1 To 1 Step -1
    NumToWords = NumToWords & Place(i) & " "
Next i

NumToWords = Application.Trim(NumToWords)
End Function

This script is the heart of the process. It tells Excel how to interpret and convert numbers into words.

Step 5: Save the VBA Script

Save the script by clicking on the save icon or pressing CTRL + S.

Saving ensures you don’t lose your hard work. Plus, Excel won’t recognize the script unless it’s saved.

Step 6: Close the VBA Editor

Close the VBA editor by clicking the "X" button or pressing ALT + Q.

You’re done with the behind-the-scenes work. Time to head back to your spreadsheet.

Step 7: Use the Function in a Cell

In any cell, type =NumToWords(A1) where A1 is the cell containing the number you want to convert.

Now, when you hit Enter, the number in cell A1 will transform into words. Magic, right?

Once you’ve completed these steps, your numbers should convert into words seamlessly. This is especially useful for checks, invoices, or any document needing a textual representation of numbers.

Tips for Writing Numbers in Words in Excel

  • Customize the Script: You can modify the VBA script to include other languages or specific terminologies.
  • Error Handling: Always check for errors in your numbers to ensure the script works correctly.
  • Practice Makes Perfect: Experiment with different numbers to see how the script handles various cases.
  • Save a Backup: Always save a backup of your original file before running scripts.
  • Learn VBA Basics: Understanding basic VBA can help you troubleshoot and customize scripts further.

Frequently Asked Questions

Is there a built-in function in Excel to convert numbers to words?

No, Excel does not have a built-in function for this. You need to use a VBA script or an add-in.

Can I use this script for large numbers?

Yes, the script can handle large numbers, but double-check the output for accuracy.

Will this work on Excel for Mac?

Yes, VBA scripts work on Excel for both Windows and Mac, but the process to open the VBA editor may vary slightly.

What if the script doesn’t work?

Ensure you’ve copied the script correctly and saved it. Also, check for any typos in the function name or parameters.

Can I use this script in different workbooks?

Yes, you can copy the module from one workbook to another or save it as an add-in for easier access.

Summary

  1. Open your Excel workbook.
  2. Press ALT + F11 to open the VBA editor.
  3. Insert a new module.
  4. Copy and paste the VBA script.
  5. Save the VBA script.
  6. Close the VBA editor.
  7. Use the function in a cell.

Conclusion

Converting numbers into words in Excel is a fantastic trick that can make your data more presentable and easier to understand. While Excel doesn’t offer a built-in function for this task, a simple VBA script can fill the gap. Whether you’re creating invoices, writing checks, or just exploring Excel’s capabilities, knowing how to write numbers in words can be incredibly useful.

Take the time to practice these steps and even experiment with modifying the script to suit your needs. The more you engage with VBA, the more you’ll realize its power in extending Excel’s functionality. By mastering this skill, you’re not just learning a neat trick; you’re enhancing your overall Excel prowess. So go ahead, give it a try, and turn those numbers into words!

Get Our Free Newsletter

How-to guides and tech deals

You may opt out at any time.
Read our Privacy Policy