Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
anon90210
 
Posts: n/a
Default Handling errors in formulas (how annoying are they!)

I want to write a formula that returns a 1 if the given text is found
in another cell, or "" if it is not. This seemingly simple formula is
driving me nutty because of excels wacky error codes.

eg.

[a1] =if(find("text",b1),1,"")
[a2] =if(find("text",b2),1,"")
[b1]="here is some text"
[b2]="here is some words"

This returns

[a1] 1
[a2] #VALUE!

how do I get it to work properly...?
  #2   Report Post  
Bernard Liengme
 
Posts: n/a
Default

The trouble is FIND returns an error value when the text is not found.
You turn this to your advantage and use =IF(ISERROR(FIND("text",A1)),"",1)

best wishes


--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"anon90210" wrote in message
om...
I want to write a formula that returns a 1 if the given text is found
in another cell, or "" if it is not. This seemingly simple formula is
driving me nutty because of excels wacky error codes.

eg.

[a1] =if(find("text",b1),1,"")
[a2] =if(find("text",b2),1,"")
[b1]="here is some text"
[b2]="here is some words"

This returns

[a1] 1
[a2] #VALUE!

how do I get it to work properly...?



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 make Excel run limited number of formulas on a given worksh John Excel Discussion (Misc queries) 0 January 12th 05 04:29 PM
Way to make Excel only run certain formulas on a worksheet? jrusso Excel Discussion (Misc queries) 0 January 12th 05 04:23 PM
Why won't formulas obey vertical alignment commands? imoux1 Excel Discussion (Misc queries) 2 December 28th 04 04:45 PM
Errors in copying formulas Frequent_User Excel Discussion (Misc queries) 1 December 12th 04 12:00 AM
delete values in several cells without deleting the formulas dranreb Excel Discussion (Misc queries) 4 December 9th 04 01:15 AM


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