If Function

V

vacation

I want to write a formula like this: if column D contains the word zebra in
any cell, then each corresponding cell in column A will say Stripe
Can this be done?
 
S

Scoops

vacation said:
I want to write a formula like this: if column D contains the word zebra in
any cell, then each corresponding cell in column A will say Stripe
Can this be done?

Hi vacation

In A1 type =IF(D1="Zebra","Stripe","SomethingElse")

Copy down as necessary.

Regards

Steve
 
V

vacation

Thanks! That was fast. Its almost working. I neglected to say that the word
Zebra is part of a text string in the cell. I'm just looking for that word
and not the others. What do you suggest
 
D

Duke Carey

If it is case-sensitive, use FIND(), otherwise use SEARCH()

IF(not(iserror(search(D1,"Zebra"))),"Stripe","SomethingElse")
 
V

vacation

The formula is producing the result SomethingElse for each cell in column
A...like its never seeing that Zebra is found in column D at all and
therefore never returns Stripe when it should.
 
D

Duke Carey

Oops. Sorry about that..had some arguments reversed

=IF(NOT(ISERROR(SEARCH("Zebra",D84))),"Stripe","SomethingElse")
 
V

vacation

It works! Thank you!!!!

Duke Carey said:
Oops. Sorry about that..had some arguments reversed

=IF(NOT(ISERROR(SEARCH("Zebra",D84))),"Stripe","SomethingElse")
 
Top