# How to reverse text in a cell in Excel

In Excel 365, read the characters from last to first and join them: =TEXTJOIN("",TRUE,MID(A2,SEQUENCE(LEN(A2),,LEN(A2),-1),1)).

**Excel:** `=TEXTJOIN("",TRUE,MID(A2,SEQUENCE(LEN(A2),,LEN(A2),-1),1))` (Excel 2021, 2024 and Microsoft 365)

**Google Sheets:** `=JOIN("",ARRAYFORMULA(MID(A2,SEQUENCE(LEN(A2),1,LEN(A2),-1),1)))`

## Example

Sample data (row 1 is the header):

| A | B |
| --- | --- |
| Text | Reversed |
| Spreadsheet |  |
| level |  |
| stressed |  |
| ABC-123 |  |
| Hello world |  |

Formula in B2, filled to B6: `=TEXTJOIN("",TRUE,MID(A2,SEQUENCE(LEN(A2),,LEN(A2),-1),1))`

Result: teehsdaerpS; level; desserts; 321-CBA; dlrow olleH

## How it works

`SEQUENCE(LEN(A2),,LEN(A2),-1)` counts down from the length to 1, for example 11, 10, … 1. MID takes one character at each of those positions, so the characters come out last to first, and TEXTJOIN glues them back into one piece of text.

## Other ways

- `=CONCAT(MID(A2,SEQUENCE(LEN(A2),,LEN(A2),-1),1))`: CONCAT joins the characters too; there is no separator to set.

## Common mistakes

- SEQUENCE needs Excel 365 or 2021. Older versions have no simple formula for this.
- An empty cell makes SEQUENCE(0) fail with #VALUE!. Wrap in `IF(A2="","",…)`.

## Questions

**How do I check whether a word is a palindrome?**

Compare it with its reverse: `=A2=B2` (ignores case), or `=EXACT(A2,B2)`.

**How do I reverse the order of words instead?**

Split into words and sort them backwards by position: `=TEXTJOIN(" ",TRUE,SORTBY(TEXTSPLIT(A2,," "),SEQUENCE(ROWS(TEXTSPLIT(A2,," "))),-1))`.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-30.

Source: https://spreadsheetpractice.com/formulas/reverse-text-in-a-cell
