Using IF statement with AND?

  • Thread starter Thread starter Scott
  • Start date Start date
S

Scott

I am trying do something that compares 2 things and then
brings something back like this.

If B2=B3 AND A2= "DOG"

Then I would bring back "CAT"

Else I would bring back whatever is in Cell A2

Thanks
Scott
 
=IF(AND(B2=B3,A2="DOG"),"CAT",A2)

note that if B2 and B3 are blank and A2 = "DOG" it will
return "CAT", so you might want to use something against that like

=IF(AND(B2<>"",B2=B3,A2="DOG"),"CAT",A2)
--

Regards,

Peo Sjoblom

(No private emails please, for everyone's
benefit keep the discussion in the newsgroup/forum)
 
Back
Top