Occurrences of numbers in date range

jarhead58

Active Member
Joined
Sep 21, 2017
Messages
367
Office Version
  1. 2021
Platform
  1. Windows
I'm using Excel 2021. I'm trying to figure out how many occurrences of numbers in column G within a date range in column A of this year and entering the number in R44 with the highest occurrences. Then enter the number occurrences in S44. I would think VBA would be the way to do it but can't seem to figure out the correct way to do it. TIA
 
If you want to use T44 then you will need to use two separate formulas.
I'll just leave it as is then. Any idea why it's counting 35 instead of 10? I did notice that the sample I gave you only has 98 cells to look at which would only be 10, the formula goes to 500 but there are no more cells in A99:A500 from 2024 in that range.
 
Upvote 0

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Without seeing the actual data, I have no idea why it's giving the wrong count.
 
Upvote 0
Without seeing the actual data, I have no idea why it's giving the wrong count.
Here is a little more data down to line 200 which includes 2023 data including the number 23 which should be ignored. I only want the current year occurrences of 23.
powerball_newcard 10623.xlsm
RS
442314
Sheet1
Cell Formulas
RangeFormula
R44:S44R44=LET(f,FILTER(G1:G200,YEAR(A1:A200=2024)),m,MODE(f),CHOOSE({1,2},m,SUM(--(f=m))))
Press CTRL+SHIFT+ENTER to enter array formulas.

powerball_newcard 10623.xlsm
A
24/22/2024
34/22/2024
44/20/2024
54/20/2024
64/17/2024
74/17/2024
84/15/2024
94/15/2024
104/13/2024
114/13/2024
124/10/2024
134/10/2024
144/8/2024
154/8/2024
164/6/2024
174/6/2024
184/3/2024
194/3/2024
204/1/2024
214/1/2024
223/30/2024
233/30/2024
243/27/2024
253/27/2024
263/25/2024
273/25/2024
283/23/2024
293/23/2024
303/20/2024
313/20/2024
323/18/2024
333/18/2024
343/16/2024
353/16/2024
363/13/2024
373/13/2024
383/11/2024
393/11/2024
403/9/2024
413/9/2024
423/6/2024
433/6/2024
443/4/2024
453/4/2024
463/2/2024
473/2/2024
482/28/2024
492/28/2024
502/26/2024
512/26/2024
522/24/2024
532/24/2024
542/21/2024
552/21/2024
562/19/2024
572/19/2024
582/17/2024
592/17/2024
602/14/2024
612/14/2024
622/12/2024
632/12/2024
642/10/2024
652/10/2024
662/7/2024
672/7/2024
682/5/2024
692/5/2024
702/3/2024
712/3/2024
721/31/2024
731/31/2024
741/29/2024
751/29/2024
761/27/2024
771/27/2024
781/24/2024
791/24/2024
801/22/2024
811/22/2024
821/20/2024
831/20/2024
841/17/2024
851/17/2024
861/16/2024
871/16/2024
881/13/2024
891/13/2024
901/10/2024
911/10/2024
921/8/2024
931/8/2024
941/6/2024
951/6/2024
961/3/2024
971/3/2024
981/1/2024
991/1/2024
10012/30/2023
10112/30/2023
10212/27/2023
10312/27/2023
10412/25/2023
10512/25/2023
10612/23/2023
10712/23/2023
10812/20/2023
10912/20/2023
11012/18/2023
11112/18/2023
11212/16/2023
11312/16/2023
11412/13/2023
11512/13/2023
11612/9/2023
11712/9/2023
11812/6/2023
11912/6/2023
12012/4/2023
12112/4/2023
12212/2/2023
12312/2/2023
12411/29/2023
12511/29/2023
12611/27/2023
12711/27/2023
12811/25/2023
12911/25/2023
13011/22/2023
13111/22/2023
13211/19/2023
13311/19/2023
13411/15/2023
13511/15/2023
13611/13/2023
13711/13/2023
13811/11/2023
13911/11/2023
14011/8/2023
14111/8/2023
14211/6/2023
14311/6/2023
14411/4/2023
14511/4/2023
14611/1/2023
14711/1/2023
14810/28/2023
14910/28/2023
15010/25/2023
15110/25/2023
15210/23/2023
15310/23/2023
15410/21/2023
15510/21/2023
15610/18/2023
15710/18/2023
15810/16/2023
15910/16/2023
16010/14/2023
16110/14/2023
16210/11/2023
16310/11/2023
16410/9/2023
16510/9/2023
16610/7/2023
16710/7/2023
16810/4/2023
16910/4/2023
17010/2/2023
17110/2/2023
1729/30/2023
1739/30/2023
1749/27/2023
1759/27/2023
1769/25/2023
1779/25/2023
1789/23/2023
1799/23/2023
1809/20/2023
1819/20/2023
1829/18/2023
1839/18/2023
1849/16/2023
1859/16/2023
1869/13/2023
1879/13/2023
1889/11/2023
1899/11/2023
1909/9/2023
1919/9/2023
1929/6/2023
1939/6/2023
1949/4/2023
1959/4/2023
1969/2/2023
1979/2/2023
1988/30/2023
1998/30/2023
2008/28/2023
Sheet1

