Uncategorized

Convert Number to Text in Excel: A Complete Guide

When preparing vouchers, sales invoices, or financial reports in Excel, it’s often necessary to spell out numeric amounts in words. For example, converting 123.50 to “One Hundred Twenty-Three Taka and Fifty Paise Only”. Unfortunately, Excel doesn’t have a built-in feature to do this—but with a little VBA, you can make it happen!

In this blog, we’ll walk you through how to create a custom Excel function called SpellNumber using VBA to convert numbers to text in a format commonly used in Bangladesh, India, and other countries where “Taka” and “Paise” are used.

🔧 Why Convert Numbers to Words?

Spelled-out amounts are often used in:

  • Bank cheques
  • Sales invoices
  • Payment vouchers
  • Formal contracts
  • Accounting records

They help avoid tampering and reduce ambiguity in financial documents.

✅ Step-by-Step: Add the SpellNumber Function in Excel

Step 1: Open the VBA Editor

  • Open your Excel workbook.
  • Press ALT + F11 to launch the Visual Basic for Applications (VBA) editor.

Step 2: Insert a Module

  • In the editor, click Insert → Module.
  • A blank code window will appear.

Step 3: Paste the SpellNumber Code

Copy and paste the following code into the module:

Function SpellNumber(amt As Variant) As String
Application.Volatile

Dim FIGURE As String
Dim FIGLEN As Integer
Dim i As Integer
Dim WORDs(19) As String
Dim tens(9) As String

' Initialize number words
WORDs(1) = "One"
WORDs(2) = "Two"
WORDs(3) = "Three"
WORDs(4) = "Four"
WORDs(5) = "Five"
WORDs(6) = "Six"
WORDs(7) = "Seven"
WORDs(8) = "Eight"
WORDs(9) = "Nine"
WORDs(10) = "Ten"
WORDs(11) = "Eleven"
WORDs(12) = "Twelve"
WORDs(13) = "Thirteen"
WORDs(14) = "Fourteen"
WORDs(15) = "Fifteen"
WORDs(16) = "Sixteen"
WORDs(17) = "Seventeen"
WORDs(18) = "Eighteen"
WORDs(19) = "Nineteen"

tens(2) = "Twenty"
tens(3) = "Thirty"
tens(4) = "Forty"
tens(5) = "Fifty"
tens(6) = "Sixty"
tens(7) = "Seventy"
tens(8) = "Eighty"
tens(9) = "Ninety"

' Convert the amount to a string with 2 decimal places
FIGURE = Format(amt, "0.00")
FIGLEN = Len(FIGURE)

' Pad to ensure consistent processing
If FIGLEN < 12 Then
    FIGURE = Space(12 - FIGLEN) & FIGURE
End If

SpellNumber = ""

' Process Crore, Lakh, Thousand
For i = 1 To 3
    If Val(Left(FIGURE, 2)) < 20 And Val(Left(FIGURE, 2)) > 0 Then
        SpellNumber = SpellNumber & WORDs(Val(Left(FIGURE, 2)))
    ElseIf Val(Left(FIGURE, 2)) >= 20 Then
        SpellNumber = SpellNumber & tens(Val(Left(FIGURE, 1)))
        If Val(Right(Left(FIGURE, 2), 1)) > 0 Then
            SpellNumber = SpellNumber & " " & WORDs(Val(Right(Left(FIGURE, 2), 1)))
        End If
    End If

    If i = 1 And Val(Left(FIGURE, 2)) > 0 Then
        SpellNumber = SpellNumber & " Crore "
    ElseIf i = 2 And Val(Left(FIGURE, 2)) > 0 Then
        SpellNumber = SpellNumber & " Lakh "
    ElseIf i = 3 And Val(Left(FIGURE, 2)) > 0 Then
        SpellNumber = SpellNumber & " Thousand "
    End If

    FIGURE = Mid(FIGURE, 3)
Next i

' Process Hundreds
If Val(Left(FIGURE, 1)) > 0 Then
    SpellNumber = SpellNumber & WORDs(Val(Left(FIGURE, 1))) & " Hundred "
End If

FIGURE = Mid(FIGURE, 2)

' Process Tens and Units
If Val(Left(FIGURE, 2)) < 20 And Val(Left(FIGURE, 2)) > 0 Then
    SpellNumber = SpellNumber & WORDs(Val(Left(FIGURE, 2)))
ElseIf Val(Left(FIGURE, 2)) >= 20 Then
    SpellNumber = SpellNumber & tens(Val(Left(FIGURE, 1)))
    If Val(Right(Left(FIGURE, 2), 1)) > 0 Then
        SpellNumber = SpellNumber & " " & WORDs(Val(Right(Left(FIGURE, 2), 1)))
    End If
End If

' Move to decimal (Paise)
FIGURE = Mid(FIGURE, 4)

If Val(FIGURE) > 0 Then
    SpellNumber = SpellNumber & " Paise "
    If Val(Left(FIGURE, 2)) < 20 Then
        SpellNumber = SpellNumber & WORDs(Val(Left(FIGURE, 2)))
    Else
        SpellNumber = SpellNumber & tens(Val(Left(FIGURE, 1)))
        If Val(Right(Left(FIGURE, 2), 1)) > 0 Then
            SpellNumber = SpellNumber & " " & WORDs(Val(Right(Left(FIGURE, 2), 1)))
        End If
    End If
