Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default Check for NON-presence of a string in another string

I am looking for a way to find out whether a certain string does NOT appear
in another string.
In that case FIND will give an error.

I tried to bypass this by using NOT(ISERROR(...), but this doen't seem to
work.

I tried using NOT(ISERROR(FIND("10";$BG20;1)<0 to check if "10" is prsent
in BG20
in this formula :
=IF(AND( condition 1; condition 2);
IF( $BG$1="M"; $BG20;
IF( AND($BG$1="K";
NOT(ISERROR(FIND("10";$BG20;1))));
$BG20;
IF( AND($BG$1="J";
NOT(ISERROR(FIND("10";$BG20;1))));
$BG20)));
""
)
but for BG1 = "M", I still get "FALSE" instaed of an empty field.

What am I doing wrong ?
Tx in advance,
Gilbert


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Check for NON-presence of a string in another string

Instead of NOT(ISERROR(FIND(... you can use ISNUMBER(FIND(...

Check that BG1 only contains "M" and not "M " (i.e extra spaces in
there).

You wont actually get an empty field returned if BG1 does equal "M",
as your formula will return BG20. If BG20 is blank then your formula
will return 0.

Hope this helps.

Pete

On Dec 11, 10:58*am, "G.P.N.L. c.v.a." wrote:
I am looking for a way to find out whether a certain string does NOT appear
in another string.
In that case FIND will give an error.

I tried to bypass this by using NOT(ISERROR(...), but this doen't seem to
work.

I tried using NOT(ISERROR(FIND("10";$BG20;1)<0 to check if "10" is prsent
in BG20
in this formula :
=IF(AND( *condition 1; condition 2);
* * * IF( * * * * *$BG$1="M"; *$BG20;
* * * IF( *AND($BG$1="K";
* * * * * * * * * * * * * * *NOT(ISERROR(FIND("10";$BG20;1))));
$BG20;
* * * IF( *AND($BG$1="J";
* * * * * * * * * * * * * * *NOT(ISERROR(FIND("10";$BG20;1))));
$BG20)));
* * * * * ""
* * * * *)
but for BG1 = "M", I still get "FALSE" instaed of an empty field.

What am I doing wrong ?
Tx in advance,
Gilbert


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 510
Default Check for NON-presence of a string in another string

=(LEN(SUBSTITUTE(A1,"xxx",""))=LEN(A1))

Arvi Laanemets


"G.P.N.L. c.v.a." wrote in message
...
I am looking for a way to find out whether a certain string does NOT appear
in another string.
In that case FIND will give an error.

I tried to bypass this by using NOT(ISERROR(...), but this doen't seem to
work.

I tried using NOT(ISERROR(FIND("10";$BG20;1)<0 to check if "10" is prsent
in BG20
in this formula :
=IF(AND( condition 1; condition 2);
IF( $BG$1="M"; $BG20;
IF( AND($BG$1="K";
NOT(ISERROR(FIND("10";$BG20;1)))); $BG20;
IF( AND($BG$1="J";
NOT(ISERROR(FIND("10";$BG20;1)))); $BG20)));
""
)
but for BG1 = "M", I still get "FALSE" instaed of an empty field.

What am I doing wrong ?
Tx in advance,
Gilbert



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Check for NON-presence of a string in another string


G.P.N.L. c.v.a.;583982 Wrote:
I am looking for a way to find out whether a certain string does NOT
appear
in another string.
In that case FIND will give an error.

I tried to bypass this by using NOT(ISERROR(...), but this doen't seem
to
work.

I tried using NOT(ISERROR(FIND("10";$BG20;1)<0 to check if "10" is
prsent
in BG20
in this formula :
=IF(AND( condition 1; condition 2);
IF( $BG$1="M"; $BG20;
IF( AND($BG$1="K";
NOT(ISERROR(FIND("10";$BG20;1))));
$BG20;
IF( AND($BG$1="J";
NOT(ISERROR(FIND("10";$BG20;1))));
$BG20)));
""
)
but for BG1 = "M", I still get "FALSE" instaed of an empty field.

What am I doing wrong ?
Tx in advance,
Gilbert


Try losing the '<0':
=NOT(ISERROR(FIND("10",$BG20,1)))
or rather
=NOT(ISERROR(FIND("10";$BG20;1)))
Works here.


--
p45cal

*p45cal*
------------------------------------------------------------------------
p45cal's Profile: 558
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=161656

Microsoft Office Help

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default Check for NON-presence of a string in another string

You can use this test in your IF function calls...

COUNTIF(BG20,"*10*")0

which will report TRUE if 10 is contained in BG20 and FALSE if it is not.

--
Rick (MVP - Excel)


"G.P.N.L. c.v.a." wrote in message
...
I am looking for a way to find out whether a certain string does NOT appear
in another string.
In that case FIND will give an error.

I tried to bypass this by using NOT(ISERROR(...), but this doen't seem to
work.

I tried using NOT(ISERROR(FIND("10";$BG20;1)<0 to check if "10" is prsent
in BG20
in this formula :
=IF(AND( condition 1; condition 2);
IF( $BG$1="M"; $BG20;
IF( AND($BG$1="K";
NOT(ISERROR(FIND("10";$BG20;1)))); $BG20;
IF( AND($BG$1="J";
NOT(ISERROR(FIND("10";$BG20;1)))); $BG20)));
""
)
but for BG1 = "M", I still get "FALSE" instaed of an empty field.

What am I doing wrong ?
Tx in advance,
Gilbert


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
Identifying the presence of a randomly ordered text string in a cell AG[_3_] Excel Worksheet Functions 2 September 3rd 09 10:21 PM
Check if variable contains a string Ted M H Excel Worksheet Functions 5 December 22nd 08 03:58 PM
Check for character in string dksaluki Excel Discussion (Misc queries) 3 December 11th 07 12:53 PM
COUNTIF according to presence of string within text Ingeniero1 Excel Worksheet Functions 5 February 1st 06 06:43 PM
Excel VBA - Check/Format String magix Excel Discussion (Misc queries) 1 November 6th 05 11:02 AM


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