Text Formula in Excel for Numbers: How to Use TEXT

Formulas & functions · Updated November 20, 2026

In Excel, use the TEXT function to turn a number into text displayed in a format you choose. For example, if cell A2 contains 1234.5, the formula =TEXT(A2,"$#,##0.00") returns the text “$1,234.50” in typical US English settings; the format controls how the value looks, not its underlying amount.

What the TEXT formula does

TEXT takes a value and a number-format pattern, then returns the value as a text string. This is useful when a number needs to appear with a label, a particular number of decimal places, a percentage sign, or a date layout. The result may look like a number, but Excel treats it as text rather than as a numeric value.

That distinction matters. A cell containing the number 42 can be used directly in calculations, while a cell containing the text “00042” is primarily a character string. The latter is useful as a product code or ID where the leading zeros matter, but it is not a good substitute for a number you plan to add or average.

The function does not change the source cell. If A2 contains 1234.5, A2 remains numeric after a formula in B2 formats it. You can keep the original value for calculations and use the formatted result in a heading, report label, or exported text.

Basic syntax and how format codes work

The function has two arguments: the value to format and a format code enclosed in straight double quotation marks. The value can be a cell reference or a number; the format code tells Excel how to display it. A formula needs to begin with an equals sign, and arguments are separated by commas in the examples here.

For example, with the number 7.5 in A2, =TEXT(A2,"0.00") returns the text “7.50”. The zero placeholders require digits to appear, while the decimal point and two zeroes request two digits after it. If the number has fewer decimal places, Excel supplies zeroes; if it has more, Excel rounds the displayed result.

Common format-code symbols include:

  • 0 displays a required digit, including a zero when needed.
  • # displays a digit when one exists but does not force an extra zero.
  • . marks the decimal position in a format pattern.
  • , can group thousands or scale a number, depending on its position.
  • % displays a value as a percentage, multiplying its displayed value by 100.
  • m, d, y, h, and s represent date or time parts in date/time formats.

Excel’s displayed separators and some date names can depend on the computer’s regional settings. A comma in a format code generally requests digit grouping, but the character that appears as the grouping or decimal separator may reflect the locale. If a workbook is shared across regions, check the displayed result on the intended system.

Useful number formats with examples

With a value in A2, change the format string to suit the result you need. These examples assume the stated cell contents and typical US English display conventions:

  • With 1234.5 in A2, =TEXT(A2,"#,##0.00") returns “1,234.50”. It groups thousands and shows two decimal places.
  • With 0.256 in A2, =TEXT(A2,"0.0%") returns “25.6%”. Excel formats the decimal fraction as a percentage; do not multiply the input by 100 first unless that is what the data requires.
  • With 42 in A2, =TEXT(A2,"00000") returns “00042”. This is handy for a fixed-width identifier, not for an amount that must remain numeric.
  • With the actual Excel date November 3, 2026 in A2, =TEXT(A2,"mmm d, yyyy") returns “Nov 3, 2026” in an English-language setting. The source must be a real Excel date value, not merely text that resembles a date.
  • With 12.5 in A2, =TEXT(A2,"0.00 "units"") returns “12.50 units”. Quoted text in the format pattern adds a literal label.

In those examples, each formula is intended for a separate output cell, while A2 holds the specified source value. A date’s display language and punctuation may vary with regional settings. The pattern controls the requested style, but Excel interprets dates using the date value stored in the cell.

Combine formatted numbers with labels

A common reason to use TEXT is to place a formatted result inside a sentence or label. When you join a number directly to text with the ampersand operator, Excel may show the number without the desired currency, percentage, or decimal layout. Format the number first, then join the text.

With 1234.5 in A2, ="Total: "&TEXT(A2,"$#,##0.00") returns “Total: $1,234.50” in typical US English settings. The text label and the formatted number become one text value. This is useful for a dashboard caption or a sentence in a report, but the combined result is not suitable for a numeric total.

If you are joining multiple values, decide which parts need formatting and which should remain as ordinary text. For example, a date used in a sentence can be formatted as a month name rather than left as its underlying serial number. Keep source values in separate cells where possible; that makes later recalculation and editing much easier than storing the whole sentence as a manually typed string.

TEXT versus formatting a cell

