## How to extract email addresses from an Excel sheet

**Question:** How to extract email addresses from this sheet? (See pic below)

**Answer:**

It depends on how the emails are populated in your worksheet?

- Are they in a single cell each?
- Are there other text strings in the cell as well?

#### Example 1,

The following formula works if a cell contains only an email address, see image above. The TEXTJOIN function extracts all emails based on if character @ is found in the cell.

Array formula in cell C8:

#### Example 2,

The example above has multiple text strings in each cell separated by a blank, the formula is only capable of extracting one email address per cell and if the delimiting character is a blank (space). You can change the formula to use any delimiting character, however, only one delimiting character per formula.

Formula in cell C3:

#### Example 3,

It is possible to combine the array formulas in example 1 and 2, unfortunately, the formula can still only extract one email address per cell.

Array formula in cell B6:

Cell B6 has "Wrap text" enabled, select cell B6 and press CTRL + 1 to open the "Format Cells" dialog box.

#### Example 4,

If you need an even better faster formula I recommend using a UDF:

Filter words containing a given string in a cell range [UDF]

The image above demonstrates a User Defined Function that extracts all words containing a given string that you can specify. In […]

#### Example 5,

The formula in cell F3 gets only one email address per row so it is very basic, however, check out the comments for more advanced formulas.

If the cell contains an email address and also other text strings it won't extract the email only, as I said, it is a very basic formula.

Array formula in F3:

To enter an array formula, type the formula in cell F3 then press and hold CTRL + SHIFT simultaneously, now press Enter once. Release all keys.

The formula bar now shows the formula with a beginning and ending curly bracket telling you that you entered the formula successfully.

Don't enter the curly brackets yourself, they appear automatically.

This article demonstrates how to filter emails with a custom function:

Filter words containing a given string in a cell range [UDF]

The image above demonstrates a User Defined Function that extracts all words containing a given string that you can specify. In […]

### Explaining formula in cell F3

#### Step 1 - Look for @ character in cell range

The SEARCH function allows you to find the character position of a substring in a text string, we are, however, not interested in the position only if it exists or not in the cell.

SEARCH("@", B3:D3))

becomes

SEARCH("@", {"BB","john@doe.com","CC"}))

