How to return data from text string in a cell

merskamp

New Member
Joined
Sep 28, 2005
Messages
47
I have Excel 2007.

In column A, i have several cells with long strings of data.
I need to clean up the cell and show only the data to the left of the second comma in each cell and to the right of the "=" sign which is always third from the left. The second comma doesnt always appear as the 7th or 9th or 19th character, else I could use a simple LEFT or RIGHT to solve.

Sample data. Each line is from A2:A6 on my spreadsheet.
In A2 I would return ... Account\, Test
In A3 ...Jones\, Sarah
etc...

Sample data:
CN=Account\, Test,OU=Test,DC=Slough,DC=tf-ty,DC=master
CN=Jones\, Sarah,CN=Users,DC=Slough,DC=tf-ty,DC=master
CN=Wayne\, Fred,OU=Test,DC=Slough,DC=tf-ty,DC=master
CN=Con Room 2\, Slough,OU=Res,OU=Slough,DC=Slough,DC=tf-ty,DC=master
CN=Thomas\, Jill.,OU=Offsite ,OU=Users,OU=Linden,DC=Slough,DC=tf-y,DC=master


Any help would be greatly appreciated.
Thanks,
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
There is probably a faster way to do this but this works if sample data is in A1:
=RIGHT(LEFT(A1,FIND(",",A1,FIND(",",A1)+1)-1),LEN(LEFT(A1,FIND(",",A1,FIND(",",A1)+1)-1))-FIND("=",A1))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,831
Members
452,946
Latest member
JoseDavid

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