Excel Practice Test

โ–ถ

The TEXT function in Excel turns numbers, dates, and times into formatted text strings you actually want to read. Need to glue a date into a sentence without it showing as a serial number like 45678? TEXT solves that. Need a currency string inside a formula? Same answer. It's one of those small functions that quietly powers half the dashboards, mail merges, and reports in any office.

This guide walks through the full syntax, every important format code, the common errors people hit, and the practical patterns used in real spreadsheets. You'll see how to combine TEXT with CONCAT, how to format percentages without losing precision, and when to skip TEXT entirely and use cell formatting instead. By the end you'll handle any formatting headache that comes your way.

Whether you're prepping for an Excel skills test, a job interview, or just trying to stop your invoice template from showing "0.5" instead of "50%", the patterns below cover the cases you actually face. Excel 2016, 2019, 2021, 365, and Excel on the web all support TEXT with identical syntax, so nothing here is version-locked.

If you're new to Excel functions in general, TEXT is a friendlier starting point than VLOOKUP or INDEX/MATCH. It has only two arguments, and once you understand the format code syntax, the same patterns recur across thousands of practical uses. Beginners often skip it because the format codes look cryptic. That's a mistake — spending an hour with TEXT pays off for years.

TEXT Function At a Glance

2
Required arguments
30+
Format codes
1993
Year introduced
All
Excel versions support

What the TEXT Function Actually Does

At its core, TEXT(value, format_text) takes a number and returns it as a string formatted exactly the way you specify. The first argument is the value you want to format. The second argument is a format code wrapped in quotes that tells Excel how to display it.

Sounds simple. The catch is that the format codes use their own mini-language. "0" means a required digit. "#" means an optional digit. "dd-mmm-yyyy" spits out something like 15-Jan-2026. Get the codes right and you can format anything. Get them wrong and you'll see #VALUE errors or, worse, output that looks correct but is silently broken.

The output is always text. That matters. Once a number goes through TEXT, you can't sum it, average it, or use it in math without converting back with VALUE or a double-negative. Keep that in mind before you wrap every cell in TEXT — sometimes plain old number formatting (Ctrl+1) is the better answer.

=TEXT(value, format_text)

  • value — the number, date, or cell reference you want to format
  • format_text — the format code in double quotes (e.g. "$#,##0.00")

Result is always text. To use it as a number again, wrap in VALUE() or prefix with a double-negative: --TEXT(A1,"0"). Cell formatting (Ctrl+1) is usually faster when you only need display polish without combining values into strings.

The Format Codes You'll Actually Use

You don't need to memorize every code. Ninety percent of real-world TEXT usage falls into five buckets: numbers with decimals, currency, percentages, dates, and times. Master those and the rest is just variation. The two essentials for numeric codes are 0 and #. A "0" forces a digit to show, even if it's a leading or trailing zero.

A "#" only shows a digit if it's meaningful. So TEXT(5, "000") returns "005" while TEXT(5, "###") returns just "5". Add a comma as a thousands separator: "#,##0" turns 1234567 into "1,234,567". Add a decimal point and decimal placeholders: "#,##0.00" gives you "1,234,567.00" every time.

For currency, just stick a currency symbol in front: "$#,##0.00" for US dollars, "€#,##0.00" for euros, "£#,##0.00" for pounds. For negative numbers in parentheses (the accounting style), use a four-part format: "$#,##0.00;($#,##0.00)". The semicolons split positive, negative, zero, and text formats.

Percentages: the % sign multiplies the value by 100 and adds the symbol. TEXT(0.275, "0.0%") returns "27.5%". If your value is already a whole number like 27.5, divide by 100 first or use a different format. The single most common percentage mistake is forgetting Excel stores percentages as decimals internally.

Dates use d, m, y. Times use h, m, s. The trap is that "m" means month after a date code and minutes after an hour code. So "hh:mm" shows hours and minutes, but "mm:dd" shows month and day. Excel decides based on context. Common date codes: "mm/dd/yyyy" for US format, "dd/mm/yyyy" for European, "dddd, mmmm d, yyyy" for "Wednesday, January 15, 2026".

Format Code Categories

hash Numbers

0 = required digit, # = optional digit, , = thousands, . = decimal. Example format: #,##0.00 produces clean grouped numbers with two decimals.

dollar Currency

Prefix any symbol: $#,##0.00 for dollars, euro and pound symbols work the same. Add semicolon and parens for negative accounting style.

percent Percentages

% multiplies by 100 automatically. 0.0% turns 0.275 into 27.5%. Watch decimal vs whole number inputs to avoid 100x errors.

calendar Dates

d, m, y in lowercase. mmmm gives full month name, dddd gives full weekday name, yyyy gives four-digit year. Order them however you need.

clock Times

