count unique combinations

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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.)
 
Thanks, it works very well though it takes some time for the subtotal
command to finish.
Regards,
Mini
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top