Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,670
Default How to search for text within a cell?

Does anyone have any suggestions on how to search for text within a cell?
such as
in cell A1, which contain a text 'I am a boy", then I would like to search
for text "boy" within cell A1, if cell A1 contains this text, then return 1
in cell B1, else return 0.
Does anyone have any suggestions
Thank you in advance
Eric
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default How to search for text within a cell?

On Sat, 12 May 2007 03:52:00 -0700, Eric
wrote:

Does anyone have any suggestions on how to search for text within a cell?
such as
in cell A1, which contain a text 'I am a boy", then I would like to search
for text "boy" within cell A1, if cell A1 contains this text, then return 1
in cell B1, else return 0.
Does anyone have any suggestions
Thank you in advance
Eric


=COUNTIF(A1,"*boy*")
--ron
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default How to search for text within a cell?

In B1 enter:

=IF(LEN(A1)=LEN(SUBSTITUTE(A1,"boy","")),0,1)

--
Gary''s Student - gsnu200721
  #4   Report Post  
Posted to microsoft.public.excel.misc
bj bj is offline
external usenet poster
 
Posts: 1,397
Default How to search for text within a cell?

among others
=if(iserror(find("boy",a1)),0,1)

"Eric" wrote:

Does anyone have any suggestions on how to search for text within a cell?
such as
in cell A1, which contain a text 'I am a boy", then I would like to search
for text "boy" within cell A1, if cell A1 contains this text, then return 1
in cell B1, else return 0.
Does anyone have any suggestions
Thank you in advance
Eric

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,670
Default Thank everyone for suggestions

Thank everyone a lot
Eric


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,670
Default How to search for text within a cell?

Thank everyone for suggestions

Does anyone have any suggestions? if the text is within a formula, such
=C:\boy\[Data.xls]sheet!A1, does anyone know how to return 1 if the formula
contains "boy", else return 0.
Thank for any suggestions
Eric


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,572
Default How to search for text within a cell?

You might care to try this, using XL 4.0 macros.

First a caveat:
This should be used in XL02 or later.
Earlier versions *will* crash when copying this type of formula to other
WBs.
Can be used in earlier versions, as long as copying is restricted to sheets
within
the existing WB.

So then ... say your link formula is in A1.
Start my creating a 'named' formula that will return the actual formula text
from A1;

Click in B1, then,
<Insert <Name <Define,
In the "Names In Workbook" box, enter a short name, say
form
for formula.
In the "Refers To" box, replace whatever's there with this formula:
=GET.CELL(6,A1)
Then <OK


What you have now is a 'relative' *named formula* that when entered in *any*
cell, will return the contents of the cell (text, data, formulas) from the
*previous* column.

So, with A1 containing your formula of:
=C:\boy\[Data.xls]sheet!A1

In B1 enter:
=form

To get the contents of A1.
You'll see the text of your formula displayed.

NOW, simply wrap that in another formula to return the "1" you're looking
for:

=--ISNUMBER(SEARCH("boy",form))

Don't forget, the
=form
formula *only* looks at the cell in the *preceding* column to display it's
contents.

If you would want it to return the cell *2* columns over, click in C1,
instead of B1, when you enter the get.cell formula.
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

"Eric" wrote in message
...
Thank everyone for suggestions

Does anyone have any suggestions? if the text is within a formula, such
=C:\boy\[Data.xls]sheet!A1, does anyone know how to return 1 if the

formula
contains "boy", else return 0.
Thank for any suggestions
Eric



  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,670
Default How to search for text within a cell?

Thank everyone very much for suggestions
Eric

"Ragdyer" wrote:

You might care to try this, using XL 4.0 macros.

First a caveat:
This should be used in XL02 or later.
Earlier versions *will* crash when copying this type of formula to other
WBs.
Can be used in earlier versions, as long as copying is restricted to sheets
within
the existing WB.

So then ... say your link formula is in A1.
Start my creating a 'named' formula that will return the actual formula text
from A1;

Click in B1, then,
<Insert <Name <Define,
In the "Names In Workbook" box, enter a short name, say
form
for formula.
In the "Refers To" box, replace whatever's there with this formula:
=GET.CELL(6,A1)
Then <OK


What you have now is a 'relative' *named formula* that when entered in *any*
cell, will return the contents of the cell (text, data, formulas) from the
*previous* column.

So, with A1 containing your formula of:
=C:\boy\[Data.xls]sheet!A1

In B1 enter:
=form

To get the contents of A1.
You'll see the text of your formula displayed.

NOW, simply wrap that in another formula to return the "1" you're looking
for:

=--ISNUMBER(SEARCH("boy",form))

Don't forget, the
=form
formula *only* looks at the cell in the *preceding* column to display it's
contents.

