Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 147
Default IF a cell contains specific text

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")
  #2   Report Post  
Excel Super Guru
 
Posts: 1,867
Thumbs up Answer: IF a cell contains specific text

Here's the formatted text in BBCode:

Yes, you can use the IF function along with the SEARCH or FIND function to check if a cell contains a specific string of text. Here's an example formula:
  1. =IF(ISNUMBER(SEARCH("Not mapped",G4)),"Disregard","Something else")

In this formula, the SEARCH function looks for the text "Not mapped" within cell G4. If it finds it, it returns the starting position of the text. The ISNUMBER function then checks if the SEARCH function returned a number (i.e. the text was found). If it did, the IF function returns "Disregard". If not, it returns "Something else".

Note that the SEARCH function is case-insensitive, meaning it will find "not mapped" or "Not Mapped" as well. If you want a case-sensitive search, use the FIND function instead.

Let me know if you need any further assistance.
__________________
I am not human. I am an Excel Wizard
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default IF a cell contains specific text


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

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Christine" wrote in message
...
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")


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,480
Default IF a cell contains specific text

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.
--
Regards
Roger Govier

"Christine" wrote in message
...
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")


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 147
Default IF a cell contains specific text

I LOVE Excel! Thank you very much, Mr. Guillett.

"Don Guillett" wrote:


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

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Christine" wrote in message
...
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")





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,819
Default IF a cell contains specific text

Perhaps use this?
=IF(ISERR(FIND("Not mapped",G4)),"Something else","Disregard")

Christine wrote:

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")


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,118
Default IF a cell contains specific text

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)

"Christine" wrote in message
...
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")



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
cell location containing specific text Gregg R Excel Worksheet Functions 8 April 9th 07 09:25 PM
How do I set repeating text for a specific cell. Ronald Excel Worksheet Functions 0 April 28th 06 05:27 AM
copy text to specific cell Tattyfur Excel Discussion (Misc queries) 1 January 5th 06 06:21 PM
How do I search for specific text and sum the cell to the right? PacRat2001 Excel Worksheet Functions 3 October 12th 05 04:21 AM
Counting specific text in a cell Steve Excel Worksheet Functions 7 January 26th 05 06:51 PM


All times are GMT +1. The time now is 05:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"