Let A3:A19 house:
{"Num";1;2;4;4;4;3;6;6;6;5;7;7;8;8;1;7}
where Num is just a label in A3.
In B3 enter: Count [ which is just a label ]
In B4 enter & copy down:
=IF(ISNUMBER(A4)*ISNA(MATCH(A4,$A$3:A3,0)),COUNTIF($A$4:$A$19,A4),"")
In C3 enter: Rank [ which is just a label ]
In C4 enter & copy down:
=IF(N(B4),RANK(B4,$B$4:$B$19)+COUNTIF($B$4:B4,B4)-1,"")
In D1 enter, for example: 4 [ which means 4 most frequent numbers ]
In D2 enter:
=MAX(IF(INDEX(B4:B19,MATCH(D1,C4:C19,0))=B4:B19,C4:C19))-D1
which you need to confirm with control+shift+enter instead of just with
enter.
In D3 enter: Mode [ which is just a label ]
In E3 enter: Freq [ which is just a label ]
In D4 enter and copy across to E4 then down:
=IF(ROW()-ROW(D$4)+1<=$D$1+$D$2,INDEX(A$4:A$19,MATCH(ROW()-ROW(D$4)+1,$C$4:$C$19,0)),"")