Forum Discussion
Extraction formula help
The custom function AnyPart can do that.
It is part of the free "Custom_Functions" Excel add-in.
(20+ excel functions that work exactly like the built-in functions)
(filled across and then filled down)
Pay attention to the placement of the $ symbols.
Download the add-in from OneDrive...
https://1drv.ms/u/s!Au8Lyt79SOuhZw2MCH7_7MuLj04?e=sAwbHU
A separate examples file is also available.
'---
Nothing Left to Lose
- mathetesOct 17, 2022Silver Contributor
I have used the LET function in the attached. So you will need the newer version of Excel.
Other than that, the two formulas use the most basic of Text functions, FIND, LEFT, MID and RIGHT. I've attached a spreadsheet with your extractions done.
This formula that extracts the second and third sets of characters is
=LET(
strt,FIND("-",A1)+1,
midl,FIND("-",A1,strt),
fnl,FIND("-",A1,midl+1),
MID(A1,strt,fnl-strt)
)
No doubt there are more elegant ways to do this, but I assume you'll be able to follow that.
And this one concatenates the remainder into a single next, leaving out the extracted text.
=LET(
hypa,FIND("-",A4),
hypb,FIND("-",A4,hypa+1),
hypc,FIND("-",A4,hypb+1),
LEFT(A4,FIND("-",A4))&RIGHT(A4,LEN(A4)-hypc)
)