Days in the month with DAY and EOMONTH
PremiumTo prorate the first month's rent you need the number of days in the move-in month. In B2, take the day number of the month's last day, DAY(EOMONTH(A2,0)).
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Move-in date | Days in month | ||||
| 2 | Feb 10, 2024 | |||||
| 3 | ||||||
| 4 | ||||||
| 5 | ||||||
| 6 | ||||||
| 7 | ||||||
| 8 |
Premium lesson
Unlock EDATE and EOMONTH and every other lesson
This is a premium lesson. Premium lets you solve it and every other lesson, take the timed mock tests, and earn certificates you can share on LinkedIn.
It comes up in this mock test: Excel test for accounting and bookkeeping
Your first month for $9.50 $19
50% off your first month when you join today.
Then $19/month. Cancel any time, and get a full refund within 14 days if it isn't for you.
Why this works
EOMONTH(A2,0) gives the last day of February 2024, Feb 29. DAY takes the day of the month out of that date, 29, which is also the number of days in the month. In 2025 the same formula gives 28.
Common mistake: Typing 30 or 31 by hand. February and leap years make a fixed number wrong several times a year.
The answer
- B2
=DAY(EOMONTH(A2,0))