Change from number to text in excel

Excel for Microsoft 365 Excel for the web Excel 2021 Excel 2019 Excel 2016 Excel 2013 Excel 2010 Excel 2007 More…Less

If you want Excel to treat certain types of numbers as text, you can use the text format instead of a number format. For example, If you are using credit card numbers, or other number codes that contain 16 digits or more, you must use a text format. That’s because Excel has a maximum of 15 digits of precision and will round any numbers that follow the 15th digit down to zero, which probably isn’t what you want to happen.

It’s easy to tell at a glance if a number is formatted as text, because it will be left-aligned instead of right-aligned in the cell.

  1. Select the cell or range of cells that contains the numbers that you want to format as text. How to select cells or a range.

    Tip: You can also select empty cells, and then enter numbers after you format the cells as text. Those numbers will be formatted as text.

  2. On the Home tab, in the Number group, click the arrow next to the Number Format box, and then click Text.

    Note: If you don’t see the Text option, use the scroll bar to scroll to the end of the list.

    apply text format to numbers

Tips: 

  • To use decimal places in numbers that are stored as text, you may need to include the decimal points when you type the numbers.

  • When you enter a number that begins with a zero—for example, a product code—Excel will delete the zero by default. If this is not what you want, you can create a custom number format that forces Excel to retain the leading zero. For example, if you’re typing or pasting ten-digit product codes in a worksheet, Excel will change numbers like 0784367998 to 784367998. In this case, you could create a custom number format consisting of the code 0000000000, which forces Excel to display all ten digits of the product code, including the leading zero. For more information about this issue, see Create or delete a custom number format and Keep leading zeros in number codes.

  • Occasionally, numbers might be formatted and stored in cells as text, which later can cause problems with calculations or produce confusing sort orders. This sometimes happens when you import or copy numbers from a database or other data source. In this scenario, you must convert the numbers stored as text back to numbers. For more information, see Convert numbers stored as text to numbers.

  • You can also use the TEXT function to convert a number to text in a specific number format. For examples of this technique, see Keep leading zeros in number codes. For information about using the TEXT function, see TEXT function.

Need more help?

Содержание

  1. Format numbers as text
  2. Convert numbers into words
  3. Create the SpellNumber function to convert numbers to words
  4. Use the SpellNumber function in individual cells
  5. Save your SpellNumber function workbook
  6. Convert a Number to Text in Excel
  7. Convert a Number to Text By Adding an Apostrophe
  8. Convert a Number to Text Using Excel Text to Columns
  9. Convert a Number to Text Using Excel Concatenate
  10. Convert a Number to Text Using Excel Functions
  11. Convert a Number to Text Using The Excel Text Function
  12. Convert a Number to Text Using The Excel Dollar Function
  13. Convert a Number to Text Using The Excel Fixed Function
  14. How to convert numbers to text using Excel TEXT function and other options
  15. Convert number to text using the Excel TEXT function
  16. Use the Format Cells option to convert number to text in Excel
  17. Add an apostrophe to change number to text format
  18. Convert numbers to text in Excel with Text to Columns wizard

Format numbers as text

If you want Excel to treat certain types of numbers as text, you can use the text format instead of a number format. For example, If you are using credit card numbers, or other number codes that contain 16 digits or more, you must use a text format. That’s because Excel has a maximum of 15 digits of precision and will round any numbers that follow the 15th digit down to zero, which probably isn’t what you want to happen.

It’s easy to tell at a glance if a number is formatted as text, because it will be left-aligned instead of right-aligned in the cell.

Select the cell or range of cells that contains the numbers that you want to format as text. How to select cells or a range.

Tip: You can also select empty cells, and then enter numbers after you format the cells as text. Those numbers will be formatted as text.

On the Home tab, in the Number group, click the arrow next to the Number Format box, and then click Text.

Note: If you don’t see the Text option, use the scroll bar to scroll to the end of the list.

To use decimal places in numbers that are stored as text, you may need to include the decimal points when you type the numbers.

When you enter a number that begins with a zero—for example, a product code—Excel will delete the zero by default. If this is not what you want, you can create a custom number format that forces Excel to retain the leading zero. For example, if you’re typing or pasting ten-digit product codes in a worksheet, Excel will change numbers like 0784367998 to 784367998. In this case, you could create a custom number format consisting of the code 0000000000, which forces Excel to display all ten digits of the product code, including the leading zero. For more information about this issue, see Create or delete a custom number format and Keep leading zeros in number codes.

