Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Need a Function to Remove Text

Is there a function (or other Excel ability) to remove, in a single cell,
text after a certain character such as "-" e.g. to return "US" for
"US-AF-MIL" or "dot" for "dot-com"?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Need a Function to Remove Text

=LEFT(A1,FIND("-",A1)-1)

"pemmert" wrote:

Is there a function (or other Excel ability) to remove, in a single cell,
text after a certain character such as "-" e.g. to return "US" for
"US-AF-MIL" or "dot" for "dot-com"?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 694
Default Need a Function to Remove Text

Hi

Try

=LEFT(A1,FIND("-",A1)-1)
--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"pemmert" wrote:

Is there a function (or other Excel ability) to remove, in a single cell,
text after a certain character such as "-" e.g. to return "US" for
"US-AF-MIL" or "dot" for "dot-com"?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 76
Default Need a Function to Remove Text

If you want the pull out the first set of characters up to the '-',
then use =MID(A1,1,SEARCH("-",A1,1)-1)

Tony

On Jan 5, 9:41 am, pemmert wrote:
Is there a function (or other Excel ability) to remove, in a single cell,
text after a certain character such as "-" e.g. to return "US" for
"US-AF-MIL" or "dot" for "dot-com"?


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Need a Function to Remove Text

Thanks (everyone) for the quick response, it worked perfectly.

"Teethless mama" wrote:

=LEFT(A1,FIND("-",A1)-1)

"pemmert" wrote:

Is there a function (or other Excel ability) to remove, in a single cell,
text after a certain character such as "-" e.g. to return "US" for
"US-AF-MIL" or "dot" for "dot-com"?



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Need a Function to Remove Text

Sorry, spoke too soon. Follow up question. I get a #VALUE error if the
character to be found doesn't appear; is there a way to deal with that?

Thanks

"Teethless mama" wrote:

=LEFT(A1,FIND("-",A1)-1)

"pemmert" wrote:

Is there a function (or other Excel ability) to remove, in a single cell,
text after a certain character such as "-" e.g. to return "US" for
"US-AF-MIL" or "dot" for "dot-com"?

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default Need a Function to Remove Text

=IF(ISERROR(FIND("-",A1)),"Whatever you want to do if not
found",LEFT(A1,FIND("-",A1)-1))


Regards,

Peo Sjoblom

pemmert wrote:
Sorry, spoke too soon. Follow up question. I get a #VALUE error if the
character to be found doesn't appear; is there a way to deal with that?

Thanks

"Teethless mama" wrote:

=LEFT(A1,FIND("-",A1)-1)

"pemmert" wrote:

Is there a function (or other Excel ability) to remove, in a single cell,
text after a certain character such as "-" e.g. to return "US" for
"US-AF-MIL" or "dot" for "dot-com"?

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
How to convert a month to a quarter ...... Epinn New Users to Excel 26 May 3rd 23 07:45 PM
How do I remove the text qualifier (') from my data in Excel? Robert HAI Excel Discussion (Misc queries) 0 October 30th 06 06:05 PM
Function is displayed as text rather than giving a value Danni2004 Excel Worksheet Functions 2 October 20th 06 11:19 PM
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
Conversion SVC Excel Worksheet Functions 9 February 28th 05 02:29 PM


All times are GMT +1. The time now is 02:34 PM.

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"