---
title: "TEXT function in Excel: syntax and examples | PracticeExcel"
description: "How to use TEXT in Excel and Google Sheets: format numbers and dates as text with format codes."
canonical_url: "https://practiceexcelonline.com/functions/text"
locale: en
meta:
  "og:description": "How to use TEXT in Excel and Google Sheets: format numbers and dates as text with format codes."
  "og:image": "https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~VEVYVCBmdW5jdGlvbiBpbiBFeGNlbDogc3ludGF4IGFuZCBleGFtcGxlcw%2Cdescription_~SG93IHRvIHVzZSBURVhUIGluIEV4Y2VsIGFuZCBHb29nbGUgU2hlZXRzOiBmb3JtYXQgbnVtYmVycyBhbmQgZGF0ZXMgYXMgdGV4dCB3aXRoIGZvcm1hdCBjb2Rlcy4%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~VEVYVCh2YWx1ZSwgZm9ybWF0X3RleHQp%2Cp_Ii9mdW5jdGlvbnMvdGV4dCI%2Cs_AJqCXsLKdg_rQ4ig.png"
  "og:image:height": "600"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "TEXT function in Excel: syntax and examples | PracticeExcel"
  "twitter:image": "https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~VEVYVCBmdW5jdGlvbiBpbiBFeGNlbDogc3ludGF4IGFuZCBleGFtcGxlcw%2Cdescription_~SG93IHRvIHVzZSBURVhUIGluIEV4Y2VsIGFuZCBHb29nbGUgU2hlZXRzOiBmb3JtYXQgbnVtYmVycyBhbmQgZGF0ZXMgYXMgdGV4dCB3aXRoIGZvcm1hdCBjb2Rlcy4%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~VEVYVCh2YWx1ZSwgZm9ybWF0X3RleHQp%2Cp_Ii9mdW5jdGlvbnMvdGV4dCI%2Cs_AJqCXsLKdg_rQ4ig.png"
---

