Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Jig Bhakta
 
Posts: n/a
Default Counting the number of times a word appears in a worksheet

Hi,

I want to have a formula in a cell that counts the number of time a certain
word appears in any cell in a worksheet. i've tried using count but it only
counts for numbers, not text.

Thanks,

Jignesh.
  #2   Report Post  
Harlan Grove
 
Posts: n/a
Default

Jig Bhakta wrote...
I want to have a formula in a cell that counts the number of time a

certain
word appears in any cell in a worksheet. i've tried using count but

it only
counts for numbers, not text.


If you want to count cells containing a particular substring, so if
your substring were "XYZ" and cell X99 contained "123XYZ456XYZ789" cell
XYZ would count as one match, use COUNTIF, e.g.,

=COUNTIF(Range,"*"&<YourSubstringHere&"*")

If you want to count every instance including multiple instances in the
same cell as separate matches, use

=SUMPRODUCT((LEN(Range)-LEN(SUBSTITUTE(Range,<YourSubstringHere,""))
/LEN(<YourSubstringHere))

  #3   Report Post  
Peo Sjoblom
 
Posts: n/a
Default

One way

=SUMPRODUCT((LEN(A1:F30)-(LEN(SUBSTITUTE(A1:F30,"word",""))))/LEN("word"))


Regards,

Peo Sjoblom

"Jig Bhakta" wrote in message
...
Hi,

I want to have a formula in a cell that counts the number of time a

certain
word appears in any cell in a worksheet. i've tried using count but it

only
counts for numbers, not text.

Thanks,

Jignesh.



  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default

Missed a bracket

=SUMPRODUCT((LEN(Range)-LEN(SUBSTITUTE(Range,<YourSubstringHere,"")))
/LEN(<YourSubstringHere))


"Harlan Grove" wrote in message
oups.com...
Jig Bhakta wrote...
I want to have a formula in a cell that counts the number of time a

certain
word appears in any cell in a worksheet. i've tried using count but

it only
counts for numbers, not text.


If you want to count cells containing a particular substring, so if
your substring were "XYZ" and cell X99 contained "123XYZ456XYZ789" cell
XYZ would count as one match, use COUNTIF, e.g.,

=COUNTIF(Range,"*"&<YourSubstringHere&"*")

If you want to count every instance including multiple instances in the
same cell as separate matches, use

=SUMPRODUCT((LEN(Range)-LEN(SUBSTITUTE(Range,<YourSubstringHere,""))
/LEN(<YourSubstringHere))



  #5   Report Post  
Jig Bhakta
 
Posts: n/a
Default

The formula given by Peo worked....

Thanks.

"Peo Sjoblom" wrote:

One way

=SUMPRODUCT((LEN(A1:F30)-(LEN(SUBSTITUTE(A1:F30,"word",""))))/LEN("word"))


Regards,

Peo Sjoblom

"Jig Bhakta" wrote in message
...
Hi,

I want to have a formula in a cell that counts the number of time a

certain
word appears in any cell in a worksheet. i've tried using count but it

only
counts for numbers, not text.

Thanks,

Jignesh.




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
how do i link a number of worksheets to one master worksheet? Rusty Excel Worksheet Functions 0 January 24th 05 09:49 AM
Weekly Transaction Processing Ralph Howarth Excel Worksheet Functions 4 January 19th 05 06:37 AM
Inserting worksheet in Word Connie Martin Excel Discussion (Misc queries) 0 January 11th 05 07:19 PM
Whats the function to count the total times a word is displayed Monk Excel Discussion (Misc queries) 3 December 10th 04 11:39 PM
Can the number of times undo is used in Excel 2002 be increased? Austrian Hannes Setting up and Configuration of Excel 2 December 6th 04 06:54 PM


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