h, m, s for hours, minutes, seconds. Use [hh] in brackets for elapsed hours over 24. Add AM/PM to force 12-hour clock display.

type Text Mix

Wrap literal text inside format codes in escaped quotes or backslashes. Lets you build labels like Total: $1,234 inside a single format string.

Combining TEXT With Other Functions

TEXT really shines when you stitch formatted values into sentences or labels. The classic pattern uses & (the concatenation operator) or the CONCAT function. Say cell A1 holds 12500 and you want a sentence that reads "Total revenue: $12,500.00 for January."

Without TEXT, this goes wrong fast: ="Total revenue: "&A1&" for January" gives you "Total revenue: 12500 for January" — no formatting at all. Excel converts the number to a basic string. With TEXT: ="Total revenue: "&TEXT(A1,"$#,##0.00")&" for January" produces the polished output you wanted.

The same applies to dates. If A1 holds a date serial like 45678, ="Report dated "&A1 returns "Report dated 45678". Use ="Report dated "&TEXT(A1,"mmmm d, yyyy") instead and you get "Report dated January 15, 2025". This pattern is the single biggest practical use of TEXT in real spreadsheets — building human-readable strings from raw cell values.

TEXT also pairs well with IF for conditional formatting in text outputs. ="Status: "&IF(A1>0,TEXT(A1,"+0.0%"),TEXT(A1,"0.0%")) shows a plus sign for positive percentages and lets negatives display naturally. For nested logic across multiple ranges, an IF statement chain works alongside TEXT to handle each branch with its own format string.

TEXT Examples by Category

๐Ÿ“‹ Numbers

=TEXT(1234.567, "#,##0.00") returns 1,234.57 with thousands separator and rounded to two decimals.

=TEXT(0.5, "0.000") returns 0.500 with forced trailing zeros for fixed-width display.

=TEXT(5, "00000") returns 00005 with leading zeros — perfect for ID padding.

=TEXT(1234567, "#,##0,") returns 1,235 (in thousands). Each trailing comma divides by 1,000.

๐Ÿ“‹ Currency

=TEXT(1234.5, "$#,##0.00") returns $1,234.50 with grouping and decimals.

=TEXT(-50, "$#,##0.00;($#,##0.00)") returns ($50.00) for accounting-style negatives in parentheses.

=TEXT(1500, "€#,##0.00") returns €1,500.00 for euro formatting.

=TEXT(2500, "[$£-en-GB]#,##0.00") returns £2,500.00 with locale-specific pound symbol.

๐Ÿ“‹ Dates

=TEXT(TODAY(), "mm/dd/yyyy") returns 05/13/2026 in US date format.

=TEXT(TODAY(), "dddd") returns Wednesday — full weekday name only.

=TEXT(TODAY(), "mmm-yy") returns May-26, short month and 2-digit year.

=TEXT(TODAY(), "yyyy-mm-dd") returns 2026-05-13 in ISO format used by databases.

๐Ÿ“‹ Times

=TEXT(NOW(), "h:mm AM/PM") returns 3:45 PM with 12-hour clock and meridiem.

=TEXT(NOW(), "hh:mm:ss") returns 15:45:22 with zero-padded 24-hour military time.

=TEXT(B1-A1, "[h]:mm") returns 28:15 for elapsed time over 24 hours.

=TEXT(0.5, "h"h" m"m"") returns 12h 0m using embedded literal text.

๐Ÿ“‹ Percent

=TEXT(0.275, "0.0%") returns 27.5% with one decimal place.

=TEXT(0.05, "+0.0%;-0.0%") returns +5.0% with explicit plus sign for positives.

=TEXT(1.2, "0%") returns 120% — over 100% is allowed.

=TEXT(0.0001, "0.00%") returns 0.01% — tiny values need extra decimals.

Common Errors and How to Fix Them

TEXT is mostly forgiving but it has a few sharp edges. The error you'll see most often is #VALUE!, which usually means the format code is malformed. Forgot a closing quote? Used a character Excel doesn't recognize as a format token? You'll get #VALUE!. Double-check that the format_text argument is wrapped in quotes and that any literal characters inside it are escaped properly.

The second common issue isn't an error at all — it's silent wrongness. If you pass actual text into TEXT (instead of a number), Excel returns the text unchanged. TEXT("hello", "0.00") returns "hello", not an error. That can mask data quality problems, like when a column you assumed was numeric actually contains numbers stored as text from a CSV import. Run VALUE() on the input first if you need a guarantee that math-friendly numbers are coming through.

The third gotcha is locale. Format codes are localized in some non-English Excel installs. "mmm" might be "mmm" in English but the date letters can be translated in French or German installs and produce unexpected results. If a file works on your machine but breaks for an international colleague, locale is usually the culprit. The fix is using locale-prefixed format codes like "[$-en-US]mmm".

