How do I extract text between two of the same characters on a string, given that said character has appeared before?
I'm trying to extract the diameter here, so for example from the strings
1234-AB-001-4"-X01 and 1234-AB-002-1.1/2"-X01
how do I exctract the 4" and 1.1/2"?
See if this does it for you:
=TRIM(MID(SUBSTITUTE(A1,"-",REPT(" ",LEN(A1))),3*LEN(A1)+1,LEN(A1)))This is assuming
A1is where the string is. The3in3*LEN(A1)is what determines which string will be extracted, like so:Source: https://stackoverflow.com/questions/61837696/excel-extract-substrings-from-string-using-filterxml
It worked! Thanks so much, I was going crazy over this.