# RIGHT formula generator

> Describe what you need and get a RIGHT formula for Excel and Google Sheets, run on real data before you copy it. Plus 8 tested RIGHT examples.

Source: https://spreadsheetpractice.com/tools/formula-generator/right · Updated October 29, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on November 20, 2026

RIGHT returns a set number of characters from the end of a text string.

Describe the task at [RIGHT formula generator](https://spreadsheetpractice.com/tools/formula-generator/right) and get a RIGHT formula for Excel and Google Sheets, tested on real data.

## Tested RIGHT examples

### Extract the last N characters from a cell

`=RIGHT(A2,$E$1)`

Excel. Result on the sample sheet: 5 rows (B2:B6). [See it and try it](https://spreadsheetpractice.com/formulas/extract-last-n-characters)

### Create an ID with a prefix and leading zeros

`=$E$1&TEXT(A2,"00000")`

Excel. Result on the sample sheet: 5 rows (B2:B6). [See it and try it](https://spreadsheetpractice.com/formulas/create-id-with-prefix-and-leading-zeros)

### Check if a cell ends with specific text

`=RIGHT(A2,LEN($E$1))=$E$1`

Excel. Result on the sample sheet: 6 rows (B2:B7). [See it and try it](https://spreadsheetpractice.com/formulas/check-if-cell-ends-with-specific-text)

### Convert quarter text like "Q1 2026" to a date

`=DATE(RIGHT(A2,4),MID(A2,2,1)*3-2,1)`

Excel. Result on the sample sheet: 5 rows (B2:B6). [See it and try it](https://spreadsheetpractice.com/formulas/convert-quarter-text-to-a-date)

### Find cells with leading or trailing spaces

`=OR(LEFT(A2)=" ",RIGHT(A2)=" ")`

Excel. Result on the sample sheet: 6 rows (B2:B7). [See it and try it](https://spreadsheetpractice.com/formulas/find-cells-with-leading-or-trailing-spaces)

### Convert YYYYMMDD to a date

`=DATE(LEFT(A2,4),MID(A2,5,2),RIGHT(A2,2))`

Excel. Result on the sample sheet: 5 rows (B2:B6). [See it and try it](https://spreadsheetpractice.com/formulas/convert-yyyymmdd-to-a-date)

### Convert dd/mm/yyyy text to a date

`=DATE(RIGHT(A2,4),MID(A2,4,2),LEFT(A2,2))`

Excel. Result on the sample sheet: 5 rows (B2:B6). [See it and try it](https://spreadsheetpractice.com/formulas/convert-dd-mm-yyyy-text-to-a-date)

### Fix #VALUE! when subtracting dates

`=C2-DATE(RIGHT(B2,4),MID(B2,4,2),LEFT(B2,2))`

Excel. Result on the sample sheet: 5 rows (D2:D6). [See it and try it](https://spreadsheetpractice.com/formulas/value-error-when-subtracting-dates)

## Questions

### What does the RIGHT formula generator do?

You describe the task in plain English, and it writes the formula, using RIGHT where that's the right tool, for your table or a sample one. The formula is run in our engine in Excel and Google Sheets mode before you see it, so you get its result, not just a guess.

### What does RIGHT do?

RIGHT returns a set number of characters from the end of a text string.

### Can I learn to write RIGHT formulas myself?

Yes. Each example below opens a page where you try the formula in a live grid and it's checked as you go, and the RIGHT function page has a practice exercise.

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