If you would want it to return the cell *2* columns over, click in C1,
instead of B1, when you enter the get.cell formula.
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

"Eric" wrote in message
...
Thank everyone for suggestions

Does anyone have any suggestions? if the text is within a formula, such
=C:\boy\[Data.xls]sheet!A1, does anyone know how to return 1 if the

formula
contains "boy", else return 0.
Thank for any suggestions
Eric




  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,670
Default How to search for text within a cell?

Thank everyone for your suggesitons

=GET.CELL(6,A1)
Could you please tell me what the number 6 mean in this formula?
Thank you
Eric


"Ragdyer" wrote:

You might care to try this, using XL 4.0 macros.

First a caveat:
This should be used in XL02 or later.
Earlier versions *will* crash when copying this type of formula to other
WBs.
Can be used in earlier versions, as long as copying is restricted to sheets
within
the existing WB.

So then ... say your link formula is in A1.
Start my creating a 'named' formula that will return the actual formula text
from A1;

Click in B1, then,
<Insert <Name <Define,
In the "Names In Workbook" box, enter a short name, say
form
for formula.
In the "Refers To" box, replace whatever's there with this formula:
=GET.CELL(6,A1)
Then <OK


What you have now is a 'relative' *named formula* that when entered in *any*
cell, will return the contents of the cell (text, data, formulas) from the
*previous* column.

So, with A1 containing your formula of:
=C:\boy\[Data.xls]sheet!A1

In B1 enter:
=form

To get the contents of A1.
You'll see the text of your formula displayed.

NOW, simply wrap that in another formula to return the "1" you're looking
for:

=--ISNUMBER(SEARCH("boy",form))

Don't forget, the
=form
formula *only* looks at the cell in the *preceding* column to display it's
contents.

If you would want it to return the cell *2* columns over, click in C1,
instead of B1, when you enter the get.cell formula.
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

"Eric" wrote in message
...
Thank everyone for suggestions

Does anyone have any suggestions? if the text is within a formula, such
=C:\boy\[Data.xls]sheet!A1, does anyone know how to return 1 if the

formula
contains "boy", else return 0.
Thank for any suggestions
Eric




  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,572
Default How to search for text within a cell?

You can download a file to give you information on the XL 4.0 macros:

http://tinyurl.com/seb4r

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Eric" wrote in message
...
Thank everyone for your suggesitons

=GET.CELL(6,A1)
Could you please tell me what the number 6 mean in this formula?
Thank you
Eric


"Ragdyer" wrote:

You might care to try this, using XL 4.0 macros.

First a caveat:
This should be used in XL02 or later.
Earlier versions *will* crash when copying this type of formula to other
WBs.
Can be used in earlier versions, as long as copying is restricted to

sheets
within
the existing WB.

So then ... say your link formula is in A1.
Start my creating a 'named' formula that will return the actual formula

text
from A1;

Click in B1, then,
<Insert <Name <Define,
In the "Names In Workbook" box, enter a short name, say
form
for formula.
In the "Refers To" box, replace whatever's there with this formula:
=GET.CELL(6,A1)
Then <OK


What you have now is a 'relative' *named formula* that when entered in

*any*
cell, will return the contents of the cell (text, data, formulas) from

the
*previous* column.

So, with A1 containing your formula of:
=C:\boy\[Data.xls]sheet!A1

In B1 enter:
=form

To get the contents of A1.
You'll see the text of your formula displayed.

NOW, simply wrap that in another formula to return the "1" you're

looking
for:

=--ISNUMBER(SEARCH("boy",form))

Don't forget, the
=form
formula *only* looks at the cell in the *preceding* column to display

it's
contents.

If you would want it to return the cell *2* columns over, click in C1,
instead of B1, when you enter the get.cell formula.
--
HTH,

RD


--------------------------------------------------------------------------

-
Please keep all correspondence within the NewsGroup, so all may benefit

!

--------------------------------------------------------------------------

-

"Eric" wrote in message
...
Thank everyone for suggestions

Does anyone have any suggestions? if the text is within a formula,

such
=C:\boy\[Data.xls]sheet!A1, does anyone know how to return 1 if the

formula
contains "boy", else return 0.
Thank for any suggestions
Eric





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
Search text within cell [email protected] Excel Worksheet Functions 2 July 21st 06 02:17 PM
format cell to search text in another cell Newbie Bob Excel Discussion (Misc queries) 2 October 25th 05 01:23 AM
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
How can I search for more than one text character in a cell? Dolores Excel Worksheet Functions 3 May 19th 05 09:44 PM
How do I search for more than one text character in one cell? Dolores Excel Worksheet Functions 0 May 19th 05 06:54 PM


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

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"