Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Count occurrences of a substring in an array

Does anyone have an example of counting the number cells in a column (e.g.
D5:D30) which contain a substring using the contents of another cell as the
substring? The position of the substring in the cell contents is not
important. Also the data does not make it possible for the substring to occur
more than once in any cell.

For example:

If A10 contained "car" as the substring and D5:D30 contained various text
strings, two of them "carrot", and the remainder containing "X", the function
would return the numeric value 2.

Thanks!

Michael


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Count occurrences of a substring in an array

Try,

=COUNTIF(D5:D30,"*Car*")

Mike

"Michael J. O''Connell" wrote:

Does anyone have an example of counting the number cells in a column (e.g.
D5:D30) which contain a substring using the contents of another cell as the
substring? The position of the substring in the cell contents is not
important. Also the data does not make it possible for the substring to occur
more than once in any cell.

For example:

If A10 contained "car" as the substring and D5:D30 contained various text
strings, two of them "carrot", and the remainder containing "X", the function
would return the numeric value 2.

Thanks!

Michael


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,572
Default Count occurrences of a substring in an array

Try this:

=Countif(D5:D30,"*"&A10&"*")
--
HTH,

RD

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

"Michael J. O''Connell" wrote
in message ...
Does anyone have an example of counting the number cells in a column (e.g.
D5:D30) which contain a substring using the contents of another cell as
the
substring? The position of the substring in the cell contents is not
important. Also the data does not make it possible for the substring to
occur
more than once in any cell.

For example:

If A10 contained "car" as the substring and D5:D30 contained various text
strings, two of them "carrot", and the remainder containing "X", the
function
would return the numeric value 2.

Thanks!

Michael




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Count occurrences of a substring in an array

Many thanks. Works like a charm!

Michael

"RagDyer" wrote:

Try this:

=Countif(D5:D30,"*"&A10&"*")
--
HTH,

RD

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

"Michael J. O''Connell" wrote
in message ...
Does anyone have an example of counting the number cells in a column (e.g.
D5:D30) which contain a substring using the contents of another cell as
the
substring? The position of the substring in the cell contents is not
important. Also the data does not make it possible for the substring to
occur
more than once in any cell.

For example:

If A10 contained "car" as the substring and D5:D30 contained various text
strings, two of them "carrot", and the remainder containing "X", the
function
would return the numeric value 2.

Thanks!

Michael





  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,572
Default Count occurrences of a substring in an array

You're welcome ... Appreciate the feed-back.
--

Regards,

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

"Michael J. O''Connell" wrote
in message ...
Many thanks. Works like a charm!

Michael

"RagDyer" wrote:

Try this:

=Countif(D5:D30,"*"&A10&"*")
--
HTH,

RD

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

"Michael J. O''Connell" wrote
in message ...
Does anyone have an example of counting the number cells in a column
(e.g.
D5:D30) which contain a substring using the contents of another cell as
the
substring? The position of the substring in the cell contents is not
important. Also the data does not make it possible for the substring to
occur
more than once in any cell.

For example:

If A10 contained "car" as the substring and D5:D30 contained various
text
strings, two of them "carrot", and the remainder containing "X", the
function
would return the numeric value 2.

Thanks!

Michael







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 return multiple occurrences of a match in an array? Umbu Excel Worksheet Functions 1 May 25th 08 05:07 PM
How do I count repeat Occurrences kevhatch Excel Discussion (Misc queries) 5 May 25th 08 02:49 AM
Count names and occurrences Midjack Excel Worksheet Functions 8 January 16th 08 02:32 PM
trying to COUNT occurrences when certain criteria is met Allan from Melbourne Excel Discussion (Misc queries) 4 August 2nd 06 11:01 AM
Count unique occurrences of name jhicsupt Excel Discussion (Misc queries) 4 October 5th 05 05:46 PM


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