Reverse Text in Excel (4 Ways)

To turn Hana into anaH, Excel 365 can do it with one formula. In older versions, use a one-line VBA function, or Power Query’s Text.Reverse.

Excel 365CONCAT + MID + SEQUENCE
Any versionStrReverse in VBA
Power QueryText.Reverse

1. Formula (Excel 365)

=CONCAT(MID(B3,SEQUENCE(LEN(B3),,LEN(B3),-1),1))
Formula reversing text in Excel 365
Step For “Hana”
LEN(B3) 4
SEQUENCE(4,,4,-1) {4;3;2;1}, counting down
MID(B3,{4;3;2;1},1) {“a”;”n”;”a”;”H”}
CONCAT(...) anaH

TEXTJOIN works too: =TEXTJOIN("",TRUE,MID(...)).

2. VBA function

Add this to a module (Alt + F11 → Insert → Module), then use =ReverseText(B3) like any function:

Function ReverseText(s As String) As String
    ReverseText = StrReverse(s)
End Function

ReverseString function used in cells

Save the workbook as .xlsm to keep it.

3. Macro for selected cells

Writes the reversed text in the column to the right of each selected cell:

Sub ReverseSelection()
    Dim c As Range
    For Each c In Selection
        c.Offset(0, 1).Value = StrReverse(c.Value)
    Next c
End Sub

Macro reversing text in selected cells

See also the reverse text macro.

4. Power Query

Add Column → Custom Column with Text.Reverse([Names]).

Power Query Text.Reverse in a custom column

More: reverse text with Power Query.

Reverse the word order instead

To turn Christopher Edward Nolan into Nolan Edward Christopher in Excel 365:

=TEXTJOIN(" ",,SORTBY(TEXTSPLIT(B3," "),SEQUENCE(,COLUMNS(TEXTSPLIT(B3," "))),-1))

Related