# Count month with the most occurrences

#### Maurizio

##### Well-known Member
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

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

#### BobUmlas

##### Well-known Member
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

#### Fluff

##### MrExcel MVP, Moderator
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.

#### Maurizio

##### Well-known Member
Hi Fluff and BobUmlas,
many Thnks

#### Fluff

##### MrExcel MVP, Moderator
Glad we could help & thanks for the feedback

Replies
1
Views
67
Replies
3
Views
311
Replies
10
Views
382
Replies
1
Views
59
Replies
8
Views
136

1,127,387
Messages
5,624,402
Members
416,026
Latest member
melvic69

### 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.

### Which adblocker are you using?

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

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