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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using error values as parameters

Status
Not open for further replies.

iainm

Technical User
Nov 28, 2001
67
0
0
AU
I'm trying to write a formula to determine if text in one cell is contained in another cell. The romula I've built so far is =IF(SEARCH(G2,F2,1)>0,"Pass","Fail")If the text is found, Pass is returned in the box. If it's not found, #Value is returned. I've had this problem quite frequently in various programming applications where a function returns an error value rather than, say, false, or -1. I also tried using =if(error.type(Search(G2,F2,1))=3,"Fail","Pass"). This works if the text is not found, but doesn't work if it is. I need a function that doesn't return error values under normal conditions, or a way of manipulating error producing functions in non-error producing comparisons. Can anyone help
 
iainm, using your second formula, try this:

=IF(ISERROR(SEARCH(G2,F2,1)),"Fail","Pass")

which should work.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top