Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 216
Default Formula/Function for parsing data

I have a column of data which is not consistent. Examples of the data in the
column: C- Name, CO- Name, CN- Name, Name, etc.

I want to write a formula/function that will automatically return only the
name (first and last). I know I can convert my data from text to columns or
even write a macro to do this but I don't want anyone to have to remember to
do anything. I want the name to be returned once the data is pasted into a
template.

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default Formula/Function for parsing data

How complete are your examples; that is, when the name is not by itself, is
the additional text **always** in front of the name and is there **always**
a dash between them? Also, do I understand correctly that you want the
parsed name to replace the typed-in name in the same cell? Is yes to this
last question, you will need VB code to do this automatically... is a VB
code solution okay? If not, then you will need to put the parsed data in
another column using a formula (you cannot have a formula in a cell that a
user types in).

--
Rick (MVP - Excel)



"Nadine" wrote in message
...
I have a column of data which is not consistent. Examples of the data in
the
column: C- Name, CO- Name, CN- Name, Name, etc.

I want to write a formula/function that will automatically return only the
name (first and last). I know I can convert my data from text to columns
or
even write a macro to do this but I don't want anyone to have to remember
to
do anything. I want the name to be returned once the data is pasted into
a
template.

Thanks.


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 126
Default Formula/Function for parsing data

Assuming the name is after the ' - '...
=IF(ISERROR(FIND("-",A1)),A1,TRIM(RIGHT(A1,LEN(A1)-FIND("-",A1))))
--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown



"Nadine" wrote:

I have a column of data which is not consistent. Examples of the data in the
column: C- Name, CO- Name, CN- Name, Name, etc.

I want to write a formula/function that will automatically return only the
name (first and last). I know I can convert my data from text to columns or
even write a macro to do this but I don't want anyone to have to remember to
do anything. I want the name to be returned once the data is pasted into a
template.

Thanks.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 216
Default Formula/Function for parsing data

This doesn't work. The name is after the "- " if there is one. Thanks for
trying.

"Gary Brown" wrote:

Assuming the name is after the ' - '...
=IF(ISERROR(FIND("-",A1)),A1,TRIM(RIGHT(A1,LEN(A1)-FIND("-",A1))))
--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown



"Nadine" wrote:

I have a column of data which is not consistent. Examples of the data in the
column: C- Name, CO- Name, CN- Name, Name, etc.

I want to write a formula/function that will automatically return only the
name (first and last). I know I can convert my data from text to columns or
even write a macro to do this but I don't want anyone to have to remember to
do anything. I want the name to be returned once the data is pasted into a
template.

Thanks.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default Formula/Function for parsing data

Since it appears you are willing to parse the name out in another cell, try
this formula...

=TRIM(RIGHT(SUBSTITUTE(A1,"-",REPT(" ",99)),99))

--
Rick (MVP - Excel)



"Nadine" wrote in message
...
This doesn't work. The name is after the "- " if there is one. Thanks
for
trying.

"Gary Brown" wrote:

Assuming the name is after the ' - '...
=IF(ISERROR(FIND("-",A1)),A1,TRIM(RIGHT(A1,LEN(A1)-FIND("-",A1))))
--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown



"Nadine" wrote:

I have a column of data which is not consistent. Examples of the data
in the
column: C- Name, CO- Name, CN- Name, Name, etc.

I want to write a formula/function that will automatically return only
the
name (first and last). I know I can convert my data from text to
columns or
even write a macro to do this but I don't want anyone to have to
remember to
do anything. I want the name to be returned once the data is pasted
into a
template.

Thanks.




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 216
Default Formula/Function for parsing data

Your and Gary's both worked. I must have missed something in Gary's but when
I tried it again, it worked. Thank you both!!!!!!!!!!!!!!!!

"Rick Rothstein" wrote:

Since it appears you are willing to parse the name out in another cell, try
this formula...

=TRIM(RIGHT(SUBSTITUTE(A1,"-",REPT(" ",99)),99))

--
Rick (MVP - Excel)



"Nadine" wrote in message
...
This doesn't work. The name is after the "- " if there is one. Thanks
for
trying.

"Gary Brown" wrote:

Assuming the name is after the ' - '...
=IF(ISERROR(FIND("-",A1)),A1,TRIM(RIGHT(A1,LEN(A1)-FIND("-",A1))))
--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown



"Nadine" wrote:

I have a column of data which is not consistent. Examples of the data
in the
column: C- Name, CO- Name, CN- Name, Name, etc.

I want to write a formula/function that will automatically return only
the
name (first and last). I know I can convert my data from text to
columns or
even write a macro to do this but I don't want anyone to have to
remember to
do anything. I want the name to be returned once the data is pasted
into a
template.

Thanks.


.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Parsing Data with Javier Excel Discussion (Misc queries) 0 June 27th 06 06:21 PM
Help With Parsing Data Saxman Excel Discussion (Misc queries) 5 December 27th 05 02:39 PM
Parsing Data Saxman Excel Discussion (Misc queries) 4 December 8th 05 08:31 AM
The SEARCH function and parsing data Michael Excel Worksheet Functions 2 September 19th 05 05:36 PM
Parsing Data w/ a Formula (another question) carl Excel Worksheet Functions 2 December 3rd 04 06:51 PM


All times are GMT +1. The time now is 04:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"