I have this google sheets input column on the left, I want to flip the string like shown in the output column.
Input Output
--------------
bats stab
live evil
meet teem
part trap
stop pots
CodePudding user response:
Use this formula, just replace A2:A
range with yours.
=ArrayFormula(IF(A2:A="","",
BYROW(A2:A, LAMBDA(range,
TEXTJOIN("",FALSE,MID(range,SEQUENCE(LEN(range),1,LEN(range),-1),1))))))
or:
=IFERROR(BYROW(A1:A, LAMBDA(x, JOIN(, INDEX(REGEXREPLACE(""&x,
REPT("(.)", LEN(x)), "$"&LEN(x)-SEQUENCE(1, LEN(x), )))))))
CodePudding user response:
try:
=IFERROR(BYROW(A1:A, LAMBDA(x, JOIN(,
INDEX(MID(x, LEN(x)-SEQUENCE(1, LEN(x)) 1, 1))))))
CodePudding user response:
Split the string to it's characters using regex delimiter, then REDUCE
the string using current&accumulator
(reversal happens here):
=REDUCE(,SPLIT(REGEXREPLACE(A2,,"