Although EOMONTH is a more convenient function, it won’t accept a range of dates in anarray formula.

In that case, you could use the alternative above.

Excel formula: Get last working day in month

Excel formula: Get first day of month

Excel formula: Dynamic calendar grid

Excel EOMONTH function

Excel DATE function