REVERSE

=REVERSE(reference)

reference
Required. The cell reference or text to be reversed.

smozgur

BatCoder
Joined
Feb 28, 2002
Messages
1,229
REVERSE function returns the contents of the given text with all the characters reversed.

Excel Formula:
=LAMBDA(reference,
  TEXTJOIN("",TRUE,MID(reference,SEQUENCE(LEN(reference),,LEN(reference),-1),1)))

Much better version provided by @Peter_SSs:
Excel Formula:
=LAMBDA(reference,
 LET(L,LEN(reference),CONCAT(MID(reference,SEQUENCE(L,,L,-1),1))))

Book1
AB
1123456789987654321
Sheet1
Cell Formulas
RangeFormula
B1B1=REVERSE(A1)
 
Last edited:
Upvote 0

Some videos you may like

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
47,493
Office Version
  1. 365
Platform
  1. Windows
Hi Suat

Suggestion: Since you are using all the characters in the original value, instead of TEXTJOIN using a null string & specifying to skip empty values (of which there will be none) use CONCAT instead? :)

Excel Formula:
=LAMBDA(reference,
  CONCAT(MID(reference,SEQUENCE(LEN(reference),,LEN(reference),-1),1)))

.. or perhaps even combine with the LET function:
Excel Formula:
=LAMBDA(reference,
  LET(L,LEN(reference),CONCAT(MID(reference,SEQUENCE(L,,L,-1),1))))
 

smozgur

BatCoder
Joined
Feb 28, 2002
Messages
1,229
Suggestion: Since you are using all the characters in the original value, instead of TEXTJOIN using a null string & specifying to skip empty values (of which there will be none) use CONCAT instead? :)
Beautiful! So I added CONCAT version too.

Funny story of this entry: I was trying to test the Lambda function as I finally have it in Excel, and I don’t know why, this was the first function I could think of as I created the UDF version by using StrReverse VBA function before or likely it was the easiest one that I could understand in the formula form. You know, I am not a real formula person :)

Then I just realized that @BobUmlas also posted the exact same formula on LinkedIn hours before than I did, and I didn’t see his post until now!


Ok, ok. I will stick with coding and leave the formula art to the real experts! :)
 

Watch MrExcel Video

Forum statistics

Threads
1,118,780
Messages
5,574,217
Members
412,577
Latest member
jamiedaka
Top