![]() |
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"? |
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"? |
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"? |
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"? |
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"? |
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"? |
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"? |
All times are GMT +1. The time now is 05:27 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com