
Excel TEXT Function: Format Dates, Times, and Numbers (Practical Examples)
What changes the impression of a report is not the calculation but the display. Use TEXT() to turn dates, times, and numbers into readable strings for tables and dashboards that attract attention.
TEXT Syntax and Key Concepts
=TEXT(value, "format_code")
- It always returns text → Use the original value for calculations and TEXT for display only.
- Enclose format codes in quotation marks. To include fixed text, enclose it in quotation marks, such as
"Shipping date: ", or escape it with. - Dates and times are number-based serial values, so they must be valid dates and times to display as expected.
Date Format Codes (Year, Month, Day, Weekday)
| Code | Meaning | Example (2025-08-11) |
|---|---|---|
| yyyy | Four-digit year | 2025 |
| yy | Two-digit year | 25 |
| m / mm / mmm / mmmm | Month (number/two digits/abbreviation/full name) | 8 / 08 / Aug / August |
| d / dd | Day (number/two digits) | 11 / 11 |
| ddd / dddd | Weekday abbreviation/full name | Mon / Monday |
=TEXT(A2, "yyyy-mm-dd")
Time Format Codes (Hour, Minute, Second)
| Code | Meaning | Example (13:07:05) |
|---|---|---|
| h / hh | Hour (0–23) | 13 / 13 |
| m / mm | Minutes (in a time context) | 7 / 07 |
| s / ss | Seconds | 5 / 05 |
| AM/PM | AM/PM notation | 1:07 PM |
Important The m pitfall: In a date context, m means “month”; in a time context, it means “minute.” To display minutes, place it next to h, as in h:mm.
=TEXT(A2, "yyyy-mm-dd h:mm")
Numbers, Currency, Percentages, and Negative Number Colors
| Code | Description | Example |
|---|---|---|
| #,##0 | Thousands separator | 12,345 |
| #,##0.00 | Two decimal places | 12,345.67 |
| ₩#,##0 | Korean won | ₩12,345 |
| 0% | Percentage | 15% |
| [Red]-#,##0 | Negative numbers in red | -1,200 (red) |
=TEXT(B2, "₩#,##0")
Force a Locale for English Month and Weekday Names
Use a locale tag to ensure the display stays the same even when the file locale changes.
=TEXT(A2, "[$-en-US]mmm d, yyyy") // Aug 11, 2025
=TEXT(A2, "[$-ko-KR]yyyy"년" m"월" d"일" (ddd)")
Combine Sentences and Labels (TEXTJOIN)
=TEXTJOIN(" · ", TRUE,
TEXT(A2,"yyyy-mm-dd"),
TEXT(B2,"h:mm"),
TEXT(C2,"#,##0") & " pcs")
Create report card text all at once and use it in card or tag interfaces.
Common Mistakes and Solutions
- Cannot calculate a total → Because TEXT returns text, calculate totals and averages from the original numbers.
- Misunderstanding m → Use clear context:
h:mmfor minutes andyyyy-mmfor months. - Quotation marks and special characters → Enclose fixed text in quotation marks or escape it with
. - Performance → For large-scale concatenation, use
TEXTJOINandLETto minimize repeated calculations.
Summary
| Key Point | Checklist |
|---|---|
| Use TEXT for display and source values for calculations | Do not use TEXT results in numeric operations |
| m (month/minute) context | Next to h = minutes; next to y/d = months |
| Reuse format codes | Document frequently used patterns at the top of the worksheet |
FAQ
How can I change month names to Korean or English?
Use locale tags: Add [$-ko-KR] or [$-en-US] before the format code.
How can I display a value like “August 11, 2025 (Monday) 1:07 PM” in a report?
=TEXT(A2,"yyyy"년" m"월" d"일" (ddd) a/p h:mm")