Occasionally, numbers might be formatted and stored in cells as text, which later can cause problems with calculations or produce confusing sort orders. This sometimes happens when you import or copy numbers from a database or other data source. In this scenario, you must convert the numbers stored as text back to numbers. For more information, see Convert numbers stored as text to numbers.

You can also use the TEXT function to convert a number to text in a specific number format. For examples of this technique, see Keep leading zeros in number codes. For information about using the TEXT function, see TEXT function.

Источник

Convert numbers into words

Excel doesn’t have a default function that displays numbers as English words in a worksheet, but you can add this capability by pasting the following SpellNumber function code into a VBA (Visual Basic for Applications) module. This function lets you convert dollar and cent amounts to words with a formula, so 22.50 would read as Twenty-Two Dollars and Fifty Cents. This can be very useful if you’re using Excel as a template to print checks.

If you want to convert numeric values to text format without displaying them as words, use the TEXT function instead.

Note: Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the VBA programming language, and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure. However, they will not modify these examples to provide added functionality, or construct procedures to meet your specific requirements.

Create the SpellNumber function to convert numbers to words

Use the keyboard shortcut, Alt + F11 to open the Visual Basic Editor (VBE).

Note: You can also access the Visual Basic Editor by showing the Developer tab in your ribbon.

Click the Insert tab, and click Module.

Copy the following lines of code.

Note: Known as a User Defined Function (UDF), this code automates the task of converting numbers to text throughout your worksheet.

Paste the lines of code into the Module1 (Code) box.

Press Alt + Q to return to Excel. The SpellNumber function is now ready to use.

Note: This function works only for the current workbook. To use this function in another workbook, you must repeat the steps to copy and paste the code in that workbook.

Use the SpellNumber function in individual cells

Type the formula =SpellNumber( A1) into the cell where you want to display a written number, where A1 is the cell containing the number you want to convert. You can also manually type the value like =SpellNumber(22.50).

Press Enter to confirm the formula.

Save your SpellNumber function workbook

Excel cannot save a workbook with macro functions in the standard macro-free workbook format (.xlsx). If you click File > Save. A VB project dialog box opens. Click No.

You can save your file as an Excel Macro-Enabled Workbook (.xlsm) to keep your file in its current format.

Click File > Save As.

Click the Save as type drop-down menu, and select Excel Macro-Enabled Workbook.

Источник

Convert a Number to Text in Excel

This page describes the following four different methods that can be used to convert a number to text in Excel:

Excel Convert Number to Text Index:
Number to Text By Adding an Apostrophe
Number to Text Using Text to Columns
Number to Text Using Excel Concatenate
Number to Text Using Excel Functions

Convert a Number to Text By Adding an Apostrophe

The quickest way to convert an Excel number to text is to insert an apostrophe in front of the number (see right above ).

The apostrophe will not be displayed in the cell, but it will tell Excel to treat the contents of the cell as text. This is also a useful way to force Excel to display leading zeros on numbers such as telephone numbers.

Convert a Number to Text Using Excel Text to Columns

If you want to convert an entire column of Excel numbers to text, you might prefer to use the Excel Text to Columns command.

However, this method might be less useful if your data spans several columns, as the Text to Columns command only works on one column at a time.

To use Excel Text to Columns to convert numbers to text:

    Select the range of cell(s) that you want to convert (these must not span more than one column).

From the Data tab on the Excel ribbon, select the Text to Columns option (see right above ).

This will cause the Convert Text to Columns wizard to open up. Within this:

  • Make sure the Delimited option is selected and click Next >;
  • Make sure that none of the Delimiters are selected and then click Next > again;

You should now be offered a selection of Column Data Formats. Select Text and click the Finish button.

Convert a Number to Text Using Excel Concatenate

The concatenation operator & simply joins together text and numbers into a single text string.

Therefore, if you concatenate an empty text string and a number, this returns a text string containing just the number.

An example of this is shown in the following spreadsheet:

As required, the values in column B of the results spreadsheet are text representations of the numbers in column A.

Convert a Number to Text Using Excel Functions

Excel provides the following three functions that are designed to convert numbers into text values:

Text Function Converts a supplied value into text, using a user-specified format.
Dollar Function Converts a supplied number into text, using a currency format.
Fixed Function Converts a supplied number into text, rounded to a specified number of decimal places.

