Extract 2 email addresses from a string of text

test_man2

New Member
Joined
Aug 28, 2007
Messages
35
Office Version
  1. 365
Platform
  1. Windows
Greetings!

Back in 2006, fairwinds posted a solution to extract an email address from a string of text:
=TRIM(MID(SUBSTITUTE(" "&A1," ",REPT(" ",20)),FIND("@",SUBSTITUTE(" "&A1," ",REPT(" ",20)))-20,40))

What if that string of text contains two email addresses? Such as - "Update abcdefg@gmail.com to tuvwxyz@att.net"

My guess is that the best way would be to create a new formula in column C (the above formula being in column B). What would that formula be?
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
How about
+Fluff 1.xlsm
ABC
1
2Update abcdefg@gmail.com to tuvwxyz@att.netabcdefg@gmail.comtuvwxyz@att.net
3Update tuvwxyz@att.nettuvwxyz@att.net
Lists
Cell Formulas
RangeFormula
B2:C2,B3B2=TRANSPOSE(FILTERXML("<k><m>"&SUBSTITUTE(A2," ","</m><m>")&"</m></k>","//m[contains(.,'@')]"))
Dynamic array formulas.
 
Upvote 0
Solution
Wow, that's great! If only you could clearly explain to me step-by-step how this works! I've never seen a formula extend results across more than one cell! Alas, I know little to nothing about dynamic array formulas, and I've never seen a formula with FILTERXML in it, so any explanation you provide would probably just go way over my head! My line of thinking was perhaps somehow using RIGHT in a formula in column C, which would only work if the address were at the end of the string, but yours works no matter where they are. Thanks for the solution!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,279
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