Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Glynn Furr
 
Posts: n/a
Default Help! With SUMPRODUCT

I am trying to total the occurrences of comma delimited numbers in a column.
See original post below:

I have a column which has a variable number of comma delimited values in
the range of 11 to 56 in each cell. Is there a method or macro to count
the
occurrences of each number in the column and either output the results to
a
file or another worksheet or the same worksheet?

Example:
A1: 23,40,52,31,
A2: 42,14,
A3: 56,
A4: 27,43,19,
etc.

What I am doing now is coping the column to Word, closing the margins to
3
characters, coping that result to an clean worksheet, sorting the new
column ascending and printing the results and counting the occurrences
manually. This is getting tedious as the column grows in length.

Can anyone help me or point me to a solution?


Biff replied with a formula using SUMPRODUCT. See his reply below:

Hi!

Assume the numbers are in the range A1:A10.

In C1 enter 11.

In D1 enter this formula:

=SUMPRODUCT(LEN(A$1:A$10)-LEN(SUBSTITUTE(A$1:A$10,C1,"")))/2

Select both C1 and D1 and drag copy down to row 46.

Biff


For the life of me I cannot get this to work. When I enter his formula
(exactly as written in a test worksheet), I get an error #NAME?

Can anyone please help.

Thanks a million,

Glynn .. gfurr1 at nc dot rr dot com


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Biff
 
Posts: n/a
Default Help! With SUMPRODUCT

Hi!

The only reason that #NAME? should be the result is if one of the functions
was misspelled?

Here's a sample file that demonstrates this:

count_instances.xls 14kb

http://s54.yousendit.com/d.aspx?id=3...31HIB756ZT0TN5

Biff

"Glynn Furr" wrote in message
...
I am trying to total the occurrences of comma delimited numbers in a
column. See original post below:

I have a column which has a variable number of comma delimited values in
the range of 11 to 56 in each cell. Is there a method or macro to count
the
occurrences of each number in the column and either output the results to
a
file or another worksheet or the same worksheet?

Example:
A1: 23,40,52,31,
A2: 42,14,
A3: 56,
A4: 27,43,19,
etc.

What I am doing now is coping the column to Word, closing the margins to
3
characters, coping that result to an clean worksheet, sorting the new
column ascending and printing the results and counting the occurrences
manually. This is getting tedious as the column grows in length.

Can anyone help me or point me to a solution?


Biff replied with a formula using SUMPRODUCT. See his reply below:

Hi!

Assume the numbers are in the range A1:A10.

In C1 enter 11.

In D1 enter this formula:

=SUMPRODUCT(LEN(A$1:A$10)-LEN(SUBSTITUTE(A$1:A$10,C1,"")))/2

Select both C1 and D1 and drag copy down to row 46.

Biff


For the life of me I cannot get this to work. When I enter his formula
(exactly as written in a test worksheet), I get an error #NAME?

Can anyone please help.

Thanks a million,

Glynn .. gfurr1 at nc dot rr dot com



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Carim
 
Posts: n/a
Default Help! With SUMPRODUCT

Hi,

Is Sumproduct() really needed ...
Here is the formula I am using :

=LEN(A1)-LEN(SUBSTITUTE(A1,",",""))

HTH
Cheers
Carim

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Biff
 
Posts: n/a
Default Help! With SUMPRODUCT

I think you may have misunderstood what the OP wants to do.

Count the instances a number from 11 to 56 appears in a range of cells.

Is Sumproduct() really needed ...


You could use SUM and array enter the formula.

Biff

"Carim" wrote in message
oups.com...
Hi,

Is Sumproduct() really needed ...
Here is the formula I am using :

=LEN(A1)-LEN(SUBSTITUTE(A1,",",""))

HTH
Cheers
Carim



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Herbert Seidenberg
 
Posts: n/a
Default Help! With SUMPRODUCT

Or use
Data Text to Columns Delimited Comma
Add your own row and column headers.
Then use
Data Pivot Table Multiple Consolidatation Ranges.

In Pivot Table Wizard Layout,
drag the Row and Column button off the diagram and
place the Value button where the Row button used to be.
Again, drag the Value button to the Data area and right click it
to select Count of Value.
In Pivot Table Wizard Options Uncheck Grand Totals

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
Adding "OR" to a Sumproduct Formula Duke Carey Excel Worksheet Functions 0 March 21st 06 06:41 PM
Need help with sumproduct & dynamic ranges bill_s1416 Excel Worksheet Functions 1 March 19th 06 03:36 AM
Need help with sumproduct and dynamic ranges Bill_S Excel Worksheet Functions 2 March 19th 06 01:19 AM
Sumproduct function not working Scott Summerlin Excel Worksheet Functions 12 December 4th 04 05:15 AM
adding two sumproduct formulas together ski2004_2005 Excel Worksheet Functions 1 November 12th 04 09:08 PM


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