ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   True/False for finding text in cells (https://www.excelbanter.com/excel-discussion-misc-queries/187060-true-false-finding-text-cells.html)

pdi805

True/False for finding text in cells
 
Is there a simple formula for checking if a cell contains a text string,
which returns a TRUE/FALSE? It is possible to combine "ISERROR" and "FIND",
but this becomes a pain when you have to do it all the time. Instead of
using the reverse logic of:

=if(iserror(find("text",A1))=FALSE,...

it would be so much easier to write:

=if(contains("text",A1),...

This is a very basic thing you can do with an autofilter, so it seems like
there would be a function that does this without returning error values. Any
suggestions? Thank you.

joel

True/False for finding text in cells
 
Find doesn't return an error, it will return zero if not found or the
character position where the string starts

=if(find("text",A1)=0,False,True)


"pdi805" wrote:

Is there a simple formula for checking if a cell contains a text string,
which returns a TRUE/FALSE? It is possible to combine "ISERROR" and "FIND",
but this becomes a pain when you have to do it all the time. Instead of
using the reverse logic of:

=if(iserror(find("text",A1))=FALSE,...

it would be so much easier to write:

=if(contains("text",A1),...

This is a very basic thing you can do with an autofilter, so it seems like
there would be a function that does this without returning error values. Any
suggestions? Thank you.


David Biddulph[_2_]

True/False for finding text in cells
 
Which version of Excel is that, Joel?
With Excel 2003, FIND returns #VALUE! if the text is not found.
--
David Biddulph

"Joel" wrote in message
...
Find doesn't return an error, it will return zero if not found or the
character position where the string starts

=if(find("text",A1)=0,False,True)


"pdi805" wrote:

Is there a simple formula for checking if a cell contains a text string,
which returns a TRUE/FALSE? It is possible to combine "ISERROR" and
"FIND",
but this becomes a pain when you have to do it all the time. Instead of
using the reverse logic of:

=if(iserror(find("text",A1))=FALSE,...

it would be so much easier to write:

=if(contains("text",A1),...

This is a very basic thing you can do with an autofilter, so it seems
like
there would be a function that does this without returning error values.
Any
suggestions? Thank you.




joel

True/False for finding text in cells
 
Your right, I was thinking of the INSTR in VBA.

"David Biddulph" wrote:

Which version of Excel is that, Joel?
With Excel 2003, FIND returns #VALUE! if the text is not found.
--
David Biddulph

"Joel" wrote in message
...
Find doesn't return an error, it will return zero if not found or the
character position where the string starts

=if(find("text",A1)=0,False,True)


"pdi805" wrote:

Is there a simple formula for checking if a cell contains a text string,
which returns a TRUE/FALSE? It is possible to combine "ISERROR" and
"FIND",
but this becomes a pain when you have to do it all the time. Instead of
using the reverse logic of:

=if(iserror(find("text",A1))=FALSE,...

it would be so much easier to write:

=if(contains("text",A1),...

This is a very basic thing you can do with an autofilter, so it seems
like
there would be a function that does this without returning error values.
Any
suggestions? Thank you.






All times are GMT +1. The time now is 12:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com