Examples of each of these are provided below:

Convert a Number to Text Using The Excel Text Function

The Excel Text Function converts a supplied number to text, using a user-specified format. The syntax of the function is:

  • value is the number to be converted to text;
  • format_text is a text string that defines the formatting to be applied to the supplied value .

The spreadsheet below shows examples of the Excel Text Function used to convert a simple number, a currency, a date and a time into text:

A B
1 1234.5 =TEXT( A1, «General» )
2 1234 =TEXT( A2, «$#,##0.00» )
3 01/01/2016 =TEXT( A3, «mm/dd/yyyy» )
4 01/01/2016 =TEXT( A4, «mmm dd yyyy» )
5 12:00:00 =TEXT( A5, «hh:mm:ss» )
A B
1 1234.5 1234.5
2 1234 $1,234.00
3 01/01/2016 01/01/2016
4 01/01/2016 Jan 01 2016
5 12:00:00 12:00:00

The Excel Text Function, and the available formatting options, are described in further detail on the Excel Text Function page.

Convert a Number to Text Using The Excel Dollar Function

The Excel Dollar Function rounds a number to a specified number of decimal places and converts the rounded number to text, using a currency format. The syntax of the function is:

  • number is the number to be converted to text;
  • [decimals] is an optional argument that specifies the number of decimal places to be shown after the decimal point. (If omitted, the [decimals] argument is set to the default value 2).

Column B of the following spreadsheet shows three examples of the Excel Dollar Function:

A B
1 1234.5678 =DOLLAR( A1 )
2 1234.5678 =DOLLAR( A2, 1 )
3 1234.5678 =DOLLAR( A2, 0 )
A B
1 1234.5678 $1,234.57
2 1234.5678 $1,234.6
3 1234.5678 $1,235

Note that the currency format used in the Dollar function result will depend on the settings on your computer.

Convert a Number to Text Using The Excel Fixed Function

The Excel Fixed Function rounds a number to a specified number of decimal places and converts the rounded number to text. The syntax of the function is:

  • number is the number to be converted to text;
  • [decimals] is an optional argument which specifies the number of decimal places to be shown after the decimal point (if omitted, the [decimals] argument is set to the default value 2);
  • [no_commas] is an optional logical argument which specifies if the returned text should separate groups of digits (thousands, millions, etc.) by commas (TRUE = no commas; FALSE or omitted = include commas).

The spreadsheet below shows three examples of the Excel Fixed Function:

Источник

How to convert numbers to text using Excel TEXT function and other options

by Alexander Frolov, updated on March 11, 2023

This tutorial shows how to convert number to text in Excel 2016, 2013 and 2010. See how to accomplish the task with the Excel TEXT function and use number to string to specify the formatting. Learn how to change number format to text with the Format Cells… and Text to Columns options.

If you use Excel spreadsheets to store long and not so long numbers, one day you may need to convert them to text. There may be different reasons to change digits stored as numbers to text. Below you’ll find why you may need to make Excel see the entered digits as text, not as number.

  • Search by part not by the entire number. For example, you may need to find all numbers that contain 50, like in 501, 1500, 1950, etc.)
  • It may be necessary to match two cells using the VLOOKUP or MATCH function. However, if these cells are formatted differently, Excel will not see identical values as matching. For instance, A1 is formatted as text and B1 is number with format 0. The leading zero in B2 is a custom format. When matching these 2 cells Excel will ignore the leading 0 and will not show the two cells as identical. That’s why their format should be unified.

The same issue can occur if the cells are formatted as ZIP code, SSN, telephone number, currency, etc.

Note. If you want to convert numbers to words like amount to text, it’s a different task. Please check the article about spelling numbers named Two best ways to convert numbers to words in Excel.

In this article I’ll show you how to convert numbers to text with the help of the Excel TEXT function. If you are not so formula-oriented, have a look at the part where I explain how to change digits to text format with the help of the standard Excel Format Cells window, by adding an apostrophe and employing the Text to Columns wizard.

Convert number to text using the Excel TEXT function

The most powerful and flexible way to convert numbers to text is using the TEXT function. It turns a numeric value into text and allows to specify the way this value will be displayed. It’s helpful when you need to show numbers in a more readable format, or if you want to join digits with text or symbols. The TEXT function converts a numeric value to formatted text, thus the result cannot be calculated.