Last one: precision loss. TEXT rounds. TEXT(0.999, "0.0") returns "1.0", not "0.9". If you need to truncate without rounding, use TRUNC or FLOOR before passing to TEXT. This matters most for financial reports where rounding up a hundredth of a percent can shift conclusions.

TEXT vs. Cell Formatting: When to Use Which

This is the question nobody answers clearly online. Both approaches make 12500 look like "$12,500.00". So which one's right? The rule of thumb: use cell formatting whenever possible. Use TEXT only when you need a string.

Cell formatting (Ctrl+1 → Number tab) keeps the underlying value as a number. You can still SUM the cell, sort it numerically, and reference it in calculations. The formatting is purely visual. This is what 95% of real spreadsheets need. Pivot tables, charts, financial models — all should rely on cell formatting.

TEXT belongs in three specific scenarios. First, when you're concatenating formatted values into sentences, labels, or chart titles. Second, when you're exporting to a system that needs preformatted strings — sometimes APIs or downstream apps expect "01/15/2026" instead of a date serial. Third, when you need different formats in the same cell, like a label that combines a percentage and a count.

If you find yourself wrapping every value in TEXT just to make the spreadsheet look right, stop and switch to cell formatting. You'll save processing time, keep your data clean for math, and avoid the "why won't my SUMIF work?" headache that comes from accidentally summing text values. Cell formatting is also faster to apply: select the range, press Ctrl+1, pick a preset, done. TEXT requires a formula in a separate cell.

TEXT Function Checklist

Format_text argument is wrapped in double quotes
Decided whether TEXT or cell formatting fits the use case better
Used 0 for required digits, # for optional digits in number codes
Confirmed the value argument is a number, not text-stored-as-number
Used [h] format for elapsed time that exceeds 24 hours
Wrapped literal text inside format codes in escaped quotes or backslashes
Tested format with negative, zero, and edge values
Verified locale compatibility if sharing across regions
Considered TRUNC or FLOOR if you need truncation instead of rounding
Wrapped result in VALUE() if downstream math will use the output
Test Your Excel Skills

Advanced Patterns and Real-World Recipes

Once you've got the basics down, TEXT becomes a building block for surprisingly powerful patterns. Padding for sort order is one favorite. Mixed alphanumeric strings sort badly in Excel because "Item-2" comes after "Item-10". Pad the numeric portion with TEXT to fix it: ="Item-"&TEXT(A1,"000") produces "Item-002" and "Item-010" which sort correctly. Works the same for invoice numbers, employee IDs, and any other identifier where you need consistent width.

Dynamic chart titles are another classic. Chart titles can reference cells. Combine TEXT with date functions to get auto-updating titles: in a hidden cell, put ="Sales Report — "&TEXT(TODAY(),"mmmm yyyy"). Link the chart title to that cell. Every month the title refreshes itself with no manual edits. Same trick works for dashboard headers and report cover pages.

Excel format codes also support color names in brackets: "[Red]-0.0%;[Green]+0.0%". Combined with TEXT, you can build colored text outputs in concatenated strings, though the color only applies if the cell's number format is read — not when wrapped in TEXT for concatenation. For colored TEXT-derived strings in concatenated outputs, you need conditional formatting rules applied to the destination cell instead.

For localized currency in international reports, the bracket notation [$-locale] forces Excel to render currency for a specific region regardless of the user's system locale. TEXT(1500,"[$€-fr-FR]#,##0.00") produces French-style euro formatting. Combine multiple regions in one report by varying the locale per row — useful for consolidated multi-country financial statements.

Phone number formatting is another underused trick. For a 10-digit US phone stored as a number: TEXT(A1,"(###) ###-####") outputs "(415) 555-1234". International formats follow the same pattern with different digit counts. This is how mail merge templates and CRM exports get clean phone displays from raw numeric data without manual reformatting.

TEXT Function Pros and Cons

Pros

  • Works in every Excel version including web and mobile
  • Handles numbers, dates, times, percentages, and currencies
  • Pairs perfectly with concatenation for labels and reports
  • Format codes are flexible enough for nearly any display need
  • Doesn't modify the original cell value, only creates a new string

Cons

  • Output is text, so math functions won't work on the result
  • Format codes use their own syntax that takes time to learn
  • Silently returns text unchanged if you pass non-numeric input
  • Locale differences can cause cross-country compatibility issues
  • Always rounds — no built-in truncation option

Tips for Excel Tests and Interviews

If you're prepping for an Excel skills assessment, TEXT shows up in a few predictable ways. Expect at least one question about format codes — usually decoding what something like "#,##0;(#,##0);"-"" produces for different inputs. The answer: thousands-separated positives, negatives in parens, dash for zero.

