
- Excel Functions - Home
- Compatibility Functions
- Compatibility Functions
- BETADIST Function
- BETAINV Function
- BINOMDIST Function
- CEILING Function
- CHIDIST Function
- CHIINV Function
- CHITEST Function
- CONFIDENCE Function
- COVAR Function
- CRITBINOM Function
- EXPONDIST Function
- FDIST Function
- FINV Function
- FLOOR Function
- FTEST Function
- GAMMADIST Function
- GAMMAINV Function
- HYPGEOMDIST Function
- LOGINV Function
- LOGNORMDIST Function
- MODE Function
- NEGBINOMDIST Function
- NORMDIST Function
- NORMINV Function
- NORMSDIST Function
- NORMSINV Function
- PERCENTILE Function
- PERCENTRANK Function
- POISSON Function
- QUARTILE Function
- RANK Function
- STDEV Function
- STDEVP Function
- TDIST Function
- TINV Function
- TTEST Function
- VAR Function
- VARP Function
- WEIBULL Function
- ZTEST Function
- Logical Functions
- Logical Functions
- AND Function
- FALSE Function
- IF Function
- IFERROR Function
- IFNA Function
- IFS Function
- NOT Function
- OR Function
- SWITCH Function
- TRUE Function
- XOR Function
- Text Functions
- Text Functions
- ARRAYTOTEXT Function
- BAHTTEXT Function
- CHAR Function
- CLEAN Function
- CODE Function
- CONCAT Function
- CONCATENATE Function
- DBCS Function
- DOLLAR Function
- Exact Function
- FIND Function
- FINDB Function
- FIXED Function
- LEFT Function
- LEFTB Function
- LEN Function
- LENB Function
- LOWER Function
- MID Function
- MIDB Function
- NUMBERVALUE Function
- PHONETIC Function
- PROPER Function
- REPLACE Function
- REPLACEB Function
- REPT Function
- RIGHT Function
- RIGHTB Function
- SEARCH Function
- SEARCHB Function
- SUBSTITUTE Function
- T Function
- TEXT Function
- TEXTAFTER Function
- TEXTBEFORE Function
- TEXTJOIN Function
- TEXTSPLIT Function
- TRIM Function
- UNICHAR Function
- UNICODE Function
- UPPER Function
- VALUE Function
- VALUETOTEXT Function
- Date & Time Functions
- Date & Time Functions
- DATE Function
- DATEDIF Function
- DATEVALUE Function
- DAY Function
- DAYS Function
- DAYS360 Function
- EDATE Function
- EOMONTH Function
- HOUR Function
- ISOWEEKNUM Function
- MINUTE Function
- MONTH Function
- NETWORKDAYS Function
- NETWORKDAYS.INTL Function
- NOW Function
- SECOND Function
- TIME Function
- TIMEVALUE Function
- TODAY Function
- WEEKDAY Function
- WEEKNUM Function
- WORKDAY Function
- WORKDAY.INTL Function
- YEAR Function
- YEARFRAC Function
- Cube Functions
- Cube Functions
- CUBEKPIMEMBER Function
- CUBEMEMBER Function
- CUBEMEMBERPROPERTY Function
- CUBERANKEDMEMBER Function
- CUBESET Function
- CUBESETCOUNT Function
- CUBEVALUE Function
- Math Functions
- Math Functions
- ABS Function
- AGGREGATE Function
- ARABIC Function
- BASE Function
- CEILING.MATH Function
- COMBIN Function
- COMBINA Function
- DECIMAL Function
- DEGREES Function
- EVEN Function
- EXP Function
- FACT Function
- FACTDOUBLE Function
- FLOOR.MATH Function
- GCD Function
- INT Function
- LCM Function
- LN Function
- LOG Function
- LOG10 Function
- MDETERM Function
- MINVERSE Function
- MMULT Function
- MOD Function
- MROUND Function
- MULTINOMIAL Function
- MUNIT Function
- ODD Function
- PI Function
- POWER Function
- PRODUCT Function
- QUOTIENT Function
- RADIANS Function
- RAND Function
- RANDBETWEEN Function
- ROMAN Function
- ROUND Function
- ROUNDDOWN Function
- ROUNDUP Function
- SERIESSUM Function
- SIGN Function
- SQRT Function
- SQRTPI Function
- SUBTOTAL Function
- SUM Function
- SUMIF Function
- SUMIFS Function
- SUMPRODUCT Function
- SUMSQ Function
- SUMX2MY2 Function
- SUMX2PY2 Function
- SUMXMY2 Function
- TRUNC Function
- Trigonometric Functions
- Trigonometric Functions
- ACOS
- ACOSH Function
- ACOT Function
- ACOTH Function
- ASIN Function
- ASINH Function
- ATAN Function
- ATAN2 Function
- ATANH Function
- COS Function
- COSH Function
- COT Function
- COTH Function
- CSC Function
- CSCH Function
- SEC Function
- SECH Function
- SIN Function
- SINH Function
- TAN Function
- TANH Function
- Database Functions
- Database Functions
- DAVERAGE
- DCOUNT
- DCOUNTA
- DGET
- DMAX
- DMIN
- DPRODUCT
- DSTDEV
- DSTDEVP
- DSUM
- DVAR
- DVARP
- Dynamic Array Functions
- Dynamic Array Functions
- FILTER Function
- RANDARRAY Function
- SEQUENCE Function
- SORT Function
- SORTBY Function
- UNIQUE Function
- XLOOKUP Function
- XMATCH Function
- Engineering Functions
- Engineering Functions
- BESSELI Function
- BESSELJ Function
- BESSELK Function
- BESSELY Function
- BIN2DEC Function
- BIN2HEX Function
- BIN2OCT Function
- BITAND Function
- BITLSHIFT Function
- BITOR Function
- BITRSHIFT Function
- BITXOR Function
- COMPLEX Function
- CONVERT Function
- DEC2BIN Function
- DEC2HEX Function
- DEC2OCT Function
- DELTA Function
- ERF Function
- ERF.PRECISE Function
- ERFC Function
- ERFC.PRECISE Function
- GESTEP Function
- HEX2BIN Function
- HEX2DEC Function
- HEX2OCT Function
- IMABS Function
- IMAGINARY Function
- IMARGUMENT Function
- IMCONJUGATE Function
- IMCOS Function
- IMCOSH Function
- IMCOT Function
- IMCSC Function
- IMCSCH Function
- IMDIV Function
- IMEXP Function
- IMLN Function
- IMLOG2 Function
- IMLOG10 Function
- IMPOWER Function
- IMPRODUCT Function
- IMREAL Function
- IMSEC Function
- IMSECH Function
- IMSIN Function
- IMSINH Function
- IMSQRT Function
- IMSUB Function
- IMSUM Function
- IMTAN Function
- OCT2BIN Function
- OCT2DEC Function
- OCT2HEX Function
- Financial Functions
- Financial Functions
- ACCRINT Function
- ACCRINTM Function
- AMORDEGRC Function
- AMORLINC Function
- COUPDAYBS Function
- COUPDAYS Function
- COUPDAYSNC Function
- COUPNCD Function
- COUPNUM Function
- COUPPCD Function
- CUMIPMT Function
- CUMPRINC Function
- DB Function
- DDB Function
- DISC Function
- DOLLARDE Function
- DOLLARFR Function
- DURATION Function
- EFFECT Function
- FV Function
- FVSCHEDULE Function
- INTRATE Function
- IPMT Function
- IRR Function
- ISPMT Function
- MDURATION Function
- MIRR Function
- NOMINAL Function
- NPER Function
- NPV Function
- ODDFPRICE Function
- ODDFYIELD Function
- ODDLPRICE Function
- ODDLYIELD Function
- PDURATION Function
- PMT Function
- PPMT Function
- PRICE Function
- PRICEDISC Function
- PRICEMAT Function
- PV Function
- RATE Function
- RECEIVED Function
- RRI Function
- SLN Function
- SYD Function
- TBILLEQ Function
- TBILLPRICE Function
- TBILLYIELD Function
- VDB Function
- XIRR Function
- XNPV Function
- YIELD Function
- YIELDDISC Function
- YIELDMAT Function
- Information Functions
- Information Functions
- CELL Function
- ERROR.TYPE Function
- INFO Function
- ISBLANK Function
- ISERR Function
- ISERROR Function
- ISEVEN Function
- ISFORMULA Function
- ISLOGICAL Function
- ISNA Function
- ISNONTEXT Function
- ISNUMBER Function
- ISODD Function
- ISREF Function
- ISTEXT Function
- N Function
- NA Function
- SHEET Function
- SHEETS Function
- TYPE Function
- Lookup & Reference Functions
- Lookup & Reference Functions
- ADDRESS Function
- AREAS Function
- CHOOSE Function
- COLUMN Function
- COLUMNS Function
- FORMULATEXT Function
- GETPIVOTDATA Function
- HLOOKUP Function
- HYPERLINK Function
- INDEX Function
- INDIRECT Function
- LOOKUP Function
- MATCH Function
- OFFSET Function
- ROW Function
- ROWS Function
- RTD Function
- TRANSPOSE Function
- VLOOKUP Function
- Statistical Functions
- Statistical Functions
- AVEDEV Function
- AVERAGE Function
- AVERAGEA Function
- AVERAGEIF Function
- AVERAGEIFS Function
- BETA.DIST Function
- BETA.INV Function
- BINOM.DIST Function
- BINOM.DIST.RANGE Function
- BINOM.INV Function
- CHISQ.DIST Function
- CHISQ.DIST.RT Function
- CHISQ.INV Function
- CHISQ.INV.RT Function
- CHISQ.TEST Function
- CONFIDENCE.NORM Function
- CONFIDENCE.T Function
- CORREL Function
- COUNT Function
- COUNTA Function
- COUNTBLANK Function
- COUNTIF Function
- COUNTIFS Function
- COVARIANCE.P Function
- COVARIANCE.S Function
- DEVSQ Function
- EXPON.DIST Function
- F.DIST Function
- F.DIST.RT Function
- F.INV Function
- F.INV.RT Function
- F.TEST Function
- FISHER Function
- FISHERINV Function
- FORECAST Function
- FORECAST.ETS Function
- FORECAST.ETS.CONFINT Function
- FORECAST.ETS.SEASONALITY Function
- FORECAST.ETS.STAT Function
- FORECAST.LINEAR Function
- FREQUENCY Function
- GAMMA Function
- GAMMA.DIST Function
- GAMMA.INV Function
- GAMMALN Function
- GAMMALN.PRECISE Function
- GAUSS Function
- GEOMEAN
- GROWTH
- HARMEAN
- HYPGEOM.DIST
- INTERCEPT Function
- KURT Function
- LARGE Function
- LINEST Function
- LOGEST Function
- LOGNORM.DIST Function
- LOGNORM.INV Function
- MAX Function
- MAXA Function
- MAXIFS Function
- MEDIAN Function
- MIN Function
- MINA Function
- MINIFS Function
- MODE.MULT Function
- MODE.SNGL Function
- NEGBINOM.DIST Function
- NORM.DIST Function
- NORM.INV Function
- NORM.S.DIST Function
- NORM.S.INV Function
- PEARSON Function
- PERCENTILE.EXC
- PERCENTILE.INC
- PERCENTRANK.EXC
- PERCENTRANK.INC
- PERMUT
- PERMUTATIONA
- PHI
- POISSON.DIST
- PROB
- QUARTILE.EXC
- QUARTILE.INC
- RANK.AVG
- RANK.EQ
- RSQ
- SKEW
- SKEW.P
- SLOPE
- SMALL
- STANDARDIZE
- STDEV.P
- STDEV.S
- STDEVA
- STDEVPA
- STEYX
- T.DIST
- T.DIST.2T
- T.DIST.RT
- T.INV
- T.INV.2T
- T.TEST
- TREND
- TRIMMEAN Function
- VAR.P Function
- VAR.S Function
- VARA Function
- VARPA Function
- WEIBULL.DIST Function
- Z.TEST Function
- Web Functions
- Web Functions
- ENCODEURL Function
- FILTERXML Function
- WEBSERVICE Function
Excel - TEXT Function
Description
The TEXT function converts a numeric value to text and lets you specify the display formatting by using special format strings.
This function is useful in situations where you want to display numbers in a more readable format, or you want to combine numbers with text or symbols.
Syntax
TEXT (value, format_text)
Arguments
Argument | Description | Required/ Optional |
---|---|---|
value | A numeric value, a formula that evaluates to a numeric value, or a reference to a cell containing a numeric value. | Required |
format_text |
A numeric format as a text string enclosed in quotation marks, for example "m/d/yyyy" or "#,##0.00". The following sections provide you with specific formatting guidelines. |
Required |
Guidelines for Number Formats
Display decimal places and significant digits − To format fractions or numbers that contain decimal points, include the following digit placeholders, decimal points, and thousand separators in the format_text argument.
Sr.No | Placeholder & Description |
---|---|
1 |
0 (zero) Displays insignificant zeros if a number has fewer digits than there are zeros in the format. |
2 |
# Follows the same rules as the 0 (zero). However, Excel does not display extra zeros when the number that you type has fewer digits on either side of the decimal than there are # symbols in the format. |
3 |
? Follows the same rules as the 0 (zero). However, Excel adds a space for insignificant zeros on either side of the decimal point so that decimal points are aligned in the column. |
4 |
. (period) Displays the decimal point in a number. |
Display a thousands separator − To display a comma as a thousands separator or to scale a number by a multiple of 1,000, include the following separator in the number format.
Sr.No | Placeholder & Description |
---|---|
5 |
, (comma) Displays the thousands separator in a number. Excel separates thousands by commas if the format contains a comma that is enclosed by number signs (#) or by zeros. A comma that follows a digit placeholder scales the number by 1,000. |
Guidelines for Date and Time Formats
Display days, months, and years − To display numbers as date formats (such as days, months, and years), use the following codes in the format_text argument.
m | Displays the month as a number without a leading zero. |
mm | Displays the month as a number with a leading zero when appropriate. |
mmm | Displays the month as an abbreviation (Jan to Dec). |
mmmm | Displays the month as a full name (January to December). |
mmmmm | Displays the month as a single letter (J to D). |
d | Displays the day as a number without a leading zero. |
dd | Displays the day as a number with a leading zero when appropriate. |
ddd | Displays the day as an abbreviation (Sun to Sat). |
dddd | Displays the day as a full name (Sunday to Saturday). |
yy | Displays the year as a two-digit number. |
yyyy | Displays the year as a four-digit number. |
Display hours, minutes, and seconds − To display time formats (such as hours, minutes, and seconds), use the following codes in the format_text argument.
h | Displays the hour as a number without a leading zero. |
[h] | Displays elapsed time in hours. If you are working with a formula that returns a time in which the number of hours exceeds 24, use a number format that resembles [h]:mm:ss. |
hh | Displays the hour as a number with a leading zero when appropriate. If the format contains AM or PM, the hour is shown based on the 12-hour clock. Otherwise, the hour is shown based on the 24-hour clock. |
h | Displays the hour as a number without a leading zero. |
m |
Displays the minute as a number without a leading zero. The m or the mm code must appear immediately after the h or hh code or immediately before the ss code; otherwise, Excel displays the month instead of minutes. |
[m] | Displays elapsed time in minutes. If you are working with a formula that returns a time in which the number of minutes exceeds 60, use a number format that resembles [mm]:ss. |
mm |
Displays the minute as a number with a leading zero when appropriate. The m or the mm code must appear immediately after the h or hh code or immediately before the ss code; otherwise, Excel displays the month instead of minutes. |
s | Displays the second as a number without a leading zero. |
[s] | Displays elapsed time in seconds. If you are working with a formula that returns a time in which the number of seconds exceeds 60, use a number format that resembles [ss]. |
ss | Displays the second as a number with a leading zero when appropriate. If you want to display fractions of a second, use a number format that resembles h:mm:ss.00 |
AM/PM, am/pm, A/P, a/p | Displays the hour based on a 12-hour clock. Excel displays AM, am, A, or a for times from midnight until noon and PM, pm, P, or p for times from noon until midnight. |
Guidelines for currency, percentages, and scientific notation format
Include currency symbols − To precede a number with a dollar sign ($), type the dollar sign at the beginning of the format_text argument (for example, "$#,##0.00"). To enter one of the following currency symbols in a number format, press NUM LOCK and use the numeric keypad to type the ANSI code for the symbol.
You must use the numeric keypad; using the ALT key with the number keys in the top row of the keyboard will not generate ANSI codes.
To enter | Use this key combination |
---|---|
ALT+0162 | |
ALT+0163 | |
ALT+0165 | |
ALT+0128 |
Display percentages − To display numbers as a percentage of 100, include the percent sign (%) in the format_text argument.
Display scientific notations − To display numbers in scientific (exponential) format, use the following exponent codes in the format_text argument.
E (E-, E+, e-, e+) | Displays a number in scientific (exponential) format. Excel displays a number to the right of the "E" or "e" that corresponds to the number of places that the decimal point was moved. |
Guidelines for including Text and adding Spacing
If you include any of the following characters in the format_text argument, they are displayed exactly as entered.
$ | Dollar sign |
+ | Plus sign |
( | Left parenthesis |
: | Colon |
^ | Circumflex accent (caret) |
' | Apostrophe |
{ | Left curly bracket |
< | Less-than sign |
= | Equal sign |
- | Minus sign |
/ | Slash mark |
) | Right parenthesis |
! | Exclamation point |
& | Ampersand |
~ | Tilde |
} | Right curly bracket |
> | Greater-than sign |
Space character |
The format_text argument cannot contain an asterisk (*)
Using the TEXT Function converts a numeric value to formatted text, and the result can no longer be calculated as a number
Notes
You can also format numbers by using the commands in the Number group on the Home tab of the Ribbon. However, these commands work only if the entire cell is numeric. If you want to format a number and combine it with other text, the TEXT Function is the best option.
If you omit the quotation marks from around the format_text argument, TEXT returns #NAME? error value.
Applicability
Excel 2007, Excel 2010, Excel 2013, Excel 2016
Example
