#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default If formula

I have cells where I am trying to eliminate text after the dash, but it gives
me errors if the cells does not contain a dash. How can I have it just give
me what is in the cell if no dash is found?

For example (the first one gives it to me correctly, but the second one
finds an error)
NL RISON KANTOOR ITEMS-SCHAGEN NL RISON KANTOOR ITEMS
NL PEJO ELECTROSERVICE B V #VALUE!

My formula reads
=TRIM(LEFT(B2,FIND("-",B2)-1))

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default If formula

Try this:

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

--
Biff
Microsoft Excel MVP


"Cassius" wrote in message
...
I have cells where I am trying to eliminate text after the dash, but it
gives
me errors if the cells does not contain a dash. How can I have it just
give
me what is in the cell if no dash is found?

For example (the first one gives it to me correctly, but the second one
finds an error)
NL RISON KANTOOR ITEMS-SCHAGEN NL RISON KANTOOR ITEMS
NL PEJO ELECTROSERVICE B V #VALUE!

My formula reads
=TRIM(LEFT(B2,FIND("-",B2)-1))



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,388
Default If formula

Hi Biff,
Jumping in.
Very cool!
Regards - Dave.

"T. Valko" wrote:

Try this:

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

--
Biff
Microsoft Excel MVP


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default If formula

Agreed


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Dave" wrote in message
...
Hi Biff,
Jumping in.
Very cool!
Regards - Dave.

"T. Valko" wrote:

Try this:

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

--
Biff
Microsoft Excel MVP





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default If formula

Thanks!

--
Biff
Microsoft Excel MVP


"Don Guillett" wrote in message
...
Agreed


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Dave" wrote in message
...
Hi Biff,
Jumping in.
Very cool!
Regards - Dave.

"T. Valko" wrote:

Try this:

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

--
Biff
Microsoft Excel MVP





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



All times are GMT +1. The time now is 08:15 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"