powerball_newcard 10623.xlsm
G
223
31
423
525
67
72
817
923
1026
1110
122
1315
1414
1523
1614
179
1813
1915
2012
2123
2216
2323
2423
258
264
2723
2811
293
3024
319
3217
3316
3412
355
365
374
3812
395
4020
4116
4216
4310
444
4526
4610
4712
487
496
508
5116
5217
533
5411
5514
5614
5717
5818
5921
6017
6118
622
6314
6415
658
6623
6717
6820
699
7013
7119
7225
7314
7416
754
7616
7721
7818
798
8013
8121
8213
8310
8425
852
8617
874
8817
8915
9019
9111
9217
932
9422
9513
9623
978
982
991
1008
1017
1022
1035
1049
1054
1061
1076
1083
10916
1109
11126
1123
11325
11414
11518
11618
1171
1189
11921
1207
1219
12225
1233
12423
1254
12620
12712
12820
1299
13014
13121
1328
13320
13417
1356
13614
13721
1385
1397
14018
14120
14224
14326
14426
1456
14621
14712
14811
1492
15017
1512
15213
15321
1545
15511
15615
15724
1581
15918
16023
16114
1622
16310
16410
16514
16623
16719
16822
1691
1702
1715
17225
17322
1741
1757
17619
1774
17824
17921
1808
18123
18214
1839
1846
1855
18624
18718
18822
1895
19020
19125
19210
1931
1947
19513
19621
19719
1982
1994
2004
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B133:G133,B552:G553,B41:G41,B618:G3143Expression=COUNTIFS($B$41:$B$529,$B41,$C$41:$C$529,$C41,$D$41:$D$529,$D41,$E$41:$E$529,$E41,$F$41:$F$529,$F41,$G$41:$G$529,$G41)>1textNO
 
Upvote 0
Thanks for that.
I had a closing bracket in the wrong place, it should be
Excel Formula:
=LET(f,FILTER(G2:G500,YEAR(A2:A500)=2024),m,MODE(f),CHOOSE({1,2},m,SUM(--(f=m))))
 
Upvote 0
Solution
Thanks for that.
I had a closing bracket in the wrong place, it should be
Excel Formula:
=LET(f,FILTER(G2:G500,YEAR(A2:A500)=2024),m,MODE(f),CHOOSE({1,2},m,SUM(--(f=m))))
Thank you, that was it. Really appreciate your help. Have a great day!
 
Upvote 0
Thank you, that was it. Really appreciate your help. Have a great day!
Ooops, I did have another question. Since it is utilizing MODE, can it be filled down showing the 2nd, 3rd, 4th.....occurrences along with the counts?
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,325
Members
452,635
Latest member
laura12345

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