Thread: Frequency
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
smartin smartin is offline
external usenet poster
 
Posts: 915
Default Frequency

rossmolden wrote:
I want to display what number appears in the same row the most with the
number 1.
So this example, would be 2 as it appears with 1 in the same row 3 times.

4 1 3 2
2 1
4 3 2
1
2 3 4 1


You can do this with some helper cells, but I'm not sure it will be
practical with your actual data.

Suppose your data is in A2:D6. In F1:H1 put 2,3, and 4. These are the
values for which we will determine frequency.

In F2 put this array* formula, and fill right and down through H6.
*Array formulae must be committed with Ctrl + Shift + Enter, not just Enter:

=SUM(IF($A2:$D2=1,COUNTIF($A2:$D2,F$1)))

This formula says, if there is a 1 in this row, count how many times
each other number appears in this row.

In F7 put this, and fill right through H7:

=SUM(F2:F6)

The largest value in F7:H7 reveals which test value in F1:H1 appears the
most with a 1.