Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 58
Default Need simple formula to find one string in another

I need a formula which returns Y if a cell contains a string and N if not.

Here's a start: IF(FIND("XXX",C3),"Y","N"). But the trouble is that if the
target string is not found, it returns a #VALUE! error.

I can of course fix that by something like
IF(ISERROR(FIND("XXX",C3),"N","Y"). But this seems unnecessarily awkward. Is
there a simpler solution?

I'm using Excel 2003.

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,420
Default Need simple formula to find one string in another

Try

=IF(ISNUMBER(FIND("XXX",C3)),"Y","N").

--
__________________________________
HTH

Bob

"Eric_NY" wrote in message
...
I need a formula which returns Y if a cell contains a string and N if not.

Here's a start: IF(FIND("XXX",C3),"Y","N"). But the trouble is that if the
target string is not found, it returns a #VALUE! error.

I can of course fix that by something like
IF(ISERROR(FIND("XXX",C3),"N","Y"). But this seems unnecessarily awkward.
Is
there a simpler solution?

I'm using Excel 2003.

Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Need simple formula to find one string in another

Is there a simpler solution?

It depends on ones definition of "simpler".

You can try this if you're not trying to match the case of "XXX".

=IF(COUNTIF(C3,"*XXX*"),"Y","N")

FIND is case sensitive. Using FIND:

xXx does not match XXX.

Using COUNTIF, case doesn't matter.

--
Biff
Microsoft Excel MVP


"Eric_NY" wrote in message
...
I need a formula which returns Y if a cell contains a string and N if not.

Here's a start: IF(FIND("XXX",C3),"Y","N"). But the trouble is that if the
target string is not found, it returns a #VALUE! error.

I can of course fix that by something like
IF(ISERROR(FIND("XXX",C3),"N","Y"). But this seems unnecessarily awkward.
Is
there a simpler solution?

I'm using Excel 2003.

Thanks.



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 58
Default Need simple formula to find one string in another

Thanks to Bob and T. Valko for your suggestions.

"Eric_NY" wrote:

I need a formula which returns Y if a cell contains a string and N if not.

Here's a start: IF(FIND("XXX",C3),"Y","N"). But the trouble is that if the
target string is not found, it returns a #VALUE! error.

I can of course fix that by something like
IF(ISERROR(FIND("XXX",C3),"N","Y"). But this seems unnecessarily awkward. Is
there a simpler solution?

I'm using Excel 2003.

Thanks.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Need simple formula to find one string in another

You're welcome!

--
Biff
Microsoft Excel MVP


"Eric_NY" wrote in message
...
Thanks to Bob and T. Valko for your suggestions.

"Eric_NY" wrote:

I need a formula which returns Y if a cell contains a string and N if
not.

Here's a start: IF(FIND("XXX",C3),"Y","N"). But the trouble is that if
the
target string is not found, it returns a #VALUE! error.

I can of course fix that by something like
IF(ISERROR(FIND("XXX",C3),"N","Y"). But this seems unnecessarily awkward.
Is
there a simpler solution?

I'm using Excel 2003.

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
Mind-numbing simple data validation ... string from 1 to 64 chars Will Finkle Excel Worksheet Functions 6 September 16th 07 03:10 PM
Find String in another string - only between spaces Nir Excel Worksheet Functions 9 November 2nd 06 11:31 AM
Find Many String options in ONE String Nir Excel Worksheet Functions 6 October 26th 06 07:13 AM
find text in a string formula Todd Excel Worksheet Functions 5 June 2nd 06 04:12 AM
search string command to answer simple Yes or No [email protected] Excel Worksheet Functions 0 February 21st 06 04:01 PM


All times are GMT +1. The time now is 06:23 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"