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

using IF with LIKE 2

Status
Not open for further replies.

CFNB

Programmer
Feb 15, 2007
36
CA
Hello,

if column 1 contains the word 'snow', i would like column 3 to show the word 'snow'.

if column 1 were made of only one word, it would have been easy: IF(A1="SNOW", "SNOW","")

How do I do it when column 1 contains any string that might include the word 'snow'?

Thanks.
 
=IF(SEARCH("Snow",A1),"Snow")

Regards
Ken..........

----------------------------------------------------------------------------
[peace]It's easier to beg forgiveness than ask permission[2thumbsup]
----------------------------------------------------------------------------
 
thanks KenWright but it did not work!
I get #value! error

I even tried : =IF(SEARCH(A1,"Snow"),"Snow")
=IF(SEARCH("Snow",A1),"Snow","")
 
Ken's formula gives results of either Snow or #VALUE! error. If you want a formula to return either Snow or blank use this:
Code:
=IF(ISERROR(SEARCH("Snow",A1)),"","Snow")
( not case sensitive ... to make it case sensitive use Find instead of Search ) )


Cheers, Glenn.

Did you hear about the literalist show-jumper? He broke his nose jumping against the clock.
 
My pleasure :-D

Cheers, Glenn.

Did you hear about the literalist show-jumper? He broke his nose jumping against the clock.
 
One less function call then :)

=IF(COUNTIF(A1,"*Snow*"),"Snow","")

Regards
Ken............

----------------------------------------------------------------------------
[peace]It's easier to beg forgiveness than ask permission[2thumbsup]
----------------------------------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top