Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ingeniero1
 
Posts: n/a
Default COUNTIF according to presence of string within text


I have 2700 rows where one of the columns is a description of an
instrument. As you can imagine, the sky is the limit with the way the
descriptions are written.

Using the Auto-Filter feature, I can filter the cells in this column
according to whether they contain or not-contain any text I choose. But
then I have to count the rows returned.

What I am looking for is to count the cells that contain a word or
combination of words within a longer string of text. Is there a way to
use COUNTIF based on any of the contents of a cell?

Thanks!

Alex


--
Ingeniero1
------------------------------------------------------------------------
Ingeniero1's Profile: http://www.excelforum.com/member.php...fo&userid=4029
View this thread: http://www.excelforum.com/showthread...hreadid=507326

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
GerryK
 
Posts: n/a
Default COUNTIF according to presence of string within text

In a cell somewhere on your sheet place:
=SUMPRODUCT(LEN(C2:C2700)-LEN(SUBSTITUTE(C2:C2700,I2,"")))/LEN(I2)

I2 is the cell to enter text for searching column C (Modify as needed)

HTH
GerryK

"Ingeniero1" wrote:


I have 2700 rows where one of the columns is a description of an
instrument. As you can imagine, the sky is the limit with the way the
descriptions are written.

Using the Auto-Filter feature, I can filter the cells in this column
according to whether they contain or not-contain any text I choose. But
then I have to count the rows returned.

What I am looking for is to count the cells that contain a word or
combination of words within a longer string of text. Is there a way to
use COUNTIF based on any of the contents of a cell?

Thanks!

Alex


--
Ingeniero1
------------------------------------------------------------------------
Ingeniero1's Profile: http://www.excelforum.com/member.php...fo&userid=4029
View this thread: http://www.excelforum.com/showthread...hreadid=507326


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Coderre
 
Posts: n/a
Default COUNTIF according to presence of string within text


Alex

If you're already using AutoFilter, you can probably use this version
of the SUBTOTAL function:

With a data list in Cells A5:A1000

A2: =SUBTOTAL(3,A5:A1000)-1
The minus 1 is to remove the Header count.

After filtering, the formula will return the count of the un-hidden
records.


Other options for the first argument of the the SUBTOTAL function:
Function_Num Function
1 AVERAGE
2 COUNT
3 COUNTA
4 MAX
5 MIN
6 PRODUCT
7 STDEV
8 STDEVP
9 SUM
10 VAR
11 VARP

Does that help?

Regards,
Ron


--
Ron Coderre
------------------------------------------------------------------------
Ron Coderre's Profile: http://www.excelforum.com/member.php...o&userid=21419
View this thread: http://www.excelforum.com/showthread...hreadid=507326

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default COUNTIF according to presence of string within text

If you want to count them after filtering, take a look at SUBTOTAL in Help,
it will do what you want.

If you want to count them without filtering, try

=COUNTIF(B:B,"*violin*")

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Ingeniero1" wrote
in message ...

I have 2700 rows where one of the columns is a description of an
instrument. As you can imagine, the sky is the limit with the way the
descriptions are written.

Using the Auto-Filter feature, I can filter the cells in this column
according to whether they contain or not-contain any text I choose. But
then I have to count the rows returned.

What I am looking for is to count the cells that contain a word or
combination of words within a longer string of text. Is there a way to
use COUNTIF based on any of the contents of a cell?

Thanks!

Alex


--
Ingeniero1
------------------------------------------------------------------------
Ingeniero1's Profile:

http://www.excelforum.com/member.php...fo&userid=4029
View this thread: http://www.excelforum.com/showthread...hreadid=507326



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
CLR
 
Posts: n/a
Default COUNTIF according to presence of string within text

You can also use the SUBTOTAL formula with your AutoFilter sort, as it
ignores any hidden rows...only counting the ones you've filtered out.....

=SUBTOTAL(2,YourRange)


Vaya con Dios,
Chuck, CABGx3



"Ingeniero1" wrote:


I have 2700 rows where one of the columns is a description of an
instrument. As you can imagine, the sky is the limit with the way the
descriptions are written.

Using the Auto-Filter feature, I can filter the cells in this column
according to whether they contain or not-contain any text I choose. But
then I have to count the rows returned.

What I am looking for is to count the cells that contain a word or
combination of words within a longer string of text. Is there a way to
use COUNTIF based on any of the contents of a cell?

Thanks!

Alex


--
Ingeniero1
------------------------------------------------------------------------
Ingeniero1's Profile: http://www.excelforum.com/member.php...fo&userid=4029
View this thread: http://www.excelforum.com/showthread...hreadid=507326




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ingeniero1
 
Posts: n/a
Default COUNTIF according to presence of string within text


Timely good replies!

This one works best for what I need.
=COUNTIF(B:B,"*violin*") / Bob P.

It even works entering (within asterisks) what I want to search in
another cell.
=COUNTIF(B:B,M2)
and M2 will have *search text*

I entered 10 *search text* in M2:M11 and got a list of the occurrences
for those 10.

Thanks!!


--
Ingeniero1
------------------------------------------------------------------------
Ingeniero1's Profile: http://www.excelforum.com/member.php...fo&userid=4029
View this thread: http://www.excelforum.com/showthread...hreadid=507326

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
Text string and sum michaelp Excel Worksheet Functions 4 November 14th 05 09:49 PM
Remove last character of text string Grant Excel Worksheet Functions 2 September 29th 05 05:17 PM
dynamic cell reference within a text string gvm Excel Worksheet Functions 4 July 25th 05 02:40 AM
Extracting from a text string AmyTaylor Excel Worksheet Functions 3 June 24th 05 01:34 PM
Formating a text string? METCO1 Excel Discussion (Misc queries) 2 November 30th 04 06:31 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"