Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Extracting E-mail Addresses from Hyperlinks.

Extracting E-mail Addresses from Hyperlinks

Written by Allen Wyatt (last updated April 16, 2022)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021


Do you have a worksheet that has a bunch of e-mail addresses in it, as a series of hyperlinks? If so, you may be interested in a way to pull out those addresses and put them into cells as plain text. There are a few ways you can perform this task.

The first method is to remember that the hyperlinks for e-mail addresses all start with the text "mailto" followed by a colon. Thus, you can use a formula that will strip out the first part of the hyperlink. For instance, if the e-mail hyperlink is in cell A1, you can use this formula:

=RIGHT(A1,LEN(A1)-7)

This checks the length of the cell contents, and then extracts all of it except the first seven characters, which is the "mailto:" portion. You could also use a formula that relies on the SUBSTITUTE function:

=SUBSTITUTE(A1,"mailto:","")

If you prefer, you can use a macro to do the conversion from hyperlink to text-only e-mail address. The following single-line macro is a user-defined function that returns the converted hyperlink:

Function ExtractEmailAddress(rCell As Range)
    ExtractEmailAddress = _
      Mid(rCell.Hyperlinks(1).Address, 8)
End Function

In order to use the macro, all you need to do is use the function in some cell of your worksheet, in this manner:

=ExtractEmailAddress(A1)

Note:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (12000) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. You can find a version of this tip for the older menu interface of Excel here: Extracting E-mail Addresses from Hyperlinks.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Using the Copy or Move Text Keys

Most people use the Clipboard to copy and move text in Word. Before the Clipboard, Word used F2 to move text and Shift+F2 ...

Discover More

Automatic Font Color Won't Print Properly

Imagine that you go to print your document, and all the text you can see on the screen just isn't there on the ...

Discover More

Using the Magnifier

With high-resolution screens it can be a stretch, at times, to see some small detail on the Windows desktop. Fortunately, ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

More ExcelTips (ribbon)

Dynamic Hyperlinks in Excel

Hyperlinks to many types of Web sites rely on passing parameters in the URL. Knowing this, you can construct a dynamic ...

Discover More

Converting to Hyperlinks in a Shared Workbook

When you enter a URL or e-mail address in a worksheet, Excel usually converts it to a clickable hyperlink. This doesn't ...

Discover More

Hyperlinks in Comments

Need to add a hyperlink to a comment or note? It's easy to do by following the steps outlined in this tip.

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 6 - 0?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.