I want to use Excel to generate data for a Chi-Square problem. Specifically, I want to generate a large series of pairs of random integers between 1-10 in columns A and B. I can do that with =RANDBETWEEN(1,10). So I would have pairs of values like 1,8 and 5,9. There would be 100 possible pairs from 1,1 to 10,10. I know how to do all that. Now, I want to construct a 10×10 grid so that each cell in the grid represents one of the 100 possible pairs. The part I don’t know how to do is to calculate a count for the grid. For example, the cell in the grid representing 5,5 should look through these say 10,000 pairs and count how many are 5,5.
I know I can do this with a brute-force approach by writting 100 IF statements beside my pairs of random numbers where each one has a value of 1 for membership in a particular cell and 0 otherwise. I could copy that down and then total each column but that would take a huge worksheet and would not be a very nice approach.
It seems to me that I should be able to do this with 100 COUNTIF statements but I don’t have a lot of experience with Excell database functions and cannot get it to work properly. Any suggestions?
Ronny