10 most frequently repeated numbers

juanam

New Member
Joined
Aug 1, 2021
Messages
28
Office Version
  1. 2021
Platform
  1. Windows
In a one column data range I have several numbers corresponding to bingo balls that have come out.
In that column I will continue to add future ball values.

I want to get the 10 most frequently repeated numbers.

I have used MODE. MULT function, but it only returns some values, I need the full 10 values, with the following numbers that have come out more frequently.

Sorry for my bad English, I speak Spanish and use google translator ☺️


bingo.xlsx
AB
1BALLSMODE
22525
36868
477
588
6750
768#N/D
88#N/D
925#N/D
1068#N/D
1125#N/D
127
138
1450
1550
1633
1779
1810
1965
2058
2137
2270
2378
2421
2536
2638
2732
2890
2916
3046
3164
3269
3352
3471
3526
3629
3784
3819
3940
4072
4117
4240
4333
4419
4572
4679
4710
4865
4958
5037
5170
5278
5321
5436
5538
5616
5746
5864
5969
6052
6171
6226
6329
6484
6550
6690
6732
6874
6914
706
7188
7231
7351
7445
7534
7613
7753
785
7980
8024
8185
8220
8311
8418
8549
861
8787
8815
8973
9042
9186
9235
9376
9463
9547
9666
9756
9862
994
10089
10157
10241
10382
10412
1059
10622
107
BINGO
Cell Formulas
RangeFormula
B2:B11B2=MODE.MULT(balls_range)
Press CTRL+SHIFT+ENTER to enter array formulas.
 

Attachments

  • bingo.png
    bingo.png
    33.7 KB · Views: 21
You do not need a macro, just wrap any formula that gives you the correct numbers in a SORT function
=SORT(your_original_formula)
 
Upvote 0

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Thank you very much @JEC and @Peter_SSs for your help. (y)

I just need last favor, I want to horizontally transpose and concatenate PLAY1 and PLAY2 columns values and separate data with hyphens "-" into a single cell.

I have tried using these formulas but I have not been able to keep data in a single cell and also I have not been able to remove the last hyphen from the list.

concat_bad.png


