---
title: "RIGHT function in Excel: syntax and examples | PracticeExcel"
description: "How to use RIGHT in Excel and Google Sheets: take the last characters of a code or ID."
canonical_url: "https://practiceexcelonline.com/functions/right"
locale: en
meta:
  "og:description": "How to use RIGHT in Excel and Google Sheets: take the last characters of a code or ID."
  "og:image": "https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~UklHSFQgZnVuY3Rpb24gaW4gRXhjZWw6IHN5bnRheCBhbmQgZXhhbXBsZXM%2Cdescription_~SG93IHRvIHVzZSBSSUdIVCBpbiBFeGNlbCBhbmQgR29vZ2xlIFNoZWV0czogdGFrZSB0aGUgbGFzdCBjaGFyYWN0ZXJzIG9mIGEgY29kZSBvciBJRC4%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~UklHSFQodGV4dCwgW251bV9jaGFyc10p%2Cp_Ii9mdW5jdGlvbnMvcmlnaHQi%2Cs_mHw9NUHhTRcncjV5.png"
  "og:image:height": "600"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "RIGHT function in Excel: syntax and examples | PracticeExcel"
  "twitter:image": "https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~UklHSFQgZnVuY3Rpb24gaW4gRXhjZWw6IHN5bnRheCBhbmQgZXhhbXBsZXM%2Cdescription_~SG93IHRvIHVzZSBSSUdIVCBpbiBFeGNlbCBhbmQgR29vZ2xlIFNoZWV0czogdGFrZSB0aGUgbGFzdCBjaGFyYWN0ZXJzIG9mIGEgY29kZSBvciBJRC4%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~UklHSFQodGV4dCwgW251bV9jaGFyc10p%2Cp_Ii9mdW5jdGlvbnMvcmlnaHQi%2Cs_mHw9NUHhTRcncjV5.png"
---

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

# **The RIGHT function**

Returns the last characters of a text. The result is text, even when it looks like a number.

=

RIGHT(

## **Syntax**

```
RIGHT(text, [num_chars])
```

<dl><dt>**text **</dt>
<dd>The text to take characters from.</dd>
<dt>**num_chars **(optional)</dt>
<dd>How many characters to return. Default 1.</dd></dl>

## **Examples**

C1`=RIGHT(<sup>1</sup>A2,<sup>2</sup>4)`

|  | A | B | C |
| --- | --- | --- | --- |
| 1 | Code |  | **2100** |
| 2 | DK-2100 |  | |

**In plain words:** Take <sup>2</sup>the last 4 characters of <sup>1</sup>the code in A2.

C1=RIGHT(A2)

|  | A | B | C |
| --- | --- | --- | --- |
| 1 | Code |  | **0** |
| 2 | DK-2100 |  | |

## **Practice RIGHT**

- [**1****Drop a prefix with RIGHT and LEN**→](https://practiceexcelonline.com/practice/left-right-mid/right-len-remove-prefix)

## **Read the guide**

- [**How to clean data in Excel with formulas**](https://practiceexcelonline.com/learn/clean-data-in-excel)

## **Related functions**

- [**LEFT**](https://practiceexcelonline.com/functions/left)
- [**MID**](https://practiceexcelonline.com/functions/mid)
- [**FIND**](https://practiceexcelonline.com/functions/find)

```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/right#webpage","@type":"WebPage","description":"How to use RIGHT in Excel and Google Sheets: take the last characters of a code or ID.","name":"RIGHT function in Excel: syntax and examples","url":"https://practiceexcelonline.com/functions/right","breadcrumb":{"@id":"https://practiceexcelonline.com/functions/right#breadcrumb"},"isPartOf":{"@id":"https://practiceexcelonline.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://practiceexcelonline.com/functions/right"]}],"primaryImageOfPage":{"@id":"https://practiceexcelonline.com/#logo"}},{"@id":"https://practiceexcelonline.com/functions/right#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":"RIGHT function in Excel: syntax and examples","position":3}]},{"@id":"https://practiceexcelonline.com/functions/right#article","description":"How to use RIGHT in Excel and Google Sheets: take the last characters of a code or ID.","headline":"RIGHT function in Excel: syntax and examples","inLanguage":"en-US","thumbnailUrl":"https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~UklHSFQgZnVuY3Rpb24gaW4gRXhjZWw6IHN5bnRheCBhbmQgZXhhbXBsZXM%2Cdescription_~SG93IHRvIHVzZSBSSUdIVCBpbiBFeGNlbCBhbmQgR29vZ2xlIFNoZWV0czogdGFrZSB0aGUgbGFzdCBjaGFyYWN0ZXJzIG9mIGEgY29kZSBvciBJRC4%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~UklHSFQodGV4dCwgW251bV9jaGFyc10p%2Cp_Ii9mdW5jdGlvbnMvcmlnaHQi%2Cs_mHw9NUHhTRcncjV5.png","@type":["Article","TechArticle"],"author":{"@id":"https://practiceexcelonline.com/#identity"},"image":{"@id":"https://practiceexcelonline.com/#/schema/image/1"},"isPartOf":{"@id":"https://practiceexcelonline.com/functions/right#webpage"},"mainEntityOfPage":{"@id":"https://practiceexcelonline.com/functions/right#webpage"},"publisher":{"@id":"https://practiceexcelonline.com/#identity"}},{"@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_~UklHSFQgZnVuY3Rpb24gaW4gRXhjZWw6IHN5bnRheCBhbmQgZXhhbXBsZXM%2Cdescription_~SG93IHRvIHVzZSBSSUdIVCBpbiBFeGNlbCBhbmQgR29vZ2xlIFNoZWV0czogdGFrZSB0aGUgbGFzdCBjaGFyYWN0ZXJzIG9mIGEgY29kZSBvciBJRC4%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~UklHSFQodGV4dCwgW251bV9jaGFyc10p%2Cp_Ii9mdW5jdGlvbnMvcmlnaHQi%2Cs_mHw9NUHhTRcncjV5.png","inLanguage":"en-US","url":"https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~UklHSFQgZnVuY3Rpb24gaW4gRXhjZWw6IHN5bnRheCBhbmQgZXhhbXBsZXM%2Cdescription_~SG93IHRvIHVzZSBSSUdIVCBpbiBFeGNlbCBhbmQgR29vZ2xlIFNoZWV0czogdGFrZSB0aGUgbGFzdCBjaGFyYWN0ZXJzIG9mIGEgY29kZSBvciBJRC4%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~UklHSFQodGV4dCwgW251bV9jaGFyc10p%2Cp_Ii9mdW5jdGlvbnMvcmlnaHQi%2Cs_mHw9NUHhTRcncjV5.png"}]}
```

## Sitemap

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