and returns {#VALUE!,5,#VALUE!}. This tells us that the second value in the array contains a @ character on position 5.

#### Step 2 - Convert array to TRUE or FALSE

The IF function can't handle error values in the logical expression so we must first convert the array to boolean values. The ISERROR function returns TRUE if the value is an error value and FALSE if not.

ISERROR(SEARCH("@", B3:D3))

becomes

ISERROR({#VALUE!,5,#VALUE!})

and returns {TRUE,FALSE,TRUE}.

#### Step 3 - Return column number if value is not an error value

IF(ISERROR(SEARCH("@", B3:D3)), "", MATCH(COLUMN(B3:D3), COLUMN(B3:D3)))

becomes

IF({TRUE,FALSE,TRUE}, "", MATCH(COLUMN(B3:D3), COLUMN(B3:D3)))

To create an array from 1 to n I use the MATCH function and COLUMN function.

IF({TRUE,FALSE,TRUE}, "", MATCH(COLUMN(B3:D3), COLUMN(B3:D3)))

becomes

IF({TRUE,FALSE,TRUE}, "", MATCH({2,3,4}, {2,3,4}))

becomes

IF({TRUE,FALSE,TRUE}, "", {1, 2,3})

and returns {"", 2,""}

#### Step 4 - Return the smallest column number

The MIN function calculates the smallest number in cell range or array.

MIN(IF(ISERROR(SEARCH("@", B3:D3)), "", MATCH(COLUMN(B3:D3), COLUMN(B3:D3))))

becomes

MIN({"", 2,""})

and returns 2.

#### Step 4 - Return value corresponding to column number

The INDEX function returns a value based on a row and/or column number.

INDEX(B3:D3, MIN(IF(ISERROR(SEARCH("@", B3:D3)), "", MATCH(COLUMN(B3:D3), COLUMN(B3:D3)))))

becomes

INDEX(B3:D3, 2)

and returns "john@doe.com".

### Download Excel *.xlsx file

Learn to use regular expressions and filter emails:

Extract cell references from a formula

I am trying to build a regular expression that matches cell references in a formula. A regular expression is a […]

Learn how to use the LIKE operator to filter emails:

Working with the LIKE OPERATOR

The LIKE operator allows you to match a string to a pattern in excel vba. The following characters are specifically […]

Filter words containing a given string in a cell range [UDF]

The image above demonstrates a User Defined Function that extracts all words containing a given string that you can specify. In […]

Extract a unique distinct list from two columns

Question: I have two ranges or lists (List1 and List2) from where I would like to extract a unique distinct […]

The picture above shows how to merge two columns into one list using a formula. If you are looking […]

Extract a list of duplicates from a column

The array formula in cell C2 extracts duplicate values from column A. Only one duplicate of each value is displayed […]

How to use the ISERROR function

The ISERROR function returns TRUE if a cell returns an error. Formula in cell D3: =ISERROR(B3) Excel Function Syntax ISERROR(value) […]

### 40 Responses to “How to extract email addresses from an Excel sheet”

### Leave a Reply

### How to comment

**How to add a formula to your comment**

<code>Insert your formula here.</code>

**Convert less than and larger than signs**

Use html character entities instead of less than and larger than signs.

< becomes < and > becomes >

**How to add VBA code to your comment**

[vb 1="vbnet" language=","]

Put your VBA code here.

[/vb]

**How to add a picture to your comment:**

Upload picture to postimage.org or imgur

Use the img tag, like this: <img src="Insert pic link here">

**Contact Oscar**

You can contact me through this contact form

Here's something I came up with to extract the email from an adjacent cell (called A1) of text(so put this formula in B1 and copy down). It assumes the email address has a blank space on either side within the body text.

=CONCATENATE(RIGHT(SUBSTITUTE(LEFT(A1,SEARCH("@",A1,1)-1)," "," ^!",(LEN(LEFT(A1,SEARCH("@",A1,1)-1))-LEN(SUBSTITUTE(LEFT(A1,SEARCH("@",A1,1)-1)," ","")))),(SEARCH("@",A1,1)-SEARCH("^!",SUBSTITUTE(LEFT(A1,SEARCH("@",A1,1)-1)," "," ^!",(LEN(LEFT(A1,SEARCH("@",A1,1)-1))-LEN(SUBSTITUTE(LEFT(A1,SEARCH("@",A1,1)-1)," ","")))),1))),MID(A1,SEARCH("@",A1,1),SEARCH(" ",A1,SEARCH("@",A1,1))-SEARCH("@",A1,1)))

Fred,

Your formula works! Thanks for sharing!

Thanks also for bringing this post to my attention. I have changed the array formula and the attached excel file.

Here is a much shorter formula to find the email address within a cell and it allows that email address to be anywhere within the text (beginning, middle or end)...

=TRIM(RIGHT(SUBSTITUTE(LEFT(A1,FIND("@",A1)-1)," ",REPT(" ",99)),99))&MID(A1,FIND("@",A1),FIND(" ",A1&" ",FIND("@",A1))-FIND("@",A1))

Rick Rothstein (MVP - Excel),

Your formula worked great.

Thanks

I get this to work but I have email with ( at beginning and ) at the end of the address how would I modify the formula to remove the () from the address?

worked for me too. thanks for sharing

Rick Rothstein (MVP - Excel),

Great formula, you got me thinking there for a while! Thanks for sharing!

I'm glad you were able to figure out how my formula (for finding an email address inside a text string) works. Here is a slightly different formula that does what you posted in your original blog entry (get the email address from whatever column it is in)...

=INDEX(A1:C1,1,MIN(IF(ISERR(SEARCH("@",A1:C1)),"",COLUMN(A1:C1))))

This formula, like the one you blogged, requires Ctrl+Shift+Enter to commit it.

Whoops! Sorry, I posted your blogged formula by mistake; here is the formula I meant to post...

=INDEX(1:1,,MAX(COLUMN(A1:C1)*NOT(ISERROR(SEARCH("@",A1:C1)))))

And again, for completeness sake, this formula, like the one you blogged, requires Ctrl+Shift+Enter to commit it.

Rick your formula works!!! so thankful to you!

I have a excel-document with some 2000 rows, with link to contacts details on the internet (where I can find e-mailaddresses) Is it possible to make a string that works for that?

No, I don´t think it is possible. But I believe you can use vba to search the html found at each http address.

A very quick method to extract email addresses is to use a text filter. Select the column with email addresses (and other info) and apply a text filter, using the 'contains' parameter, to filter on the '@' character. That will collapse all rows without an email address, allowing you to cut and past only the email addresses to another spreadsheet, or elsewhere.

Hi Terry! I came across this post by you. I'm just trying to figure out how to get email addresses out from a bunch of all other texts in excel but I'm really unfamiliar with it. Could you give me a more detailed step wise instruction on how to do it? Thanks for your help in advance!

Jun

Terry Wright,

I tried your method and it worked great!

Thanks for commenting!

Any idea how to adapt the formula to do a conditional (i.e. comma-separated) merge of the data from multiple columns, in the case that a single row has emails spread over several columns?

I think I would need to change the MIN as it only pulls the first match out of the set of matched SEARCH values (i.e. anything containing an "@" symbol)... if anyone has an idea of a better function to use than MIN please let me know... my first inclination was to use CONCAT but didn't seem to work.

Well for starters it is CONCATENATE not CONCAT, but this thing is driving me nuts.... beer $ for anyone who solves it

Here's what I'm trying to do:

some1@email.com | some2@email.com | some3@email.com | CONCATENATED LIST

The formula posted here only takes the first occurrence of an email in any column, I'd like to merge a comma-separated list of all the emails in separate columns (same row)

magneticone,

See this post: https://www.get-digital-help.com/2010/08/20/filter-emails-spread-over-several-columns-in-excel/

Guys, just download ASAP utilities, it can do what you talk about and much more, and it's free! (shareware if you are a business only)

Philippe

Hey Rick - You just saved me hours of manual work...hats off to you. Thanks..

Excellent formula by Rick and Oscar

The only issue I found was that if the cell has two email addresses, it picks the first one.

Vikas,

I think you´ll find this post interesting:

Excel udf: Filter emails from an excel range

i need help with filtering emails from my list it does not have blank space with the emails nor is it in a column by itself, how can i filter out just the email.

sample: 1090245911,null,40912,22,LA,estheraguilera15@yahoo.com,null,null

mark edwards,

Read Rick Rothstein (MVP - Excel) comment in this post:

https://www.get-digital-help.com/2011/03/16/excel-udf-filter-emails-from-an-excel-range/

Thanks Rick Rothstein. That helped!

Hi,

Im using Excel 2010 and trying to pull just the emails from thousands of cells some of which range from A:L I have tried the above Formulas but keep getting #Value errors. Ive tried troubleshooting where the #error occurs but I cant seem to work it out.

Here is an example of a single Cell that im working with..

7; "John"; "Citizen"; NULL; "Br0nc0s1"; "1990"; "1986"; "1987"; "1988"; "1989"; "1990"; "john.citizen@examplemail.com"; "[Statement not provided]"; "1"

Id like for the result of the formula to be

john.citizen@examplemail.com

Let me know how you go, if I work it out myself before someone posts a result I will post the formula for refrence sake..

Thanks in advance

Tom,

Enter the formula as an array formula:

1. Select cell D1

2. Paste array formula in formula bar

3. Press and hold Ctrl + Shift

4. Press Enter

that just duplicated the cells rather then extract the email address alone..

I just tried in D1:

=INDEX(A1:C1, 1, MIN(IF(ISERROR(SEARCH("@", A1:C1)), "", COLUMN(A1:C1))))

Ctrl + Shift

while holding ctrl and shift i pressed enter.

Tom,

Take a look at the excel file attached to this post.

same thing happens even if i put the field into the excel file attached to this post. just duplicates the fields..

can you copy paste my example colomns into a spreadsheet of your own, see what I mean and if you know what needs to be done for the desired result, share that with the post? because nothing here is working for me..

Tom,

extract_email_2_tom.xls

Thanks Oscar.

So simple once you figure out you have to do the "text to column" feature first, it also can be used to remove the quotation marks! hooray, finally done with this. thanks

Hello,

Lets say that you have a huge excel sheet with dirty data.

All the email adresses is in the same column but sometimes there is also a phone number next to it.

I have to send all these people a press release so basically I want to collect them and paste them into my email program.

It should look like this when I am finished:

email1@adress.com; email2@adress.net; info@googler.com;

Any good idea?

samuel,

have you read this post:

https://www.get-digital-help.com/2011/03/16/excel-udf-filter-emails-from-an-excel-range/

HI Oscar,

i have excel with a list of email addresses and lot of other contents along with email addresses in a single cell .is there a way to extract only the email addresses that are there in a single cell? .

Sam,

read this post:

Excel udf: Filter emails from an excel range

and Rick Rothstein's (MVP - Excel) comment.

Hey Oscar,

Trying to modify the formula to work with a column without much luck. In column A I have:

A1: John Smith

A2: 123 any street

A3: Any town

A4: Zip

A5: email

Sometimes I may also have a company name so email will be A6. In B1 I want to extract the e-mail address. Any thoughts?

thanks guys, this has been a big help.

How to extract email addresses from a cell where there are multiple email addresses are provided...example given below

"

Jonas Anstton[jonas.Anstton@kkr.bc; 46 7 90 99 76; Master Samuelesser 8, DE-34584, Kerala, India]; Fred Wing[fredrik.wingren@ers.je; +687519245; ]

"