Find how many days are in the month a date belongs to.
Copy this formula
=DAY(EOMONTH(A2, 0))EOMONTH(A2, 0) returns the last day of the month, and DAY pulls out its day number — which is exactly the count of days that month. It handles February and leap years automatically.
=DAY(EOMONTH(DATE(2026,2,1), 0))→28February 2026 has 28 days.
=DAY(DATE(YEAR(A2),3,0))=29 returns TRUE for a leap year.
Need a formula for your own data?
Describe what you want in plain language and let ExcelGPT write, explain, and verify the formula — free to start, no plugin.