Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default count unique combinations

Hi,
I have a spreadsheet with 6 columns. I need to count how many occurences of
each unique set of data in the first 5 columns.

For example:
from column A to F:
2 1 0 a b 10:00
2 0 0 a b 11:00
3 1 2 d f 12:00
1 1 2 a c 13:00
1 1 2 a c 14:00
2 1 0 a b 15:00
The macro will give results below:
The first 5 columns show the values of each unique combination and the last
column has the number of occurences for that combination in the source data.

2 1 0 a b 2
2 0 0 a b 1
3 1 2 d f 1
1 1 2 a c 2

Thanks a lot,
Mini
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default count unique combinations

I'd use a helper column and concatenate the values in each row to a larger
string in that helper column:

=a1&"|"&b1&"|"&c1&"|"&d1&"|"&e1
| is just a separator that isn't used in any of the fields.

Then you could sort by that column and use Data|Subtotals to get your count.
(and hide the details using the outlining symbols to the left if you want.)

mini wrote:

Hi,
I have a spreadsheet with 6 columns. I need to count how many occurences of
each unique set of data in the first 5 columns.

For example:
from column A to F:
2 1 0 a b 10:00
2 0 0 a b 11:00
3 1 2 d f 12:00
1 1 2 a c 13:00
1 1 2 a c 14:00
2 1 0 a b 15:00
The macro will give results below:
The first 5 columns show the values of each unique combination and the last
column has the number of occurences for that combination in the source data.

2 1 0 a b 2
2 0 0 a b 1
3 1 2 d f 1
1 1 2 a c 2

Thanks a lot,
Mini


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default count unique combinations

Thanks, it works very well though it takes some time for the subtotal
command to finish.
Regards,
Mini


"Dave Peterson" wrote:

I'd use a helper column and concatenate the values in each row to a larger
string in that helper column:

=a1&"|"&b1&"|"&c1&"|"&d1&"|"&e1
| is just a separator that isn't used in any of the fields.

Then you could sort by that column and use Data|Subtotals to get your count.
(and hide the details using the outlining symbols to the left if you want.)

mini wrote:

Hi,
I have a spreadsheet with 6 columns. I need to count how many occurences of
each unique set of data in the first 5 columns.

For example:
from column A to F:
2 1 0 a b 10:00
2 0 0 a b 11:00
3 1 2 d f 12:00
1 1 2 a c 13:00
1 1 2 a c 14:00
2 1 0 a b 15:00
The macro will give results below:
The first 5 columns show the values of each unique combination and the last
column has the number of occurences for that combination in the source data.

2 1 0 a b 2
2 0 0 a b 1
3 1 2 d f 1
1 1 2 a c 2

Thanks a lot,
Mini


--

Dave Peterson

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
Filtering unique combinations of cells John T Kennedy[_2_] Excel Discussion (Misc queries) 8 April 27th 23 07:44 PM
Need possible combinations of 7 unique characters. scottgorilla[_2_] Excel Worksheet Functions 4 August 21st 08 05:27 PM
Counting unique combinations in two columns [email protected] Excel Discussion (Misc queries) 3 May 6th 07 03:03 AM
How count these combinations ? Jacko[_6_] Excel Programming 2 November 13th 05 09:18 PM
Count combinations TwIsTeEeR Excel Programming 9 September 9th 03 10:57 PM


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