If you are familiar with using formulas in Excel, it will not be a problem for you to employ the TEXT function.

  1. Add a helper column next to the column with the numbers to format. In my example, it’s column D.
  2. Enter the formula =TEXT(C2,»0″) to the cell D2. In the formula, C2 is the address of the first cell with the numbers to convert.
  3. Copy the formula across the column using the fill handle.
  4. You will see the alignment change to left in the helper column after applying the formula.
  5. Now you need to convert formulas to values in the helper column. Start with selecting the column.
  6. Use Ctrl + C to copy. Then press the Ctrl + Alt + V shortcut to display the Paste Special dialog box.
  7. On the Paste Special dialog, select the Values radio button in the Paste group.

You will see a tiny triangle appear in the top-left corner of each cell in your helper column, which means the entries are now text versions of the numbers in your main column.

Now you can either rename the helper column and delete the original one, or copy the results to your main and remove the temporary column.

Note. The second parameter in the Excel TEXT function shows how the number will be formatted before being converted. You may need to adjust this based on your numbers:

The result of =TEXT(123.25,»0″) will be 123.

The result of =TEXT(123.25,»0.0″) will be 123.3.

The result of =TEXT(123.25,»0.00″) will be 123.25.

To keep the decimals only, use =TEXT(A2,»General») .

