IF a cell contains specific text

C

Christine

Is there a way to include in a formula a command that will check if a cell
contains a specific string of text? For example, if cell G4 contains "Not
mapped" (and more text), then "Disregard" will be indicated in cell C4 -
IF(G4 contains "Not mapped","Disregard","Something else")
 
D

Don Guillett

Look in the help index for FIND & SEARCH. Then use within an IF formula
if(>0,1,2)
 
R

Roger Govier

Hi Christine
Try
=IF(ISNUMBER(SEARCH("Not Mapped",G4)),"Disregard","Something Else")

Search is not case sensitive, so "not mapped" would be found as well.
FIND() is case sensitive, so substitute that if you want a case sensitive
search

You nee the ISNUMBER() function as well, because both Search and Find return
the position on the string, an will give a #N/A error if the string is not
found.

EXACT() tests to see if the string is exactly the same, and returns True or
False, so the Isnumber part would not be needed.
=IF(EXACT("NOt MaPPed",G7),"Disregard","Something Else")
would look for the mixture of upper case and lower case letters in the cell
being exactly the same as type in the formula.
 
R

Ron Coderre

Try this:

=IF(COUNTIF(G4,"*Not mapped*"),"Disregard","Something else")

Is that something you can work with?
Post back if you have more questions.
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)
 

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

Top