If Formula help

STIRRELL

Board Regular
Joined
Dec 30, 2010
Messages
62
Office Version
  1. 365
Hi, I have a great formula that works most of the time to parse out an email address, but.... Sometimes they add their nick name in the field with parens and the formula pulls the nick name instead of the email address . Can you help tweek the formula?


Example:
Works
=MID(A2,SEARCH("(",A2)+1,SEARCH(")",A2)-SEARCH("(",A2)-1)
Aaron Wad - NTCT (aaron.wad@Certify.com)​
returns
aaron.wad@Certify.com

where it breaks:
Aaron ( Jeff) Wad - NTCT (aaron.wad@Certify.com)​
Returns
Jeff

I was not sure how to write this to ignore the () with the nickname.
thanks for your help,
Sharon
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Hi Sharon,

It would be helpful to see more examples to check if solution accommodates all possibilities;

If the " - " is in all names maybe;

=IF(ISNUMBER(SEARCH(" - ",A2)),MID(MID(A2,SEARCH(" - ",A2),LEN(A2)),SEARCH("(",MID(A2,SEARCH(" - ",A2),LEN(A2)))+1,SEARCH(")",MID(A2,SEARCH( " - ",A2),LEN(A2)))-SEARCH("(",MID(A2,SEARCH(" - ",A2),LEN(A2)))-1),"")
 
Upvote 0
Another option
Excel Formula:
=FILTERXML("<k><m>"&SUBSTITUTE(SUBSTITUTE(A2,"(",")"),")","</m><m>")&"</m></k>","//m[contains(.,'@')]")
 
Upvote 0

Forum statistics

Threads
1,214,377
Messages
6,119,183
Members
448,872
Latest member
lcaw

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