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

Nested Formula

Status
Not open for further replies.

jmuscat

Instructor
May 22, 2002
54
AU
I have a worksheet where depending on what is in the description column regulates what will be inserted into another column. In the description column there may be several words not included in my formula as well, so I cannot use lookup formula.
The first part of of IF statement works, if true, but the second (if false) does not. Where have I gone wrong.
My formula is:
=IF(FIND("high/low",B35,1),"high/low",OR(FIND("on/off",B35,1),"on/off","mod"))
 
I don't think the FIND function is the one you want. The find funtion only brings back the starting position of the text you want. As far as your IF statement, you should only have 3 arguements, logical test, value if true, value if false.

Since I can't think of another funtion right now, here is a way to use the Find function.

=IF(ISERROR(FIND("high/low",B35)>=0),IF(ISERROR(FIND("on/off",B35)>=0),"mod","on/off"),"high/low")))


Try that and see if it works. I tried it with fake data and it did. Here is what I realized. FIND brings back the postion of the text. IF will determine if that position is greater or equal to zero, which means that it IS in the text. Well if it isn't, it brings back an error. So the ISERROR captures that error and gives you the answer you need.

And maybe someone else came up with something simpler. :)

Dawn
Dawn
 
Thanks for the information, you put me on the right track
=IF(ISERROR(FIND("on/off",B9,1)),IF(ISERROR(FIND("mod",B9,1)),IF(ISERROR(FIND("high/low",B9,1)),"","high/low"),"mod"),"on/off")
and works fine.
Many thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top