Extracting variable length data from cell

Sonia10

New Member
Joined
Aug 1, 2019
Messages
6
Would like a formula which would extract the contents between the word circuit and the second comma in a string:

MPLS - MPLS Services, Circuit 2083676, Verizon, xxxx,,xxxxxxxxxxxxx , xx
MPLS - MPLS Services, Circuit 572222DAT1, xxxx,xxxxx,xxxxx
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Hi & welcome to MrExcel.
How about
=TRIM(MID(SUBSTITUTE(A1,",",REPT(" ",100),2),SEARCH("circuit",A1)+8,100))
 
Upvote 0
Thanks this worked for most but not:

Internet - Internet (DSL,Internet), Circuit XXXX,xxx,xxxx,xxx,xx

This entry has an additional ","
 
Upvote 0
It doesn't work for that, because you said after the 2nd comma ;)
Do you have any other variations?
 
Upvote 0
Here is a formula you can try that extracts text AFTER the word "circuit" and before the comma that follows after said word.

=TRIM(LEFT(SUBSTITUTE(MID(SUBSTITUTE(LOWER(A1),"circuit",REPT(" ",LEN(A1))),LEN(A1)+1,LEN(A1)),",",REPT(" ",LEN(A1))),LEN(A1)))

EDIT: Curse those case sensitivities!
 
Last edited:
Upvote 0
Maybe like this?

=TRIM(LEFT(SUBSTITUTE(REPLACE(A1,1,SEARCH(" Circuit",A1)+8,""),",",REPT(" ",100)),100))
 
Upvote 0
Ok, another option
=MID(A1,SEARCH("circuit",A1)+8,SEARCH(",",A1,SEARCH("circuit",A1)+8)-(SEARCH("circuit",A1)+8))
 
Upvote 0
Glad we could help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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