#1   Report Post  
Posted to microsoft.public.excel.misc
bjenkins
 
Posts: n/a
Default Counting

Is there a non-macro way to count if words appear in a cell.

In other words, I have a list in excel such as the following
Alpha
Beta
Gamma
Alpha, Beta
Alpha, Delta
Delta, Gama

and I want to count the number of times that Alpha, Beta, Gamma, and Delta
appear so that it would produce
Alpha - 3
Beta - 2
Gama - 2
Delta - 2

Thanks in advance for the help
  #2   Report Post  
Posted to microsoft.public.excel.misc
Ron Coderre
 
Posts: n/a
Default Counting

Try this:
For the searched text in cell A1 and a list of cells that contain text in
D1:D10

=SUMPRODUCT(LEN(D1:D10)-LEN(SUBSTITUTE(UPPER(D1:D10),UPPER(A1),"")))/LEN(A1)

Does that help?

***********
Regards,
Ron


"bjenkins" wrote:

Is there a non-macro way to count if words appear in a cell.

In other words, I have a list in excel such as the following
Alpha
Beta
Gamma
Alpha, Beta
Alpha, Delta
Delta, Gama

and I want to count the number of times that Alpha, Beta, Gamma, and Delta
appear so that it would produce
Alpha - 3
Beta - 2
Gama - 2
Delta - 2

Thanks in advance for the help

  #3   Report Post  
Posted to microsoft.public.excel.misc
David Billigmeier
 
Posts: n/a
Default Counting

Array entered (CTRL+SHIFT+ENTER), these will work:

=SUM(IF(ISNUMBER(SEARCH("Alpha",A1:A100)),1,0))
=SUM(IF(ISNUMBER(SEARCH("Beta",A1:A100)),1,0))
=SUM(IF(ISNUMBER(SEARCH("Gamma",A1:A100)),1,0))
=SUM(IF(ISNUMBER(SEARCH("Delta",A1:A100)),1,0))

--
Regards,
Dave


"bjenkins" wrote:

Is there a non-macro way to count if words appear in a cell.

In other words, I have a list in excel such as the following
Alpha
Beta
Gamma
Alpha, Beta
Alpha, Delta
Delta, Gama

and I want to count the number of times that Alpha, Beta, Gamma, and Delta
appear so that it would produce
Alpha - 3
Beta - 2
Gama - 2
Delta - 2

Thanks in advance for the help

  #4   Report Post  
Posted to microsoft.public.excel.misc
Ron Coderre
 
Posts: n/a
Default Counting

Note: If the text to find will ONLY occur ONCE in a cell, there are shorter
formulas to do that. The formula I offered counts ALL instances in the
referenced cells, even if the text appears several times:

Example:
A1: Alpha

D1: Alpha and Beta
D2: Alpha, Beta, Alpha

Count of Alpha is 3.

=SUMPRODUCT(LEN(D1:D10)-LEN(SUBSTITUTE(UPPER(D1:D10),UPPER(A1),"")))/LEN(A1)

Note: SUBSTITUTE is case sensitive, hence the UPPER function.


***********
Regards,
Ron


"Ron Coderre" wrote:

Try this:
For the searched text in cell A1 and a list of cells that contain text in
D1:D10

=SUMPRODUCT(LEN(D1:D10)-LEN(SUBSTITUTE(UPPER(D1:D10),UPPER(A1),"")))/LEN(A1)

Does that help?

***********
Regards,
Ron


"bjenkins" wrote:

Is there a non-macro way to count if words appear in a cell.

In other words, I have a list in excel such as the following
Alpha
Beta
Gamma
Alpha, Beta
Alpha, Delta
Delta, Gama

and I want to count the number of times that Alpha, Beta, Gamma, and Delta
appear so that it would produce
Alpha - 3
Beta - 2
Gama - 2
Delta - 2

Thanks in advance for the help

  #5   Report Post  
Posted to microsoft.public.excel.misc
bjenkins
 
Posts: n/a
Default Counting

Thanks to both, worked great

"David Billigmeier" wrote:

Array entered (CTRL+SHIFT+ENTER), these will work:

=SUM(IF(ISNUMBER(SEARCH("Alpha",A1:A100)),1,0))
=SUM(IF(ISNUMBER(SEARCH("Beta",A1:A100)),1,0))
=SUM(IF(ISNUMBER(SEARCH("Gamma",A1:A100)),1,0))
=SUM(IF(ISNUMBER(SEARCH("Delta",A1:A100)),1,0))

--
Regards,
Dave


"bjenkins" wrote:

Is there a non-macro way to count if words appear in a cell.

In other words, I have a list in excel such as the following
Alpha
Beta
Gamma
Alpha, Beta
Alpha, Delta
Delta, Gama

and I want to count the number of times that Alpha, Beta, Gamma, and Delta
appear so that it would produce
Alpha - 3
Beta - 2
Gama - 2
Delta - 2

Thanks in advance for the help

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
conditional counting with Excel LeicaElmar Excel Worksheet Functions 1 October 17th 05 10:23 PM
Counting rows containing data (both numbers and text) mconnolly Excel Worksheet Functions 4 August 29th 05 03:58 PM
Counting rows, then counting values. Michael via OfficeKB.com Excel Discussion (Misc queries) 7 August 4th 05 10:57 PM
Counting names in a column but counting duplicate names once TBoe Excel Discussion (Misc queries) 9 May 11th 05 11:24 PM
Counting... Patrick G Excel Worksheet Functions 3 February 23rd 05 10:05 PM


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