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.
Next with premium:NETWORKDAYS, WORKDAY and WEEKDAYDATEDIF
It comes up in this mock test: Excel test for accounting and bookkeeping
Need help?
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))
Use =DAY(EOMONTH(A2,0)). EOMONTH finds the last day of the month and DAY gives its day number.