IF - looking in a cell for a specific value

  • Thread starter Thread starter Sarah (OGI)
  • Start date Start date
S

Sarah (OGI)

In an IF statement, what do I need to write to say that if cell A1 contains
"fred", (i.e. " * fred * ") then.. "Yes".
(I'm not sure what operator is needed to say 'contains')

Any ideas?
 
In an IF statement, what do I need to write to say that if cell A1 contains
"fred", (i.e. " * fred * ") then.. "Yes".
(I'm not sure what operator is needed to say 'contains')

Any ideas?

=IF(COUNTIF(A1,"*fred*")>0,"Yes","No")

Ken Johnson
 
=IF(NOT(ISERROR(FIND("fred",A2))),"Yes","No")

or

=IF(ISERROR(FIND("fred",A1)),"No","Yes")

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

| In an IF statement, what do I need to write to say that if cell A1 contains
| "fred", (i.e. " * fred * ") then.. "Yes".
| (I'm not sure what operator is needed to say 'contains')
|
| Any ideas?
 
Back
Top