Solved

# Parse out characters in an Excel cell

Posted on 2011-10-12
197 Views
Hi there,
Wondering if anyone can help me out here...I have a file where in one cell, it has the Full Name and their email address. What I would like is to just capture on the adjacent cell, the name before the @ symbol within the email address. Would it be possible?
So the end look would be this:
B                                                      C
John Smith (jsmith@xxx.com)         jsmith

Thanks for your help, and please let me know if you need additional info/details...

Much appreciated,
Classic
0
Question by:Classic1

LVL 50

Accepted Solution

With data in B2 try this formula in C2 to extract the information you need

=MID(LEFT(B2,FIND("@",B2)-1),FIND("(",B2)+1,99)

regards, barry
0

Author Closing Comment

Awesome!!!
Wow...thanks for the quick replay, barryhoudini, that worked exactly to a tee!!!

Just breaking down the syntax, you're using a MID function and using the FIND function to find the "@" symbol and start going LEFT 1 spot  previous (-1). Then stop just before the "(" symbol (+1). The 99 is just in case there's more than 99 characters in the string?

Much appreciated!!!
Classic
0

LVL 50

Expert Comment

Yes, it's a little like that but not quite....

This part

=FIND("@",B2)

finds the position of the @ and then when you use that in LEFT function like this

=LEFT(B2,FIND("@",B2)-1)

that gives you everything to the LEFT of the @, e.g. for your example

John Smith (jsmith

Now you use that within the MID function taking  everything from the position of the ( for 99 characters (or the end of that substring).

If you use REPLACE instead of MID then the limit of 99 is immaterial, i.e.

=REPLACE(LEFT(B2,FIND("@",B2)-1),1,FIND("(",B2),"")

regards, barry
0

## Join & Write a Comment Already a member? Login.

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

#### 732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

#### Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!