How to Use the TEXT Function in Excel

Office and email troubleshooting category image

The TEXT function converts a number, date, time, or percentage into formatted text. It is useful when you want a value to keep a specific display format inside a sentence or combined text formula.

Does this affect you?

Use this for Excel for Microsoft 365, Excel 2021, Excel 2019, Excel for Mac, and Excel Online when cell formatting disappears after a number or date is joined with words.

Format a value with TEXT

The structure is TEXT(value, format_code).

  1. Click the cell where the formatted text should appear.
  2. Type =TEXT(.
  3. Choose the value or cell reference.
  4. Add a comma and the format code in quotation marks.
  5. Close the formula and press Enter.
  6. Example: =TEXT(A1,”mm/dd/yyyy”).

To combine formatted text with words, use ampersands. For example, =”Report generated on “&TEXT(A1,”mmmm d, yyyy”) creates a readable sentence using the date in A1.

Common TEXT format codes

These are useful starting points.

  • “mm/dd/yyyy”: 06/10/2026
  • “mmmm d, yyyy”: June 10, 2026
  • “ddd, mmm d”: Wed, Jun 10
  • “h:mm AM/PM”: 3:45 PM
  • “0.00”: exactly two decimal places
  • “$#,##0.00”: currency with commas and cents
  • “0%”: decimal displayed as a percentage
  • “#,##0”: whole number with thousands separators

More control

Remember the result is text

A TEXT result looks formatted, but it is no longer a true number or date for math. Keep source numeric cells available for calculations.

Build dynamic labels

A formula such as =”Total due: “&TEXT(SUM(B2:B10),”$#,##0.00″)&” by “&TEXT(C1,”mmmm d”) combines live calculations and dates into one sentence.

Test custom formats first

Use Format Cells > Number > Custom to experiment with number-format codes, then copy the working code into the TEXT formula in quotes.

Sources

  • Microsoft Support – TEXT function (2025)
  • Microsoft Support – Number format codes (2025)
  • Microsoft Support – Combine text from two or more cells into one cell (2025)
Disclosure: This post may contain affiliate links which means I may receive a commission for purchases made through links. I will only recommend products that I have personally used! Learn more on my Private Policy page.
A thoughtful woman reads a newspaper while enjoying coffee at an indoor workspace.

DEALWEEK

SUBSCRIBE AND GET 20% OFF YOUR NEXT ORDER! OFFER ENDS SOON - DON’T MISS OUT!

We don’t spam! Read our privacy policy for more info.

Shopping Cart