REVERSE

=REVERSE(reference)

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

REVERSE returns the contents of the given text with all the characters reversed.

smozgur

BatCoder
Builders Club Member
Joined
Feb 28, 2002
Messages
2,571
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
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))))
 
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! :)
 

Forum statistics

Threads
1,216,503
Messages
6,131,022
Members
449,616
Latest member
PsychoCube

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top