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

Quickly Changing Columns

One of the tools on the Formatting toolbar is the Columns tool. You can use this tool to make quick changes to the number ...

Discover More

Navigating In the Document Map

Using the Document Map to navigate through your document is easy and intuitive. The value of using it for navigation is ...

Discover More

Excluding Some Data from a Chart

Excel is a whiz at creating charts from your worksheet data. When the program tries to determine what should be included ...

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)

Deleting a Hyperlink

Hyperlinks can be helpful in some worksheets but bothersome in others. Here's how to get rid of any hyperlinks you don't ...

Discover More

Automatic Text in an E-mail

When creating an e-mail address hyperlink using the Insert Hyperlink dialog box, Excel allows you to enter a subject for ...

Discover More

Hyperlinks No Longer Work in a Workbook

Hyperlinks can be a great timesaver and very convenient. Unless, of course, if they don't work as you expect. 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 - 6?

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.