End If

' Add "Taka Only"
If Val(amt) > 0 Then
    SpellNumber = SpellNumber & " Taka Only"
End If
End Function

Step 4: Save and Close the VBA Editor

Press Ctrl + S to save. Then close the VBA editor.
⚠️ If prompted, save the file as a macro-enabled workbook (.xlsm).

✨ How to Use the SpellNumber Function

Once added, you can use the function like any built-in Excel function.

In any cell:

  • Activate “=SpellNumber(“ Function
  • Select Cell…. Like F18 then press enter button

Now you can change number, Text will be changed automatically.

📌 Use Cases

Here’s where this function comes in especially handy:

  • 🧾 Sales Invoices — Add the amount in words for legal clarity.
  • 🧾 Payment Vouchers — Avoid fraud by using both numeric and worded values.
  • 🧾 Receipts & Bills — Add a professional touch to your documentation.

📝 Final Thoughts

Adding a SpellNumber function in Excel using VBA is a simple and effective way to enhance your documents. Whether you’re working in accounting, sales, or finance, this small addition adds clarity, professionalism, and helps prevent fraud.

Here we are providing Tax related service, For more please contact below mention number.

1.Foysal Ahmed, Professional Level, RAT of ICAB, Cell Phone No.01815096221

2.Md. Azgar Ali, ITP, Cell Phone No.01725 646 918

3.Ikram Uddin Ahmed,ITP Cell Phone No.01823 223 344

4.Abedin Kader,ITP, CA(Course Completed), Cell Phone No.01717 703 783

FM SKILL SHARING

This is a Compact File. (Auto Individual Tax Return)

Income Tax Return Format

**********************************************

ফাইলের নামঃ ব্যক্তিগত আয়কর রিটার্ন (বাংলা ভার্সন)

ফর্মঃ আইটি-১১গ (২০২৩)

*মূল্যঃ ৫০০ টাকা মাত্র*

**********************************************

File Name: Individual Income Tax Return (English Version)

Form: IT11GA (2023)

*Price Tk. 500 only*

**********************************************

Send Money This Number & also send a SMS with Bikas or Nagad Transaction Id & you mail no. Bikas No.01815 096 221

Partnership Firm Tax Return

**********************************************

ফাইলের নামঃ পার্টনারশীপ ফার্মের আয়কর রিটার্ন (বাংলা ভার্সন)

ফর্মঃ আইটি-১১গ (২০২৩)

*মূল্যঃ ৫০০ টাকা মাত্র*

**********************************************

File Name: Partnership Firm Income Tax Return (English Version)

Form: IT11GA (2023)

*Price Tk. 500 only*

**********************************************

Withholding Tax Return

**********************************************

ফাইলের নামঃ উইথহোল্ডিং ট্যাক্স রিটার্ন (বাংলা ভার্সন)

*মূল্যঃ ৫০০ টাকা মাত্র*

**********************************************

File Name: Withholding Tax Return with Practicing File (English Version)

*Price Tk.500 only*

**********************************************

TDS & VDS Calculator

**********************************************

File Name: Supplier TDS & VDS Deduction

*Price Tk.500 only*

File Name: Service Bill TDS & VDS Deduction

*Price Tk. 400 only*

File Name : TDS & VDS Deduction From Advertisement, Office Rent & Others

*Price Tk. 300 only*

File Name : Salary TDS Calculator

*Price Tk. 600 only*

**********************************************

Other File

**********************************************

File Name: Advance Tax Calculator for (Company & Individual)

*Price Tk.400 only*

**********************************************

File Name: Gift Tax Return

*Price Tk.300 only*

**********************************************

File Name: Private Company Gratuity Calculation File

*Price Tk.500 only*

**********************************************

Spread the love

Recent Posts

Automate Your Payroll: Generate Payslips with Mail Merge Easily

In today’s HR and accounting workflows, generating payslips efficiently and accurately for multiple employees is… Read More

3 months ago

How to Calculate Tax on Rental Income as per the 2023 Income Tax Act

বাড়ি বা জমি ভাড়া দিয়ে আয় করা আমাদের অনেকের জন্যই এক গুরুত্বপূর্ণ আয়ের উৎস। তবে,… Read More

10 months ago

Uncovering the Secrets of Service VAT Rate & It’s Exemption

Are you curious about how VAT rates and its exemptions is impact on businesses and… Read More

1 year ago

Navigating Incoterms: A Practical Approach

Incoterms (International Commercial Terms) defined by the International Chamber of Commerce (ICC). Incoterms are a… Read More

1 year ago

Unlocking the Secrets of VAT Registration in Bangladesh.

Are you a business owner in Bangladesh looking to navigate the complex world of VAT… Read More

1 year ago

Employee Funds Tax Returns Made Easy: Expert Insights

In recent time a question raises by most of the Business organization “Will the fund… Read More

2 years ago