# Microsoft Office Application Help - Excel Help forum > Excel General >  >  If a Cell Does Not Contain "text" Return a Value

## Ocean Zhang

How do I write a formula for if cell a1 does not contain "abc" then return the value "Happy 4th of July" otherwise ""?

eg: "dkdkdkdk" should give me the value Happy 4th of July.
"I like to sing my abcs" should return a blank cell.

Thanks!

----------


## Haseeb A

Hello,

Assume the text is in A1, in B1 enter,

=IF(ISERROR(SEARCH("abc",A1)),"Happy 4th of July","")

Or,

=IF(COUNTIF(A1,"*abc*"),"","Happy 4th of July")

----------


## Ocean Zhang

that worked great. thanks!

----------


## Benfella

hi

please help me

=COUNTIF(J6:J24,"Disqualified")  

countif that range has the text disqualified.  if not make 0 in formula

----------


## FlameRetired

*Administrative Note:*

Welcome to the forum.  :Smilie: 

We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original. Please start a new thread - See Forum rule #4

If you are not familiar with how to start a new thread see the FAQ: How to start a new thread

----------

