If a cell contains "preferred" then do this

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

here is what I got =if(a1="*preferred*","B","A")

what do I do to make it work?

thanks... Steve

trying to match partial text in a cell

a1 might have "preferred chimichangas" or "preferred nonsense" for example...
 
One way:

=if(countif(a1,"*preferred*")>0,"B","A")

another:
=if(isnumber(search("preferred",a1)),"B","A")

if you want to make it case sensitive, replace "search" with "find".

(=Countif() is not case sensitive)
 
Thank you Dave,

You saved me hours of work!!!!!
I needed the same formula as well!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top