Link to home
Start Free TrialLog in
Avatar of ssblue
ssblueFlag for United States of America

asked on

Excel pull data between dashes

I need to be able to pull everything between the second and third dash in a list of items.

0-AP-LP-6001-CB-MB  >  result = LP
0-AP-MCC-6000           >  result = MCC
0-AP-XFMR-6007         >  result = XFMR
0-FA-5001A-B-6           >  result = 5001A
ASKER CERTIFIED SOLUTION
Avatar of Subodh Tiwari (Neeraj)
Subodh Tiwari (Neeraj)
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You could use Text to Columns from the Data Tab using the dash as a delimiter, then simply delete the unwanted columns, see the MS article and demo video

Split text into different columns with the Convert Text to Columns Wizard
Avatar of ssblue

ASKER

Thanks!!!
You're welcome!
Pleased to help
Avatar of ssblue

ASKER

Quick question - how would I modify  this to pull the info between the first and second dash??

0-AP-LP-6001-CB-MB  >  result = AP
0-AP-MCC-6000           >  result = AP
0-AP-XFMR-6007         >  result = AP
0-FA-5001A-B-6           >  result = FA
Remove the *2 from the formula.
=TRIM(MID(SUBSTITUTE(A2,"-",REPT(" ",LEN(A2))),LEN(A2),LEN(A2)))

Open in new window

Avatar of ssblue

ASKER

SWEET!!  THANKS!