View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Tracey Tracey is offline
external usenet poster
 
Posts: 78
Default If a cell contains "preferred" then do this

Thank you Dave,

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



"Dave Peterson" wrote:

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)

SteveC wrote:

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...


--

Dave Peterson