Count month with the most occurrences

Maurizio

Well-known Member
Joined
Oct 15, 2002
Messages
687
Office Version
  1. 2007
Platform
  1. Windows
Hi all,
I have this DB with dates as european format "dd/mm/yy":
31/03/20
23/04/20
17/04/20
23/04/20
24/04/20
22/02/20
23/04/20
23/04/20
... [empty cell]
22/04/20
22/04/20
24/04/20
... [empty cell]
24/04/20
23/04/20
23/04/20
28/01/20

I need a vba solution to give me --> 4
[ossia April the month with the most occurrences]

Tia. Maurizo
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Formula solution:
Define the cells as Rg, then this formula does the job:
=MATCH(MAX(FREQUENCY(MONTH(rg),ROW(1:12))),FREQUENCY(MONTH(rg),ROW(1:12)),0)

If you don't have Microsoft 365, you will need to ctrl/shift/enter that formula
 
Upvote 0
You don't need a macro, it can be done with a simple formula
+Fluff New.xlsm
KL
1
231/03/20204
323/04/2020
417/04/2020
523/04/2020
624/04/2020
722/02/2020
823/04/2020
923/04/2020
10
1122/04/2020
1222/04/2020
1324/04/2020
14
1524/04/2020
1623/04/2020
1723/04/2020
1828/01/2020
Sheetref
Cell Formulas
RangeFormula
L2L2=MODE(IF(K2:K100<>"",MONTH(K2:K100)))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Glad we could help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,213,526
Messages
6,114,136
Members
448,551
Latest member
Sienna de Souza

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