lrobbo314
Well-known Member
- Joined
- Jul 14, 2008
- Messages
- 3,963
- Office Version
- 365
- Platform
- Windows
XTRACT returns either letters or numbers from a given string.
There are different and maybe better or more concise ways to extract letters or numbers from a string. I just thought this was kind of a clever solution and cool that it lets you flip between returning numbers or letters.
There are different and maybe better or more concise ways to extract letters or numbers from a string. I just thought this was kind of a clever solution and cool that it lets you flip between returning numbers or letters.
Excel Formula:
=LAMBDA(
text,[num_or_text],
TAKE(
SCAN(
text,
SEQUENCE(LEN(text)),
LAMBDA(
a,b,
RIGHT(a,LEN(a)-1)
&IF(
XOR(
ISNUMBER(LEFT(a)+0),
num_or_text
)
,LEFT(a),
""
)
)
),
-1
)
)
Cell Formulas | ||
---|---|---|
Range | Formula | |
B1:B4 | B1 | =XTRACT($A1) |
C1:C4 | C1 | =XTRACT($A1,1) |
Upvote
0