PC Review


Reply
Thread Tools Rate Thread

Capturing a word sequence as part of a text in a spreadsheet cell

 
 
=?Utf-8?B?VC5NYWQ=?=
Guest
Posts: n/a
 
      3rd Jul 2007
Hi all
I wonder if you can help me with a query I have. I want to find the number
of cells in a row (for example row A) which contain the word London. The
problem is that in some cell the word is contained as part of other text so
if for example the cell A1 contains the text “50 Kingsway, London, WC1” the
function =if(A1="London",1,0) returns the value of 0 failing to capture the
word “London” which is contained in the cell. Can you propose a solution? Can
I do that with VB?
The problem is that I have a spreadsheet with 80,000 cells in row A so I
need to have 80,000 cells in row B that will check the values of row A (eg B2
will perform the check in A2). This would make my desktop really slow to
perform the checks. Can you help with that issue as well? Thank you in
advance.
 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWlrZSBI?=
Guest
Posts: n/a
 
      3rd Jul 2007
Try this:-

=SUMPRODUCT(--(NOT(ISERROR(SEARCH("London",A1:A1000)))))

Mike

"T.Mad" wrote:

> Hi all
> I wonder if you can help me with a query I have. I want to find the number
> of cells in a row (for example row A) which contain the word London. The
> problem is that in some cell the word is contained as part of other text so
> if for example the cell A1 contains the text “50 Kingsway, London, WC1” the
> function =if(A1="London",1,0) returns the value of 0 failing to capture the
> word “London” which is contained in the cell. Can you propose a solution? Can
> I do that with VB?
> The problem is that I have a spreadsheet with 80,000 cells in row A so I
> need to have 80,000 cells in row B that will check the values of row A (eg B2
> will perform the check in A2). This would make my desktop really slow to
> perform the checks. Can you help with that issue as well? Thank you in
> advance.

 
Reply With Quote
 
=?Utf-8?B?VC5NYWQ=?=
Guest
Posts: n/a
 
      3rd Jul 2007
Thanks Mike it worked.


"Mike H" wrote:

> Try this:-
>
> =SUMPRODUCT(--(NOT(ISERROR(SEARCH("London",A1:A1000)))))
>
> Mike
>
> "T.Mad" wrote:
>
> > Hi all
> > I wonder if you can help me with a query I have. I want to find the number
> > of cells in a row (for example row A) which contain the word London. The
> > problem is that in some cell the word is contained as part of other text so
> > if for example the cell A1 contains the text “50 Kingsway, London, WC1” the
> > function =if(A1="London",1,0) returns the value of 0 failing to capture the
> > word “London” which is contained in the cell. Can you propose a solution? Can
> > I do that with VB?
> > The problem is that I have a spreadsheet with 80,000 cells in row A so I
> > need to have 80,000 cells in row B that will check the values of row A (eg B2
> > will perform the check in A2). This would make my desktop really slow to
> > perform the checks. Can you help with that issue as well? Thank you in
> > advance.

 
Reply With Quote
 
Ron Rosenfeld
Guest
Posts: n/a
 
      3rd Jul 2007
On Tue, 3 Jul 2007 02:08:01 -0700, T.Mad <(E-Mail Removed)>
wrote:

>Hi all
>I wonder if you can help me with a query I have. I want to find the number
>of cells in a row (for example row A) which contain the word London. The
>problem is that in some cell the word is contained as part of other text so
>if for example the cell A1 contains the text 50 Kingsway, London, WC1 the
>function =if(A1="London",1,0) returns the value of 0 failing to capture the
>word London which is contained in the cell. Can you propose a solution? Can
>I do that with VB?
>The problem is that I have a spreadsheet with 80,000 cells in row A so I
>need to have 80,000 cells in row B that will check the values of row A (eg B2
>will perform the check in A2). This would make my desktop really slow to
>perform the checks. Can you help with that issue as well? Thank you in
>advance.




One way is to use wild cards in the COUNTIF function:

=COUNTIF(rng_to_check,"*London*")


--ron
 
Reply With Quote
 
=?Utf-8?B?VC5NYWQ=?=
Guest
Posts: n/a
 
      3rd Jul 2007

And the last question:
Adopting Ron’s proposal I want check three cells in the same row to make
sure that I didn’t count the word more than once. Thus, I will use the
function =IF(COUNTIF(I1:L1,"*London*")>1,1,COUNTIF(I1:L1,"*London*")). And as
a last step I want to add all the results without using 80,000 functions thus
something like:
=SUM(IF(COUNTIF(I1:L1,"*London*")>1,1,COUNTIF(I1:L1,"*London*")):IF(COUNTIF(I80000:L80000,"*London*")>1,1,COUNTIF(I80000:L80000,"*London*"))).
How can I do that?


"Ron Rosenfeld" wrote:

> On Tue, 3 Jul 2007 02:08:01 -0700, T.Mad <(E-Mail Removed)>
> wrote:
>
> >Hi all
> >I wonder if you can help me with a query I have. I want to find the number
> >of cells in a row (for example row A) which contain the word London. The
> >problem is that in some cell the word is contained as part of other text so
> >if for example the cell A1 contains the text “50 Kingsway, London, WC1” the
> >function =if(A1="London",1,0) returns the value of 0 failing to capture the
> >word “London” which is contained in the cell. Can you propose a solution? Can
> >I do that with VB?
> >The problem is that I have a spreadsheet with 80,000 cells in row A so I
> >need to have 80,000 cells in row B that will check the values of row A (eg B2
> >will perform the check in A2). This would make my desktop really slow to
> >perform the checks. Can you help with that issue as well? Thank you in
> >advance.

>
>
>
> One way is to use wild cards in the COUNTIF function:
>
> =COUNTIF(rng_to_check,"*London*")
>
>
> --ron
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula to increment sequence only if text in a particular cell Mills Microsoft Excel New Users 5 8th Jul 2009 03:13 AM
Part 2 - Counting series of text/number sequence andrew Microsoft Excel Misc 3 22nd Jul 2008 03:52 AM
Why only part of the text is merged from excel cell into word? =?Utf-8?B?TW9oYW1lZDcwMQ==?= Microsoft Excel Misc 6 2nd Aug 2007 12:31 PM
Create a sequence when the first cell has text and numbers cfmartin76@gmail.com Microsoft Excel Discussion 5 2nd Aug 2006 04:37 PM
If-formula without false part / put in cell operations / time limited spreadsheet MW Microsoft Excel Worksheet Functions 4 20th Apr 2004 05:16 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:13 AM.