Avatar of Bright01
Bright01Flag for United States of America

asked on 

Simple Parcing of Data

EE Pros,

I have Email addresses that are NAME/Location/Location/Location formatted in a single cell.

I need to have a macro or formula that extracts and leaves only THE NAME.   So, in other words, when it reads the cell, and sees the first "/", it will delete the "/" and everything after that in the same cell.

Thank you in advance.

B.
Microsoft Excel

Avatar of undefined
Last Comment
Rob Henson
Avatar of Missus Miss_Sellaneus
Missus Miss_Sellaneus
Flag of United States of America image

=LEFT(A2,FIND("/",A2)-1)

EDIT: Oh, that won't do it in the same cell.
SOLUTION
Avatar of Rob Henson
Rob Henson
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of Professor J
Professor J

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of Rob Henson
Rob Henson
Flag of United Kingdom of Great Britain and Northern Ireland image

As Missus points out in her first comment, a formula will not do it in the same cell.  To do it in the cell will have to be Text to Column as I suggested or with a macro.
Avatar of Bright01
Bright01
Flag of United States of America image

ASKER

Great job!  Fast and both worked.   Thank you for the help.
Avatar of Rob Henson
Rob Henson
Flag of United Kingdom of Great Britain and Northern Ireland image

If you're going to accept JimJam's formula, you ought to have given points to Missus as well.

Any reason why you accepted formula as best when you specified you wanted in same cell?
Avatar of Bright01
Bright01
Flag of United States of America image

ASKER

Jimjam's formula allowed me to copy and paste it down a complete column and it worked.  I also had 3 "/" in the same cell and everything right of the first "/" was deleted leaving me with exactly what I needed.

B.
Avatar of Rob Henson
Rob Henson
Flag of United Kingdom of Great Britain and Northern Ireland image

And so would LEFT function
Avatar of Bright01
Bright01
Flag of United States of America image

ASKER

Rob,

Just tested her code and you were right!  It worked also.  I owe Miss Sellaneus  some points and an apology........  I'm afraid I dismissed her answer when she mentioned it didn't work within the same cell.

Thanks for calling this out.

B.
Avatar of Rob Henson
Rob Henson
Flag of United Kingdom of Great Britain and Northern Ireland image

That is what the LEFT function is designed to do -  show everything to the left of a given point, in Missus formula that given point was the first occurrence of "/".
leaving me with exactly what I needed.
this might be the case but it isn't what you asked for.

Missus in some ways rightly pulled her answer because you asked for
everything after that in the same cell
.
Avatar of Bright01
Bright01
Flag of United States of America image

ASKER

Well, as in life, sometimes we adapt to the situation.  I could have actually gone either way.... in the same cell or as a result of the cell containing the original data.  My fault for not looking harder at her answer.   I'll need to be more careful on these responses.

Again, thanks for pointing out the fact that her code worked with only a minor change to the original "ask".

B.
Avatar of Rob Henson
Rob Henson
Flag of United Kingdom of Great Britain and Northern Ireland image

No worries, just ensuring an answer which is as full as possible for people searching for answers in future.
Microsoft Excel
Microsoft Excel

Microsoft Excel topics include formulas, formatting, VBA macros and user-defined functions, and everything else related to the spreadsheet user interface, including error messages.

144K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo