Excel TEXT Function: Format Dates, Times, and Numbers (Practical Examples)

Excel TEXT Function: Format Dates, Times, and Numbers (Practical Examples)

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)

CodeMeaningExample (2025-08-11)
yyyyFour-digit year2025
yyTwo-digit year25
m / mm / mmm / mmmmMonth (number/two digits/abbreviation/full name)8 / 08 / Aug / August
d / ddDay (number/two digits)11 / 11
ddd / ddddWeekday abbreviation/full nameMon / Monday
=TEXT(A2, "yyyy-mm-dd")

Time Format Codes (Hour, Minute, Second)

CodeMeaningExample (13:07:05)
h / hhHour (0–23)13 / 13
m / mmMinutes (in a time context)7 / 07
s / ssSeconds5 / 05
AM/PMAM/PM notation1: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

CodeDescriptionExample
#,##0Thousands separator12,345
#,##0.00Two decimal places12,345.67
₩#,##0Korean won₩12,345
0%Percentage15%
[Red]-#,##0Negative 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:mm for minutes and yyyy-mm for months.
  • Quotation marks and special characters → Enclose fixed text in quotation marks or escape it with .
  • Performance → For large-scale concatenation, use TEXTJOIN and LET to minimize repeated calculations.

Summary

Key PointChecklist
Use TEXT for display and source values for calculationsDo not use TEXT results in numeric operations
m (month/minute) contextNext to h = minutes; next to y/d = months
Reuse format codesDocument 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")

Try formatting the date, time, and number columns in your worksheet with TEXT. Readable labels can improve click-through rates and persuasiveness.

Leave a Reply

Your email address will not be published. Required fields are marked *