> Index of every page on this site: [llms.txt](https://practiceexcelonline.com/llms.txt)

# **The TEXT function**

Formats a number as text with a number format code, for example to put it inside a sentence.

=

TEXT(

## **Syntax**

```
TEXT(value, format_text)
```

<dl><dt>**value **</dt>
<dd>The number or date to format.</dd>
<dt>**format_text **</dt>
<dd>A format code in quotes, such as "0%", "00000" or "dd-mm-yyyy".</dd></dl>

## **Examples**

B1`=TEXT(<sup>1</sup>0.25,<sup>2</sup>"0%")`

|  | A | B |
| --- | --- | --- |
| 1 |  | **25%** |

**In plain words:** Show <sup>1</sup>0.25 <sup>2</sup>as a percentage with no decimals.

B1=TEXT(42,"00000")

|  | A | B |
| --- | --- | --- |
| 1 |  | **00042** |

B1=TEXT(1234.5,"#,##0.00")

|  | A | B |
| --- | --- | --- |
| 1 |  | **1,234.50** |

B1=TEXT(DATE(2024,3,5),"dd-mm-yyyy")

|  | A | B |
| --- | --- | --- |
| 1 |  | **05-03-2024** |

## **Read the guide**

- [**Dates in Excel: how they work and the formulas you need**](https://practiceexcelonline.com/learn/excel-dates)
- [**How to merge cells in Excel, and what to use instead**](https://practiceexcelonline.com/learn/merge-cells-excel)
- [**How to make a graph in Excel: column, line and pie charts step by step**](https://practiceexcelonline.com/learn/excel-charts)

## **Questions**

<details>

<summary>

### Why does TEXT give a different result in Danish Excel?

</summary>

Format codes follow the language of Excel. Danish Excel swaps the thousands and decimal separators and uses å for year, so "dd-mm-yyyy" is written "dd-mm-åååå".

</details>

## **Related functions**

- [**CONCAT**](https://practiceexcelonline.com/functions/concat)
- [**TEXTJOIN**](https://practiceexcelonline.com/functions/textjoin)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://practiceexcelonline.com/#identity","@type":"Organization","name":"PracticeExcel","url":"https://practiceexcelonline.com/","logo":{"@id":"https://practiceexcelonline.com/#logo"}},{"@id":"https://practiceexcelonline.com/#website","@type":"WebSite","inLanguage":"en-US","name":"PracticeExcel","url":"https://practiceexcelonline.com/","alternateName":["Practice Excel Online","PracticeExcelOnline.com"],"publisher":{"@id":"https://practiceexcelonline.com/#identity"},"workTranslation":{"@id":"https://excelopgaver.dk/#website"}},{"@id":"https://practiceexcelonline.com/functions/text#webpage","description":"How to use TEXT in Excel and Google Sheets: format numbers and dates as text with format codes.","name":"TEXT function in Excel: syntax and examples","url":"https://practiceexcelonline.com/functions/text","@type":["WebPage","FAQPage"],"breadcrumb":{"@id":"https://practiceexcelonline.com/functions/text#breadcrumb"},"isPartOf":{"@id":"https://practiceexcelonline.com/#website"},"mainEntity":[{"@id":"https://practiceexcelonline.com/functions/text#/schema/question/1"}],"potentialAction":[{"@type":"ReadAction","target":["https://practiceexcelonline.com/functions/text"]}],"primaryImageOfPage":{"@id":"https://practiceexcelonline.com/#logo"}},{"@id":"https://practiceexcelonline.com/functions/text#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://practiceexcelonline.com","position":1},{"@type":"ListItem","name":"Excel functions","item":"https://practiceexcelonline.com/functions","position":2},{"@type":"ListItem","name":"TEXT function in Excel: syntax and examples","position":3}]},{"@id":"https://practiceexcelonline.com/functions/text#article","description":"How to use TEXT in Excel and Google Sheets: format numbers and dates as text with format codes.","headline":"TEXT function in Excel: syntax and examples","inLanguage":"en-US","thumbnailUrl":"https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~VEVYVCBmdW5jdGlvbiBpbiBFeGNlbDogc3ludGF4IGFuZCBleGFtcGxlcw%2Cdescription_~SG93IHRvIHVzZSBURVhUIGluIEV4Y2VsIGFuZCBHb29nbGUgU2hlZXRzOiBmb3JtYXQgbnVtYmVycyBhbmQgZGF0ZXMgYXMgdGV4dCB3aXRoIGZvcm1hdCBjb2Rlcy4%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~VEVYVCh2YWx1ZSwgZm9ybWF0X3RleHQp%2Cp_Ii9mdW5jdGlvbnMvdGV4dCI%2Cs_AJqCXsLKdg_rQ4ig.png","@type":["Article","TechArticle"],"author":{"@id":"https://practiceexcelonline.com/#identity"},"image":{"@id":"https://practiceexcelonline.com/#/schema/image/1"},"isPartOf":{"@id":"https://practiceexcelonline.com/functions/text#webpage"},"mainEntityOfPage":{"@id":"https://practiceexcelonline.com/functions/text#webpage"},"publisher":{"@id":"https://practiceexcelonline.com/#identity"}},{"@id":"https://practiceexcelonline.com/functions/text#/schema/question/1","@type":"Question","inLanguage":"en-US","name":"Why does TEXT give a different result in Danish Excel?","acceptedAnswer":{"@type":"Answer","text":"Format codes follow the language of Excel. Danish Excel swaps the thousands and decimal separators and uses å for year, so \"dd-mm-yyyy\" is written \"dd-mm-åååå\"."}},{"@id":"https://practiceexcelonline.com/#logo","@type":"ImageObject","caption":"PracticeExcel","contentUrl":"https://practiceexcelonline.com/brand/practiceexcel/icon-512.png","inLanguage":"en-US","url":"https://practiceexcelonline.com/brand/practiceexcel/icon-512.png"},{"@id":"https://practiceexcelonline.com/#/schema/image/1","@type":"ImageObject","contentUrl":"https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~VEVYVCBmdW5jdGlvbiBpbiBFeGNlbDogc3ludGF4IGFuZCBleGFtcGxlcw%2Cdescription_~SG93IHRvIHVzZSBURVhUIGluIEV4Y2VsIGFuZCBHb29nbGUgU2hlZXRzOiBmb3JtYXQgbnVtYmVycyBhbmQgZGF0ZXMgYXMgdGV4dCB3aXRoIGZvcm1hdCBjb2Rlcy4%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~VEVYVCh2YWx1ZSwgZm9ybWF0X3RleHQp%2Cp_Ii9mdW5jdGlvbnMvdGV4dCI%2Cs_AJqCXsLKdg_rQ4ig.png","inLanguage":"en-US","url":"https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~VEVYVCBmdW5jdGlvbiBpbiBFeGNlbDogc3ludGF4IGFuZCBleGFtcGxlcw%2Cdescription_~SG93IHRvIHVzZSBURVhUIGluIEV4Y2VsIGFuZCBHb29nbGUgU2hlZXRzOiBmb3JtYXQgbnVtYmVycyBhbmQgZGF0ZXMgYXMgdGV4dCB3aXRoIGZvcm1hdCBjb2Rlcy4%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~VEVYVCh2YWx1ZSwgZm9ybWF0X3RleHQp%2Cp_Ii9mdW5jdGlvbnMvdGV4dCI%2Cs_AJqCXsLKdg_rQ4ig.png"}]}
```

## Sitemap

See the full [sitemap](https://practiceexcelonline.com/sitemap.md) for all pages.
