Sub topic 7
Period start, period end and days in period
This chapter builds the three date rows that sit under the timeline header: period start, period end and days in period. It assumes you can write formulas with relative and absolute references, and that you have seen EOMONTH and EDATE in the earlier chapters. You should know that EOMONTH returns a month-end serial number and that period columns are anchored on month ends.
Why three rows
A header row with month-end dates is enough to label columns. It is not enough to calculate with. Many monthly calculations need to know when a period began and how long it lasted:
- Interest accrues per day, so it needs the day count.
- Prorated costs, such as a contract that starts mid-month, need the first and last day of the period.
- Flags that test whether an event date falls inside a period need both boundaries.
Deriving all three rows from one start-date input keeps them consistent. Changing the input moves every column at once.
The layout
The examples use this layout. Labels are in column B, inputs in column C, and the first period is column D.
| Cell or row | Content |
|---|---|
| C2 | Model start date (any date in the first month) |
| Row 5 | Period start |
| Row 6 | Period end |
| Row 7 | Days in period |
With C2 set to 15-Jan-2025, the first five columns look like this:
| Row | D | E | F | G | H |
|---|---|---|---|---|---|
| Period start | 01-Jan-2025 | 01-Feb-2025 | 01-Mar-2025 | 01-Apr-2025 | 01-May-2025 |
| Period end | 31-Jan-2025 | 28-Feb-2025 | 31-Mar-2025 | 30-Apr-2025 | 31-May-2025 |
| Days | 31 | 28 | 31 | 30 | 31 |
The formulas
Inputs: C2 = model start date (any date in the first month, e.g. 15-Jan-2025)
Row 5 (period start): D5: =EOMONTH(C2,-1)+1 E5: =D6+1
Row 6 (period end): D6: =EOMONTH(C2,0) E6: =EOMONTH(D6,1)
Row 7 (days): D7: =D6-D5+1 copy rightCopy E5 and E6 to the right across all period columns. Copy D7 across the whole row, including column D.
The first column and the later columns use different formulas, because the first column has no previous period to follow. The first column reads the input. Every later column reads its left-hand neighbour. This is the only place where the timeline changes formula pattern, so mark column D visibly, for example with a different fill colour or a note in a label column. Some modelers avoid the inconsistency by putting a "period 0" column to the left that holds the opening date, so every live column shares one formula. That is a reasonable alternative, but it costs an extra column that every other row must ignore.
How each formula works
Period end, first column. EOMONTH(C2,0) returns the last day of the month that contains C2. With 15-Jan-2025 it returns 31-Jan-2025. The 0 means "this month, no shift".
Period end, later columns. EOMONTH(D6,1) steps from the previous period end to the end of the next month. Because EOMONTH always returns a real last day, the result stays correct through 28, 29, 30 and 31-day months. Chaining EDATE here would drift after a short month, which is why period columns use EOMONTH.
Period start, first column. EOMONTH(C2,-1) is the last day of the previous month, 31-Dec-2024. Adding 1 gives the first day of C2's month. This is the standard way to find the first day of a month in Excel, and it works whether C2 is the 1st, the 15th or the 31st.
Period start, later columns. D6+1 is the day after the previous period ends. This guarantees there is no gap and no overlap between periods. The alternative, =EOMONTH(E6,-1)+1, also gives the right answer, but it would make the start row independent of the previous column. A broken period end could then slip through without the continuity check noticing.
Days in period. D6-D5+1 subtracts two serial numbers, which gives the number of days between them, then adds 1 to include both boundary days.
Why the plus one matters
Serial numbers count days, so subtracting two dates gives the gap between them, not the number of days they cover. 31-Jan-2025 minus 1-Jan-2025 is 30, but January has 31 days, because both the first and the last day are inside the period.
Forgetting the +1 is the most common error in this block. It does not produce an error value. Every period is simply one day short, and results such as interest look plausible but are slightly wrong.
Dates are serial numbers
All of these formulas work because Excel stores each date as a serial number, a count of days since an origin date. 1-Jan-2025 is 45658, and 31-Jan-2025 is 45688. Adding 1 moves to the next day, and subtracting gives a number of days.
Two consequences follow:
- Cells in rows 5 and 6 must be formatted as dates, for example
dd-mmm-yyyy. Otherwise they show numbers such as 45658 and look broken, even though the values are correct. - Row 7 must be formatted as a number, not a date. If Excel guesses a date format for a subtraction result, 31 displays as 31-Jan-1900.
Using the day count
Days in period feeds any calculation that depends on real calendar length. For example, interest on an opening balance using an actual/365 convention:
Inputs: C30 = annual interest rate (e.g. 6%)
Row 31 (opening balance): D31 holds the opening balance for the period
Row 32 (interest): D32: =D31*$C$30*D7/365February accrues 28 days of interest and January accrues 31. A flat rate/12 ignores that difference. Whether the model should use actual/365, actual/360 or 30/360 depends on the financing agreement, so treat the divisor as an input in a real model instead of typing 365 into the formula.
Days also reveal leap years. With a start date in January 2024, February 2024 shows 29 days, and a full 12-month block sums to 366.
=SUM(D7:O7) -> 366 for Jan-2024 to Dec-2024
=SUM(D7:O7) -> 365 for Jan-2025 to Dec-2025Mid-month start dates
If C2 is 15-Jan-2025, the formulas above still show a full January: start 01-Jan-2025, end 31-Jan-2025, 31 days. The first period is the whole calendar month that contains the input. This is the right default for a model that works in whole months.
If the first period should start on the input date itself and run to the month end, that is a stub period. In that case the first start cell becomes =C2, and the days formula =D6-D5+1 gives 17 for 15-Jan to 31-Jan. The days formula needs no change, which is a good reason to calculate days from the dates instead of using DAY(D6). DAY(D6) only equals the day count when the period is a full month. Stub periods are covered in a later chapter.
Quick checks
Two small checks protect these rows. Both return a clear signal when something has been overwritten or mistyped.
Continuity check (row 11): E11: =E5-D6 -> must equal 1 in every column
End-of-month check (row 12): D12: =D6=EOMONTH(D6,0) -> must be TRUEThe continuity check proves each period starts the day after the previous one ends. The end-of-month check proves each period end really is a month end. If someone pastes a hard-coded date into row 6, at least one of them will fail. The checks chapter later in this tutorial collects these into a single summary flag.
Common errors
| Symptom | Likely cause |
|---|---|
| Dates show as five-digit numbers | Cells formatted as General instead of a date format |
| Days are one too low everywhere | Missing `+1` in the day count |
| A period end such as 28-Mar after February | Period ends chained with EDATE instead of EOMONTH |
| Two periods overlap or leave a gap | A hard-coded start or end date inside the row |
| First period starts on the 15th | First start cell uses `=C2` where whole months are intended, or the stub choice was not made deliberately |
| Row 7 shows a date | Days row inherited a date number format |
Exercise
The model start date in C2 is 31-Mar-2025. What do D5, D6 and D7 return, and what do E5, E6 and E7 return?
Show answer
D5 = EOMONTH(C2,-1)+1 = 28-Feb-2025 + 1 = 01-Mar-2025. D6 = EOMONTH(C2,0) = 31-Mar-2025. D7 = 31-Mar minus 01-Mar plus 1 = 31. E5 = D6+1 = 01-Apr-2025. E6 = EOMONTH(D6,1) = 30-Apr-2025. E7 = 30. The start formula returns the first day of March even though the input is the last day of the month.
Exercise
A colleague changes the days formula to =D6-D5 so that the row "matches the subtraction used elsewhere". With C2 in January 2025, what do the first three day counts become, and how would the continuity check in row 11 respond?
Show answer
The counts become 30, 27 and 30 instead of 31, 28 and 31, because both boundary days are no longer counted. The continuity check does not respond, because it compares each period start with the previous period end and does not use row 7. The error would only show up in a check on the sum of days, for example a 12-month total of 353 instead of 365, which is why a days total check is worth adding.
Exercise
Write the formula for D7 that gives the day count for a period whose start (D5) and end (D6) are real dates, and explain why it is safer than =DAY(D6).
Show answer
=D6-D5+1. It works for any period length, including stub periods that start mid-month. =DAY(D6) returns the day number of the end date, which equals the day count only when the period starts on the 1st.