#1   Report Post  
Posted to microsoft.public.excel.misc
Jim Jim is offline
external usenet poster
 
Posts: 615
Default is Error help

Hello,

I'm currently using the following formula:

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

How would I write this so that if the referred to cell is blank then the
cell I have the formula in shows blank instead of an error?

Thanks
Jim

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 320
Default is Error help

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


"Jim" wrote in message
...
Hello,

I'm currently using the following formula:

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

How would I write this so that if the referred to cell is blank then the
cell I have the formula in shows blank instead of an error?

Thanks
Jim



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default is Error help


=IF(ISERR(FIND("-",A1)),"",LEFT(A1,FIND("-",TRIM(A1))-1))
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Jim" wrote in message
...
Hello,

I'm currently using the following formula:

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

How would I write this so that if the referred to cell is blank then the
cell I have the formula in shows blank instead of an error?

Thanks
Jim


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default is Error help

=IF(A1="","",TRIM(LEFT(A1,FIND("-",A1)-1)))
If you want to trap for cell contents not including a hyphen, you may prefer
=IF(ISNUMBER(FIND("-",A1)),TRIM(LEFT(A1,FIND("-",A1)-1)),"")
--
David Biddulph

"Jim" wrote in message
...
Hello,

I'm currently using the following formula:

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

How would I write this so that if the referred to cell is blank then the
cell I have the formula in shows blank instead of an error?

Thanks
Jim



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
Error: "Excel encountered an error and had to remove some formatti Carl Excel Discussion (Misc queries) 0 September 18th 06 06:39 PM
Counting instances of found text (Excel error? Or user error?) S Davis Excel Worksheet Functions 5 September 12th 06 04:52 PM
I have Error 1919 Error Configuring ODBC dataSource Database Texanna1 Excel Discussion (Misc queries) 1 September 12th 06 06:35 AM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM


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