Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search formula in Excel

Status
Not open for further replies.

dunner44

MIS
Jul 27, 2004
32
US
I am trying to write a formula in Excel that includes the 'search' function and the 'or' function, but I keep getting an error. Here is what I wrote...

=IF(ISERROR(SEARCH(or(G3="contact", G3="contacting"))) = FALSE, 1, 0)

Any suggestions?

TIA
 
=IF(ISERROR(OR(SEARCH(G3="contact")=FALSE, SEARCH(G3="contacting")=FALSE)), 1, 0)

[Blue]Blue[/Blue] [Dragon]

If I wasn't Blue, I would just be a Dragon...
 
Hi dunner44,

What are you trying to achieve?

The SEARCH Function looks for a substring. As any cell which contains "contacting" will also contain "contact", SEARCH will produce the same result for both. This cannot be what you want, even with correct syntax.


Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
My fault on the formula, haven't used the SEARCH function in a long time, this may be what you are looking for:

=IF(OR(ISERROR(SEARCH("contact",G3)),ISERROR(SEARCH("contacting",G3))),1,0)


[Blue]Blue[/Blue] [Dragon]

If I wasn't Blue, I would just be a Dragon...
 
Hi Blue,

Even when you correct your syntax - if SEARCH("contact"G3) gives an error then SEARCH("contact[blue]ing[/blue]"G3) will also give an error - so there is no need for the second SEARCH at all.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
Yeap, that is true, guilty of cut and paste...

[Blue]Blue[/Blue] [Dragon]

If I wasn't Blue, I would just be a Dragon...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top