Count the days in a date’s month

Turn the date November 4, 2026 into the number of days in its month: 30.

What you'll make

In Excel: February 29, 2024 becomes 29.

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesResult so far
1A8The real date.November 4, 2026
20Stays in the same month.November 2026
3EOMONTH( … ,0)Finds the last day of that month.November 30, 2026
4DAY( … )Gives that last day as a number.30

Each bracket wraps the one above it, so Excel works from the inside out. Leap years are counted.

=DAY(EOMONTH(A8,0))

How to use it

Yellow bar at the top? Click Enable Editing.

  1. See it work. The Example tab shows 20 made-up examples with the formula already in.
  2. Use your own dates. Paste real dates into the green column of the Template tab. The day counts fill in by themselves.
  3. Move them into your letter. Copy the results. Then use Paste Special and choose Values.

Before you send

Pasted text that only looks like a date may turn amber. Retype it as a real date.

Microsoft's help: EOMONTH function