using MID function to pull specific characters from text

zlittle

New Member
Joined
Aug 25, 2016
Messages
7
I have cells that look something like this:

ab=jenda,ou=par,ou=IP,dm=prinusa,dm=bill,dm=prin

I need to pull the letters IP only. The IP always falls right after an equals sign and before the text string ",dm=prinusa". The characters i need to pull are not always two characters in length (sometimes 3 or 4). There are always several equals signs in each cell before and after the characters I want to pull.

I have tried a combination of MID and SEARCH but can't seem to figure this one out. The many equals signs and the fact that it isn't always two characters long has made my searching hard.

Any help would be appreciated.

Thank you in advance!
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Try this:

=RIGHT(MID(A1,FIND(",dm=prinusa",A1)-5,5),5-FIND("=",MID(A1,FIND(",dm=prinusa",A1)-5,5)))
 
Upvote 0
That worked. I will have to try to make sense of it so I can explain it. Thank you very much!!
 
Upvote 0
zlittle, it looks like you solved this. But if you know the result will always be "IP," why have a formula at all? Why not just enter "IP" in the cell? Just curious ...
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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