Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 358
Default String of data in a cell. Want to use 'contains' in an 'if' statem

Is there a way of writing the following?

=if ( cell 'contains' x , then write "y" , else write "n" )
The cell contains text.

Suggestions appreciated, thanks.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default String of data in a cell. Want to use 'contains' in an 'if' statem

Hi Andrew:

If InStr(cellvalue,x)0 Then
MSGBOX("Y")
else
MSGBOX("N")
endif


--
Gary's Student
gsnu200705


"Andrew" wrote:

Is there a way of writing the following?

=if ( cell 'contains' x , then write "y" , else write "n" )
The cell contains text.

Suggestions appreciated, thanks.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,726
Default String of data in a cell. Want to use 'contains' in an 'if' statem

=IF(ISNUMBER(FIND("x",A1)),"y","n")

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Andrew" wrote in message
...
Is there a way of writing the following?

=if ( cell 'contains' x , then write "y" , else write "n" )
The cell contains text.

Suggestions appreciated, thanks.



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,118
Default String of data in a cell. Want to use 'contains' in an 'if' statem

Try something like this:

For a value (or blank) in A1

This formula tests if A1 contains the letter "x"
B1: =IF(COUNTIF(A1,"*x*"),"y","n")


Does that help?
***********
Regards,
Ron

XL2002, WinXP


"Andrew" wrote:

Is there a way of writing the following?

=if ( cell 'contains' x , then write "y" , else write "n" )
The cell contains text.

Suggestions appreciated, thanks.

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
Display contents of cell in another cell as part of text string? [email protected] New Users to Excel 3 July 8th 06 07:44 PM
substitute the filename in a cell reference with a string in another cell. flummi Excel Discussion (Misc queries) 11 February 22nd 06 01:14 PM
to search for a string and affect data if it finds the string? Shwaman Excel Worksheet Functions 1 January 11th 06 12:56 AM
Copy a string text to cell if another cell not empty Pasmatos Excel Discussion (Misc queries) 0 November 25th 05 03:54 PM
IN AN IF FORMULA COPY STRING OF DATA IF A CELL IS CORRECT Might also be another tricky formula Setting up and Configuration of Excel 1 October 12th 05 09:21 PM


All times are GMT +1. The time now is 03:35 AM.

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

About Us

"It's about Microsoft Excel"