G12:
Code:
=CONCATENATE(TRANSPOSE(C2#)&"-")
G13:
Code:
=CONCATENATE(TRANSPOSE(D2#)&"-")

I want to achieve this:

concat.png
 
Upvote 0
EDIT(I couldn't edit post):

Please moderators merge this post

I have already achieved what I wanted with a macro.

VBA Code:
Option Explicit
Function transposeRange(Rg As Range)
Application.ScreenUpdating = False
    Dim xCell As Range
    Dim xStr As String
    For Each xCell In Rg
        If Not IsEmpty(xCell.Value) Then
            xStr = xStr & xCell.Value & " - "
        End If
    Next
    transposeRange = Left(xStr, Len(xStr) - 2)
            
End Function

G12:
Code:
=transposeRange(C2#)
G13:
Code:
=transposeRange(D2#)
 
Upvote 0
I have already achieved what I wanted with a macro.
A few comments
  • Not sure if it matters or if you are aware but your function leaves a space character at the right of the final text string (because you only subtracted 2 from the length of the string and not 3)

  • If you really want to use a user-defined function, this would do the same job.

    VBA Code:
    Function transposeRange(Rg As Range) As String
      transposeRange = Join(Application.Transpose(Rg), " - ")
    End Function

  • You don't need a user-defined function as this simple worksheet function will do the same thing.

    Excel Formula:
    =TEXTJOIN(" - ",,C2#)
 
Upvote 0
@Peter_SSs, you are a genious! (y)
You've simplified both codes a lot and they really do what I want.
Thank you! ?
 
Upvote 0
@Peter_SSs , I have another question that I don't know how to solve. ☺️
I have modified spreadsheet a bit, adding other columns.

I need the ranges of columns G, H, and I to dynamically match the number of rows in column F.

By adding more balls to column A, column F changes its number of rows by more or less, and that data must be transferred to the 3 named columns.

That is, when increasing or decreasing the number of rows in column F, the row ranges of the referred columns must be changed automatically.

CODE:
bingo_mr_excel.xlsx
ABCDEFGHIJKLM
1BALLSPLAY 1PLAY 2COMPLETE LISTUNIQUE LISTRANDOMPLAY 3PLAY 4
227221022100,4717067793810
380301430140,2127404228014
437381738170,7337143131717
551462246220,2233210166022
658473047300,221253557330
736593859380,9863198211438
87604660460,5253206393046
973734773470,9976345961047
1034806080590,3494246594759
1157888888600,0351244768860
124110730,3744631994673PLAY 122-30-38-46-47-59-60-73-80-88
138914800,5631817532280PLAY 210-14-17-22-30-38-46-47-60-88
14817880,2328535695988
154722
164430PLAY 310-14-17-22-30
177838PLAY 438-46-47-59-60
184246
193047
201860
213888
2274
BINGO
Cell Formulas
RangeFormula
C2:C11C2=SORT(INDEX(SEQUENCE(90),MATCH(LARGE(COUNTIF($A$2:$A$492,SEQUENCE(90))+(SEQUENCE(90)/1000),SEQUENCE(10)),COUNTIF($A$2:$A$492,SEQUENCE(90))+(SEQUENCE(90)/1000),0)))
D2:D11D2=SORT(INDEX(UNIQUE(SORTBY(Tabl_Bingo3781011,COUNTIFS(Tabl_Bingo3781011,Tabl_Bingo3781011),-1,Tabl_Bingo3781011,1)),SEQUENCE(10)))
E2:E11E2=SORT(C2#)
F2:F14F2=SORT(UNIQUE(E2:E21))
G2:G14G2=RAND()
H2:H14H2=INDEX($F$2:$F$14,RANK(G2,$G$2:$G$14))
I2:I14I2=SORT(VALUE(H2:H14))
E12:E21E12=SORT(D2#)
L12L12=TEXTJOIN("-",,C2#)
L13L13=TEXTJOIN("-",,D2#)
L16L16=TEXTJOIN("-",,I2:I6)
L17L17=TEXTJOIN("-",,I7:I11)
Dynamic array formulas.


SCREENSHOTs:
bingo1.png

bingo2.png

bingo3.png

bingo4.png
bingo5.png
 
Last edited:
Upvote 0
Edit
P.S

If when changing the number of rows in the columns, previous formulas remain, they should also be eliminated so that there are no errors.
I don't know if it can be done without a macro, I also accept solutions with a macro. :)

bingo_random.png
 
Upvote 0
How about
+Fluff 1.xlsm
ABCDEFGHI
1BALLSPLAY 1PLAY 2COMPLETE LISTUNIQUE LISTRANDOMPLAY 3PLAY 4
2274474470.1590849747
3804784780.4017499578
437511851180.88376063018
551572757270.54768014727
658583058300.9538756830
736733473340.64853733734
87743674360.9961027736
973783778370.77035973437
1034803880380.93693852738
1157894189410.68326673641
12417440.32962415844
13898470.94704971847
14818510.15767377851
154727570.6001344157
164430580.1525238058
177834730.49708145173
184236740.62279063874
193037780.17325197378
201838800.09265378980
213841890.5873844489
2274
23
Main
Cell Formulas
RangeFormula
C2:C11C2=SORT(INDEX(SEQUENCE(90),MATCH(LARGE(COUNTIF($A$2:$A$488,SEQUENCE(90))+(SEQUENCE(90)/1000),SEQUENCE(10)),COUNTIF($A$2:$A$488,SEQUENCE(90))+(SEQUENCE(90)/1000),0)))
D2:D11D2=SORT(INDEX(UNIQUE(SORTBY(Tabl_Bingo3781011,COUNTIFS(Tabl_Bingo3781011,Tabl_Bingo3781011),-1,Tabl_Bingo3781011,1)),SEQUENCE(10)))
E2:E11E2=SORT(C2#)
F2:F21F2=SORT(UNIQUE(E2:E21))
G2:G21G2=RANDARRAY(F2#)
H2:H21H2=INDEX(F2#,COUNTIFS(G2#,">"&G2#)+1)
I2:I21I2=SORT(H2#)
E12:E21E12=SORT(D2#)
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,173
Members
451,543
Latest member
cesymcox

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
Back
Top