# 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

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

#### 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
105
Replies
3
Views
339
Replies
6
Views
114
Replies
10
Views
433
Replies
1
Views
74

1,130,425
Messages
5,642,042
Members
417,251
Latest member
Dordrecht

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