1
I have data in the following format in Excel:
ABC - DEF - XYZ; GHI, JKL, MNO, PQR, STU, VWX, YYY, ZZZ
Is is it possible to extract the data between the second hyphen "-" and the semicolon ";" - in this case XYZ?
Thanks!
1
I have data in the following format in Excel:
ABC - DEF - XYZ; GHI, JKL, MNO, PQR, STU, VWX, YYY, ZZZ
Is is it possible to extract the data between the second hyphen "-" and the semicolon ";" - in this case XYZ?
Thanks!
0
I use free regex add-in (http://www.codedawn.com/excel-add-ins.php), with that you can easily create a formula to select the desired text:
=RegExReplace(A1,"(.*-){2}(.*);.*","$2")
1
If you don't want to use Add-in you can use the following:
=TRIM(MID(A1,SEARCH("-",A1,SEARCH("-",A1,1)+1)+1,SEARCH(";",A1,1)-SEARCH("-",A1,SEARCH("-",A1,1)+1)-1))
A1 is where you have your string
Search will find the second "-" (you can copy paste it in your formula if you are not sure") and first ";"
Trim to remove unwanted spaces