Finding a particular sequence in a sentence

bharatmvs

New Member
Joined
Sep 27, 2013
Messages
21
Hello All,


The objective is to look for a particular sequence in a sentence of every cell and if the sequence matches, then to pull that value.


For Eg.


I want to look for XXXX-YYYY, where and Y are all digits, may be same or different like 2341-3241. So whenever such sequence is found in a sentence, it must be able to pull out that sequence and paste it in another column.


if the sentence is as below:


Heater sequence 4543-2343 is to be rectified, then 4543-2343 is to be extracted out and copied into another cell, in same row.


Please help on this.


THank You
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Will the sequence always be two groups of digits separated by a hyphen? Can there be more than one such sequence in a cell?
 
Upvote 0
Will the sequence always be two groups of digits separated by a hyphen? Can there be more than one such sequence in a cell?

Hi Joe,

Thank You for the response.
I have used Pattern object to meet my requirement. However I have come across another issue as it has multiple sequences, can you please propose a solution to extract all such sequences from number?
 
Upvote 0
If there are no other dashes in the string than in the numbers to extract, try this (put in B1 and drag across):

=IFERROR(MID($A1,FIND("#",SUBSTITUTE($A1,"-","#",COLUMNS($A:A)))-4,9),"")
 
Upvote 0

Forum statistics

Threads
1,213,485
Messages
6,113,931
Members
448,533
Latest member
thietbibeboiwasaco

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top