ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   counting matching multiple entries (https://www.excelbanter.com/excel-discussion-misc-queries/231076-counting-matching-multiple-entries.html)

colensa

counting matching multiple entries
 
I have two columns containing numbers.
I want to count the frequency with which the two columns' numbers match i.e.
the number of times 5,9 or 6,8 or 13,21 etc etc crop up (sports scores) and
leave the spreadsheet showing each unique number combination and the number
of times it occurs. Can I do this in one operation?

Colensa

Gary''s Student

counting matching multiple entries
 
I would use a pivot table. For example, with data in A2 thru B31, in C2 enter:
=A2 & "," & B2 and copy down. We get something like:

first second combo
3 4 3,4
4 8 4,8
6 4 6,4
2 10 2,10
4 9 4,9
2 8 2,8
9 2 9,2
2 10 2,10
7 3 7,3
5 4 5,4
9 3 9,3
6 1 6,1
1 6 1,6
8 7 8,7
3 9 3,9
2 2 2,2
9 1 9,1
9 4 9,4
5 7 5,7
4 10 4,10
5 3 5,3
9 1 9,1
7 7 7,7
10 10 10,10
3 9 3,9
7 10 7,10
6 7 6,7
2 3 2,3
9 5 9,5
1 8 1,8

Then create a pivot table listing Count of combo By combo. The result:

Count of combo
combo Total
1,6 1
1,8 1
10,10 1
2,10 2
2,2 1
2,3 1
2,8 1
3,4 1
3,9 2
4,10 1
4,8 1
4,9 1
5,3 1
5,4 1
5,7 1
6,1 1
6,4 1
6,7 1
7,10 1
7,3 1
7,7 1
8,7 1
9,1 2
9,2 1
9,3 1
9,4 1
9,5 1

Pivot table is nice because it creates the table of unique combos and lists
the number of times each combo occurs in one go. For more info:

http://www.contextures.com/xlPivot01.html
--
Gary''s Student - gsnu200853


"colensa" wrote:

I have two columns containing numbers.
I want to count the frequency with which the two columns' numbers match i.e.
the number of times 5,9 or 6,8 or 13,21 etc etc crop up (sports scores) and
leave the spreadsheet showing each unique number combination and the number
of times it occurs. Can I do this in one operation?

Colensa


Bernd P

counting matching multiple entries
 
Hello,

Select an area of 3 columns and enough rows and array-enter:
=Pfreq(A1:A100,B1:B100)
for example, if your two columns are A and B (data in rows 1 to 100).

My UDF Pfreq you can find he
http://www.sulprobil.com/html/pfreq.html

Regards,
Bernd


All times are GMT +1. The time now is 11:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com