Tip. Say you need to format a cash amount, but the format isn’t available. For instance, you cannot display a number as British Pounds (ВЈ) as you use the built-in formatting in the English U.S. version of Excel. The TEXT function will help you convert this number to Pounds if you enter it like this: =TEXT(A12,»ВЈ#,###,###.##») . Just type the format to use in quotes -> insert the ВЈ symbol by holding down Alt and pressing 0163 on the numeric keypad -> type #,###.## after the ВЈ symbol to get commas to separate groups, and to use a period for the decimal point. The result is text!

Use the Format Cells option to convert number to text in Excel

If you need to quickly change the number to string, do it with the Format Cells… option.

  1. Select the range with the numeric values you want to format as text.
  2. Right click on them and pick the Format Cells… option from the menu list.

Tip. You can display the Format Cells… window by pressing the Ctrl + 1 shortcut.

You’ll see the alignment change to left, so the format will change to text. This option is good if you don’t need to adjust the way your numbers will be formatted.

Add an apostrophe to change number to text format

If these are just 2 or 3 cells in Excel where you want to convert numbers to string, benefit from adding an apostrophe before the number. This will instantly change the number format to text.

Just double-click in a cell and enter the apostrophe before the numeric value.

You will see a small triangle added in the corner of this cell. This is not the best way to convert numbers to text in bulk, but it’s the fastest one if you need to change just 2 or 3 cells.

Convert numbers to text in Excel with Text to Columns wizard

You may be surprised but the Excel Text to Columns option is quite good at converting numbers to text. Just follow the steps below to see how it works.

  1. Select the column where you want to convert numbers to string in Excel.
  2. Navigate to the Data tab in and click on the Text to Columns icon.
  3. Just click through steps 1 and 2. On the third step of the wizard, make sure you select the Text radio button.
  4. Press Finish to see your numbers immediately turn into text.

I hope the tips and tricks from this article will help you in your work with numeric values in Excel. Convert number to string using the Excel TEXT function to adjust the way your numbers will be displayed, or use Format Cells and Text to Columns for quick conversions in bulk. If these are just several cells, add an apostrophe. Feel free to leave your comments if you have anything to add or ask. Be happy and excel in Excel!

Источник

totn Excel Functions


This Excel tutorial explains how to convert number into words (with screenshots and step-by-step instructions).

Question: In Microsoft Excel, how can I convert a numeric value to words? For example, for a value of 1, could the cell show the word «one» instead?

Microsoft Excel

Answer: There is no-built in Excel function that will convert a number into words. Instead, you need to create a custom function to convert the number into words yourself. Let’s explore how.

To see the completed function and how it is used in the example below, download the example spreadsheet.

Download Example

TIP: When you create a custom function in Excel, it will create macro code. When you open your file after creating the custom function, it will warn that there are macros in the spreadsheet. You will need to enable the macros for the function to work properly.

Let’s get started. First, you’ll need to open your Excel spreadsheet and press Alt+F11 to open the Microsoft Visual Basic for Applications window. Under the Insert menu, select Module.

Microsoft Excel

This will insert a new module in your spreadsheet called Module1. Paste the following two functions into the new module.

' Example created by techonthenet.com
Function EnglishNumber(ByVal N As Currency) As String

   Const Thousand = 1000@
   Const Million = Thousand * Thousand
   Const Billion = Thousand * Million
   Const Trillion = Thousand * Billion

   If (N = 0@) Then EnglishNumber = "zero": Exit Function

   Dim Buf As String: If (N < 0@) Then Buf = "negative " Else Buf = ""
   Dim Frac As Currency: Frac = Abs(N - Fix(N))
   If (N < 0@ Or Frac <> 0@) Then N = Abs(Fix(N))
   Dim AtLeastOne As Integer: AtLeastOne = N >= 1

   If (N >= Trillion) Then
      Buf = Buf & EnglishNumberDigitGroup(Int(N / Trillion)) & " trillion"
      N = N - Int(N / Trillion) * Trillion
      If (N >= 1@) Then Buf = Buf & " "
   End If

   If (N >= Billion) Then
      Buf = Buf & EnglishNumberDigitGroup(Int(N / Billion)) & " billion"
      N = N - Int(N / Billion) * Billion
      If (N >= 1@) Then Buf = Buf & " "
   End If

   If (N >= Million) Then
      Buf = Buf & EnglishNumberDigitGroup(N  Million) & " million"
      N = N Mod Million
      If (N >= 1@) Then Buf = Buf & " "
   End If

   If (N >= Thousand) Then
      Buf = Buf & EnglishNumberDigitGroup(N  Thousand) & " thousand"
      N = N Mod Thousand
      If (N >= 1@) Then Buf = Buf & " "
   End If

   If (N >= 1@) Then
      Buf = Buf & EnglishNumberDigitGroup(N)
   End If

   EnglishNumber = Buf
End Function

Private Function EnglishNumberDigitGroup(ByVal N As Integer) As String

   Const Hundred = " hundred"
   Const One = "one"
   Const Two = "two"
   Const Three = "three"
   Const Four = "four"
   Const Five = "five"
   Const Six = "six"
   Const Seven = "seven"
   Const Eight = "eight"
   Const Nine = "nine"
   Dim Buf As String: Buf = ""
   Dim Flag As Integer: Flag = False

   Select Case (N  100)
      Case 0: Buf = "": Flag = False
      Case 1: Buf = One & Hundred: Flag = True
      Case 2: Buf = Two & Hundred: Flag = True
      Case 3: Buf = Three & Hundred: Flag = True
      Case 4: Buf = Four & Hundred: Flag = True
      Case 5: Buf = Five & Hundred: Flag = True
      Case 6: Buf = Six & Hundred: Flag = True
      Case 7: Buf = Seven & Hundred: Flag = True
      Case 8: Buf = Eight & Hundred: Flag = True
      Case 9: Buf = Nine & Hundred: Flag = True
   End Select

   If (Flag <> False) Then N = N Mod 100
   If (N > 0) Then
      If (Flag <> False) Then Buf = Buf & " "
   Else
      EnglishNumberDigitGroup = Buf
      Exit Function
   End If

   Select Case (N  10)
      Case 0, 1: Flag = False
      Case 2: Buf = Buf & "twenty": Flag = True
      Case 3: Buf = Buf & "thirty": Flag = True
      Case 4: Buf = Buf & "forty": Flag = True
      Case 5: Buf = Buf & "fifty": Flag = True
      Case 6: Buf = Buf & "sixty": Flag = True
      Case 7: Buf = Buf & "seventy": Flag = True
      Case 8: Buf = Buf & "eighty": Flag = True
      Case 9: Buf = Buf & "ninety": Flag = True
   End Select

   If (Flag <> False) Then N = N Mod 10
   If (N > 0) Then
      If (Flag <> False) Then Buf = Buf & "-"
   Else
      EnglishNumberDigitGroup = Buf
      Exit Function
   End If

   Select Case (N)
      Case 0:
      Case 1: Buf = Buf & One
      Case 2: Buf = Buf & Two
      Case 3: Buf = Buf & Three
      Case 4: Buf = Buf & Four
      Case 5: Buf = Buf & Five
      Case 6: Buf = Buf & Six
      Case 7: Buf = Buf & Seven
      Case 8: Buf = Buf & Eight
      Case 9: Buf = Buf & Nine
      Case 10: Buf = Buf & "ten"
      Case 11: Buf = Buf & "eleven"
      Case 12: Buf = Buf & "twelve"
      Case 13: Buf = Buf & "thirteen"
      Case 14: Buf = Buf & "fourteen"
      Case 15: Buf = Buf & "fifteen"
      Case 16: Buf = Buf & "sixteen"
      Case 17: Buf = Buf & "seventeen"
      Case 18: Buf = Buf & "eighteen"
      Case 19: Buf = Buf & "nineteen"
   End Select

   EnglishNumberDigitGroup = Buf

End Function

Your Excel window should look as follows:

Microsoft Excel

Click the Save button (disk icon) and then go back to your spreadsheet window.

You can now use the EnglishNumber function to convert a number to words. It will work just like any other worksheet function. Just reference the EnglishNumber function in your Excel spreadsheet as follows:

Microsoft Excel

Based on the spreadsheet above, the EnglishNumber function will return the following:

=EnglishNumber(1)
Result: "one"

=EnglishNumber(125)
Result: "one hundred twenty-five"

=EnglishNumber(3278)
Result: "three thousand two hundred seventy-eight"

This wikiHow teaches you how to create a Microsoft Excel function that converts numbers to their English text equivalent (e.g. 100 to One Hundred). You’ll also learn how to format cells as text so numerical values are ignored in calculations.

  1. Image titled 10052799 1

    1

    Open Microsoft Excel on your computer. If you’re using Windows, type excel into the search bar and click Microsoft Excel in the results. If you’re using a Mac, you’ll find Excel in the Applications folder.

  2. Image titled 10052799 2

    2

    Click the Developer tab. It’s at the top of the screen.

    • If you don’t see this tab, you’ll need to enable it. Open the File menu, select Options, then Customize Ribbon, and check the box next to ″Developer.″ Click OK when you’re done.
  3. Image titled 10052799 3

    3

    Click Visual Basic. It’s the first icon in the toolbar at the top of Excel.

  4. Image titled 10052799 4

    4

    Click the Insert menu. It’s near the top-left corner.

  5. Image titled 10052799 5

    5

    Click Module.

  6. Image titled 10052799 6

    6

    Type this code into the sheet.

      Option Explicit
      'Main Function
      Function SpellNumber(ByVal MyNumber)
        Dim Dollars, Cents, Temp
        Dim DecimalPlace, Count
        ReDim Place(9) As String
        Place(2) = " Thousand "
        Place(3) = " Million "
        Place(4) = " Billion "
        Place(5) = " Trillion "
        ' String representation of amount.
        MyNumber = Trim(Str(MyNumber))
        ' Position of decimal place 0 if none.
        DecimalPlace = InStr(MyNumber, ".")
        ' Convert cents and set MyNumber to dollar amount.
        If DecimalPlace > 0 Then
            Cents = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & _
                      "00", 2))
            MyNumber = Trim(Left(MyNumber, DecimalPlace - 1))
        End If
        Count = 1
        Do While MyNumber <> ""
            Temp = GetHundreds(Right(MyNumber, 3))
            If Temp <> "" Then Dollars = Temp & Place(Count) & Dollars
            If Len(MyNumber) > 3 Then
                MyNumber = Left(MyNumber, Len(MyNumber) - 3)
            Else
                MyNumber = ""
            End If
            Count = Count + 1
        Loop
        Select Case Dollars
            Case ""
                Dollars = "No Dollars"
            Case "One"
                Dollars = "One Dollar"
             Case Else
                Dollars = Dollars & " Dollars"
        End Select
        Select Case Cents
            Case ""
                Cents = " and No Cents"
            Case "One"
                Cents = " and One Cent"
                  Case Else
                Cents = " and " & Cents & " Cents"
        End Select
        SpellNumber = Dollars & Cents
      End Function
         
      ' Converts a number from 100-999 into text
      Function GetHundreds(ByVal MyNumber)
        Dim Result As String
        If Val(MyNumber) = 0 Then Exit Function
        MyNumber = Right("000" & MyNumber, 3)
        ' Convert the hundreds place.
        If Mid(MyNumber, 1, 1) <> "0" Then
            Result = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred "
        End If
        ' Convert the tens and ones place.
        If Mid(MyNumber, 2, 1) <> "0" Then
            Result = Result & GetTens(Mid(MyNumber, 2))
        Else
            Result = Result & GetDigit(Mid(MyNumber, 3))
        End If
        GetHundreds = Result
      End Function
         
      ' Converts a number from 10 to 99 into text.
      Function GetTens(TensText)
        Dim Result As String
        Result = ""           ' Null out the temporary function value.
        If Val(Left(TensText, 1)) = 1 Then   ' If value between 10-19...
            Select Case Val(TensText)
                Case 10: Result = "Ten"
                Case 11: Result = "Eleven"
                Case 12: Result = "Twelve"
                Case 13: Result = "Thirteen"
                Case 14: Result = "Fourteen"
                Case 15: Result = "Fifteen"
                Case 16: Result = "Sixteen"
                Case 17: Result = "Seventeen"
                Case 18: Result = "Eighteen"
                Case 19: Result = "Nineteen"
                Case Else
            End Select
        Else                                 ' If value between 20-99...
            Select Case Val(Left(TensText, 1))
                Case 2: Result = "Twenty "
                Case 3: Result = "Thirty "
                Case 4: Result = "Forty "
                Case 5: Result = "Fifty "
                Case 6: Result = "Sixty "
                Case 7: Result = "Seventy "
                Case 8: Result = "Eighty "
                Case 9: Result = "Ninety "
                Case Else
            End Select
            Result = Result & GetDigit _
                (Right(TensText, 1))  ' Retrieve ones place.
        End If
        GetTens = Result
      End Function
        
      ' Converts a number from 1 to 9 into text.
      Function GetDigit(Digit)
        Select Case Val(Digit)
            Case 1: GetDigit = "One"
            Case 2: GetDigit = "Two"
            Case 3: GetDigit = "Three"
            Case 4: GetDigit = "Four"
            Case 5: GetDigit = "Five"
            Case 6: GetDigit = "Six"
            Case 7: GetDigit = "Seven"
            Case 8: GetDigit = "Eight"
            Case 9: GetDigit = "Nine"
            Case Else: GetDigit = ""
        End Select
      End Function
      
  7. Image titled 10052799 7

    7

    Click the Excel button to return to the spreadsheet. It’s the green and white Excel icon near the top-left corner of Excel. Now that you’ve added the code, you can implement the new function.

  8. Image titled 10052799 8

    8

    Open the spreadsheet with numbers you want to convert. You can also create a new spreadsheet and type some numbers to convert.

  9. Image titled 10052799 9

    9

    Click a blank cell. This is where you’ll input the formula.

  10. Image titled 10052799 10

    10

    Type the Spell Number formula. The formula should look like this: =SpellNumber(number-to-convert).

    • For example, if you want to convert the number in cell A2 to its spelled-out equivalent, you’d type =(SpellNumber(A2).
    • If you prefer, you can replace the cell location with an actual number, like =SpellNumber(22).
  11. Image titled 10052799 11

    11

    Press Enter or Return. This runs the formula and displays the result in the current cell.

  1. Image titled 10052799 12

    1

    Open Microsoft Excel on your computer. If you’re using Windows, type excel into the search bar and click Microsoft Excel in the results. If you’re using a Mac, you’ll find Excel in the Applications folder.

    • Use this method if you want to include cells with numbers in formulas without the numbers being calculated.
  2. Image titled 10052799 13

    2

    Open your spreadsheet. You can do this by clicking the File menu, selecting Open, then double-clicking the file you want to edit.

  3. Image titled 10052799 14

    3

    Select the file or column with the numbers you want to convert. If the numbers are in a column, click the letter above the column. If they are in a row, click the number to the left of the row.

  4. Image titled 10052799 15

    4

    Right-click the highlighted area. A context menu will appear.

  5. Image titled 10052799 16

    5

    Click Format cells….

  6. Image titled 10052799 17

    6

    Select Text and click OK. Now that the cells are labeled as text, the values will be treated as regular text and not numbers. They’ll be displayed exactly as they are entered.

Ask a Question

200 characters left

Include your email address to get a message when this question is answered.

Submit

About this article

Thanks to all authors for creating a page that has been read 88 times.

Is this article up to date?

Понравилась статья? Поделить с друзьями:
  • Change format in excel vba
  • Change for the word 8 letters
  • Change for pdf to word
  • Change font style in word
  • Change font size in word