top of page

You are learning Functions and Formulas in MS Excel

How do I use the TEXT function to format numbers as text?

The TEXT function in Excel is a powerful tool for converting numbers into text with specific formatting. Here's how to use it:

Syntax:

=TEXT(value, format_text)

* value: This is the numeric value you want to convert to text. It can be a cell reference (e.g., A1), a formula that returns a number, or the number itself typed directly within the quotation marks (e.g., "123").
* format_text: This argument defines the specific text format you want to apply. It's enclosed in quotation marks and uses a variety of codes to represent different formatting elements.

Common Formatting Codes:

* 0: Represents a number (can be used for leading zeros).
* #: Represents a number, but omits leading zeros.
* . (decimal): Separates the integer part from the decimal part.
* , (comma): Adds commas for thousands separators.
* %: Multiplies by 100 and displays a percent sign.
* Text: Any text characters you include within the quotation marks will be displayed literally.

Examples:

* Convert a number to plain text: `=TEXT(A1, "")` - This removes any formatting and displays the number as plain text (e.g., 1234).
* Add leading zeros: `=TEXT(A1, "00000")` - This ensures the output always has five digits, padding with leading zeros if necessary (e.g., 00123).
* Format with commas: `=TEXT(A1, "#,0.00")` - This displays the number with commas for thousands separators and two decimal places (e.g., 1,234.56).
* Add text and format: `=TEXT(A1, "$#,0.00")` - This adds a dollar sign ($) before the number and applies the same formatting as the previous example (e.g., $1,234.56).

Tips:

* You can find more detailed information and a wider range of formatting codes in Excel's help documentation or online resources.
* Explore using custom formats within the "Format Cells" dialog for more complex formatting options. You can then copy the format code and use it within the TEXT function.
* Remember to enclose the format text in quotation marks.

By using the TEXT function, you can ensure your numbers are displayed consistently and according to your specific needs in your Excel spreadsheet.

bottom of page