Extract Text from Cells in Excel

New Contributor

I'm looking for help extracting text from cells.  

 

Here's an example

DOLPHIN & MERMAID WBA-121500-E
SEA TURTLE BEAUT WW-01102001-T

 

I would like to extract the WBA-121500-E and the WW-01102001-T into a seperate cell.  

 

The data I am working has the text I'm looking to extract in different places within the cell and they are all not the same amount of characters.  Is there a formula I can use that will extract the text joined by a "-" into a seperate cell or something along those lines?

 

 

2 Replies

@Detlef Lewin 

Interesting. I have seen Flash Fill demonstrated but never had cause to use it.

A very different route, but I have a copy of Charles Williams's Fast Excel add-in loaded and that supports Regular Expressions.

= Rgx.MID( [@String], "\w{2,3}\-\d{6,8}\-\w" )

I believe Google Sheets also has support for RegEx.

 

[2 or 3 letters followed by a hyphen, then 6 to 8 digits and a hyphen and, finally, a letter]