Use the TEXT function when the formatted number must become part of a text result. Use ordinary cell formatting when you only want a numeric cell to look different. This is the key choice: cell formatting changes appearance while preserving the number, whereas TEXT returns a text value.

For instance, if a sales amount must still be summed, averaged, sorted numerically, or used in a chart, leave it as a number and apply a currency or decimal format to the cell. In Excel for Microsoft 365 on Windows, select the cells and choose a suitable option on Home > Number, or open the Format Cells dialog with Ctrl+1. On Mac, use Command+1 to open Format Cells; ribbon labels can vary slightly by release.

By contrast, formatting with TEXT is appropriate for a display string such as “Revenue: $1,234.50” or for a code whose leading zeroes must be preserved as characters. One practical layout is to keep raw numeric values in one column and display strings in another. That way, formulas can calculate from the raw data while a report uses the presentation-friendly text.

Common problems and how to fix them

  • The result cannot be added as expected. The output of TEXT is text. Use the original numeric cells for arithmetic rather than trying to total the formatted strings. Reformat the source cells if the goal is only visual styling.
  • A percentage is 2,560% instead of 25.6%. A percentage format scales a decimal by 100 for display. Check whether the source is 0.256 or 25.6; the appropriate display depends on which value is actually stored.
  • The formula displays as text or does not calculate. Check that the cell is not formatted as Text, that the formula begins with =, and that calculation is enabled. If the formula was entered into a Text-formatted cell, change the cell to General, then re-enter the formula.
  • The result shows a different separator or date language. Regional settings affect number and date presentation. Confirm the workbook’s intended locale and use a date value rather than a text date where possible.
  • Leading zeros disappear elsewhere. A numeric value does not retain leading zeros as part of its value. Use a custom cell format if it only needs to display with zeros while staying numeric; use TEXT if the output is deliberately a text code.
  • The format string is not accepted. Check its quotation marks and number-format symbols. In a formula, the format pattern itself must be inside straight double quotes, and any literal words within the pattern generally need their own quotation marks.

Also remember that the formula’s output can change when its source changes. That is usually helpful for a live report, but it means a text label may update after a recalculation. If a value must be frozen for a final record, preserve it using an appropriate copy-and-paste-values workflow and retain the original workbook data where needed.

Alternatives and version considerations

If the goal is only to show a fixed number of digits or a currency symbol, a custom number format is often the simplest alternative because it leaves the cell numeric. If the goal is to place the formatted value inside a sentence, TEXT is a direct and readable option. If the output needs to be converted back to a number later, reconsider whether converting it to text in the first place is necessary; text-to-number conversion can depend on regional separators and may require cleanup.

TEXT is available in modern Excel versions, including Excel for Microsoft 365 on Windows, Mac, and the web. The function itself is not a newer dynamic-array feature. Formatting behavior can still differ in appearance when regional settings or language settings differ. Excel for the web may present a different ribbon layout from the desktop app, but the function can be entered in a worksheet cell in the same general way.

For identifiers such as ZIP codes or account codes, consider whether the values should be stored as text from the start. That avoids accidental loss of leading zeros during import or data entry. For quantities, dates, and currency amounts intended for calculation, retain actual numeric or date values and use cell formatting unless you specifically need a text string.

Frequently Asked Questions

What is the formula to convert a number to text in Excel?

Use TEXT(value, format_text) as the function pattern within a worksheet formula, beginning with an equals sign. Supply a cell or value and a quoted number-format pattern. The result is text formatted according to that pattern.

Does TEXT change the original number?

No. It returns a formatted text result in the cell containing the formula; the source value remains unchanged. The output itself is text, so use the original number for calculations.

How do I add leading zeros to a number?

Use a pattern with required zero placeholders, such as five zeroes for a five-character result. This produces text with leading zeros. If you only need the number to display with leading zeros while remaining numeric, apply a custom number format to the cell instead.

Can I use TEXT to format a date?

Yes. A valid Excel date is stored as a number, and a date pattern can return it as readable text, such as a month abbreviation followed by a day and year. If the source is text rather than a real date, first make sure Excel can interpret it correctly.

Why does Excel add a percent sign and change the value?

A percentage format displays a decimal fraction multiplied by 100. A stored value of 0.25 therefore appears as 25% with a whole-number percentage pattern. Check the actual stored value before choosing a percentage pattern.

Related

Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.

More in Formulas & functions

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.