Another classic is the date-in-sentence question. You'll see a cell with a date, and the task is to write a formula that builds a sentence including that date in "Month Day, Year" format. Always reach for "mmmm d, yyyy". Don't use "mm" (that gives the month number) and don't use "MM" (Excel doesn't care about case for d/m/y so "MM" just means month again).

Interviewers sometimes ask the difference between TEXT and cell formatting — covered above. Have the answer ready: cell formatting preserves the number, TEXT returns a string. Use the second only when you need to combine with other text.

The trickiest test question I've seen: "Why does TEXT(A1, "0.00") return zero when A1 contains 0.0049?" Answer: rounding. Two decimal places aren't enough to preserve four-decimal precision, so 0.0049 rounds to 0.00. If you need to keep small values visible, use more decimals or scientific notation: "0.00E+00". Knowing this rounding behavior is the kind of detail that separates someone who memorized syntax from someone who actually uses Excel.

EXCEL Questions and Answers

What does the TEXT function do in Excel?

The TEXT function converts a number, date, or time into a formatted text string. You pass the value and a format code, and Excel returns the value as text formatted to your specification, useful for combining numbers with words, building report labels, or exporting preformatted strings.

What are the two arguments of TEXT?

TEXT takes value (the number or cell reference to format) and format_text (the format code in double quotes that tells Excel how to display it). Example: =TEXT(A1, "$#,##0.00") formats the contents of A1 as US currency with two decimals.

Why does TEXT return a VALUE error?

Usually the format_text argument is malformed: a missing closing quote, an unrecognized character, or improperly escaped literal text. Double-check the format string is wrapped in quotes and that any literal characters inside use backslash or quoted-string escaping.

Can I use TEXT output in calculations?

Not directly. TEXT returns a string, so SUM and AVERAGE will skip it. Wrap the result in VALUE() or prefix with a double-negative to convert back to a number for math operations. Or, better, keep the original number in another cell.

What is the difference between 0 and hash in TEXT format codes?

Zero forces a digit to display even if it is a leading or trailing zero. Hash only displays a digit if it is meaningful. TEXT(5, three zeros) returns 005 while TEXT(5, three hashes) returns just 5. Use 0 for fixed-width output, hash for natural display.

How do I format a date with TEXT?

Use d, m, y codes inside quotes. Common patterns include mm/dd/yyyy for US format, dd/mm/yyyy for European, and dddd, mmmm d, yyyy for full names like Wednesday, January 15, 2026. Use lowercase consistently because Excel ignores case for date codes.

Should I use TEXT or cell formatting?

Use cell formatting (Ctrl+1) when you just want a number to display differently while keeping it usable in calculations. Use TEXT only when you need an actual text string for concatenation, exports, or labels that mix formatted values with other text.

How do I show elapsed time over 24 hours?

Wrap the hour code in brackets: [h]:mm displays 28:15 instead of resetting at 24. Without the brackets, Excel treats hours modulo 24, which is wrong for durations like total work hours across multiple days.

Why does TEXT change my decimal places?

TEXT rounds to the precision specified in the format code. Two decimals round to 0.01, four to 0.0001. If 0.0049 looks like 0.00, your format only allows two decimals. Add more, switch to scientific notation, or use cell formatting which does not lose precision.
Practice Excel Functions

Putting It All Together

The TEXT function isn't glamorous, but it's one of the small bricks that makes a polished Excel workbook actually look polished. Once you internalize the two-argument syntax and the handful of format codes that cover real-world cases — #,##0.00 for numbers, $#,##0.00 for currency, 0.0% for percentages, mmmm d, yyyy for dates — you'll reach for it instinctively whenever you need to weave numbers into text.

The most important habit is choosing the right tool for the job. Cell formatting wins when you just want display polish on numeric values. TEXT wins when you're building strings — report titles, mail merge fields, dynamic chart labels, exported CSV columns that need preformatted output. Don't wrap everything in TEXT and don't avoid it out of habit. The decision takes two seconds once you've done it a few times.

If you're studying for an Excel certification, drill the format codes until you can read them at a glance. The codes are the only piece of TEXT that takes real practice. Everything else is just syntax. Once the codes feel natural, the function becomes a reliable workhorse that solves problems other functions can't touch.

Good luck with your spreadsheets — TEXT will be there waiting whenever you need a number to read like words. Practice with the questions linked above to lock in the format code patterns, and you'll find yourself reaching for TEXT in situations where you used to reach for clunky workarounds.

One last note for spreadsheet hobbyists: TEXT shows up in Power Query, Power BI DAX, and Google Sheets with nearly identical syntax. The format codes you learn here transfer directly to those tools. That makes TEXT one of the highest-leverage Excel skills you can pick up. An hour invested now pays back across a dozen related platforms over the years. Build small practice sheets that exercise each format code category and the muscle memory sticks.

โ–ถ Start Quiz