Counting occurences

Pepestru

New Member
Joined
Sep 15, 2006
Messages
15
Office Version
  1. 2019
Platform
  1. Windows
Hi Excel Professors,
I have tried for some time to use excel functions for the following simple problem:
I have a spreadsheet with two columns (a few thousand rows) having the numbers 1 to 20.
I needs a matrix ( 1- 20 horizontal and 1-20 vertical) showing the number of occurrences of each combination found in the rows.
So I want to know how many times the combination 1-2 occurs, and so forth for all combinations with of 1-20 to 20-20.
Is this possible using standard functions of Excel?
Thanks for your help.
Paul
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,210
Hi Excel Professors,
I have tried for some time to use excel functions for the following simple problem:
I have a spreadsheet with two columns (a few thousand rows) having the numbers 1 to 20.
I needs a matrix ( 1- 20 horizontal and 1-20 vertical) showing the number of occurrences of each combination found in the rows.
So I want to know how many times the combination 1-2 occurs, and so forth for all combinations with of 1-20 to 20-20.
Is this possible using standard functions of Excel?
Thanks for your help.
Paul
Book1
ABCDEFGHIJ
1XY12345
235101120
325200121
433300211
551400000
653511302
734
813
923
1014Count of XY
1153X12345
12121112
13242121
14523211
153351132
1614
1755
1853
1955
2024
Sheet1


E2, copied across then down:

=SUMPRODUCT(--($A$2:$A$20=$D2),--($B$2:$B$20=E$1))

The same results can be achieved with a pivot table as shown in D10:I15 in the exhibit.
 

Pepestru

New Member
Joined
Sep 15, 2006
Messages
15
Office Version
  1. 2019
Platform
  1. Windows
Many thanks. It does exactly what I need!
Although I never would think about using this function, now I still do not understand why this does the job.........
Never mind, and thanks again,
Paul
 

Forum statistics

Threads
1,172,016
Messages
5,878,746
Members
433,369
Latest member
Applewood

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top