Sub topic 14
Formatting Dates and Period Headers
Every model has a timeline across the top. If its dates are real dates, the headers can be formulas, the formats can change without touching the data, and functions like EOMONTH work. This chapter covers how Excel stores dates, which format codes control their display, and how to build monthly, quarterly, and annual headers that stay consistent.
It assumes you know the number format basics from earlier chapters (stored value versus displayed value, the Format Cells dialog) and the color-coding convention for inputs and formulas.
Dates are numbers
Excel stores a date as a serial number, which is the count of days since a starting point. In the default Windows date system, 31 March 2026 is stored as 46112. A date format only changes how that number looks.
This has two consequences for modeling:
- Date arithmetic works. Adding 1 moves one day forward, and date functions such as
EOMONTHandEDATEreturn serial numbers you can format any way you like. - A header that looks like a date but is text will not calculate. If a header is left-aligned by default or
=ISNUMBER(C5)returns FALSE, Excel is treating it as text.
Date format codes
The codes below are the ones you will use most. They go in the Custom category of Format Cells (Ctrl+1).
| Code | Meaning | Result for 31 Mar 2026 |
|---|---|---|
| `d` / `dd` | Day, without or with a leading zero | 31 |
| `ddd` / `dddd` | Weekday, short or long | Tue / Tuesday |
| `m` / `mm` | Month number, without or with a leading zero | 3 / 03 |
| `mmm` | Month, three letters | Mar |
| `mmmm` | Month, full name | March |
| `mmmmm` | Month, first letter only | M |
| `yy` / `yyyy` | Year, two or four digits | 26 / 2026 |
A compact period header for monthly columns:
mmm-yyThis displays 31 March 2026 as Mar-26.
Anything that is not a format code must be quoted or it may be misread. A fiscal-year label can be built by adding a literal prefix:
"FY"yyyyA date in 2026 then displays as FY2026. The cell still holds a date serial.
The month and minute ambiguity
The letter m means month by default. Excel reads it as minutes only when it follows an h or comes before an s. This matters only when you format times, but it explains odd results if you combine date and time codes in one format.
Building the timeline with formulas
Type the first period end date once, as an input in blue. Every other header is a formula, so the timeline cannot drift.
=EOMONTH(C5,1)Placed in D5 and filled right, this gives the last day of the following month. Using month-end dates keeps every header consistent, because EOMONTH handles 28, 30, and 31 day months for you. For quarterly or annual columns, change the second argument to 3 or 12.
Because the formula does not depend on the format, you can change a header row from monthly to annual by changing the step and the number format. The rest of the model is untouched.
Quarter and fiscal year labels
Excel has no built-in date format for quarters. You need a formula, and the result is text, so use it only for labels and never as the date that other formulas depend on. Keep the real date row and add a label row beneath it.
="Q"&ROUNDUP(MONTH(C$5)/3,0)&"-"&TEXT(C$5,"yy")For a date in March 2026 this returns Q1-26 (calendar quarters). For a fiscal year that ends in a month other than December, derive the fiscal year from the period end date and a single input holding the fiscal year end month number (for example, 6 for June):
=YEAR(EOMONTH(C$5,12-FYE_Month))With FYE_Month set to 6, a date in July 2025 returns 2026, because the fiscal year ending June 2026 contains it. Format the result with "FY"0 or concatenate "FY" in a text label. Keeping the fiscal year end month as a named input means a change in year end is a one-cell edit.
Actual and estimate flags
Many models mark actual and forecast periods. Resist hard-coding the letter into the date's format, because it will not move when the last actual date changes. Use a separate flag row driven by a single input, the last actual date:
=IF(C$5<=Last_Actual,"A","E")The header can then be combined with the flag by a label formula, or the flag can sit in a row directly above the dates. Conditional formatting can shade forecast columns using the same test.
Mixed references in header formulas
Formulas that read the header row are usually filled across and down. Anchor the row of the header with a mixed reference (press F4 while editing until the dollar sign sits before the row number), so the formula keeps pointing at row 5 as you copy it:
=C$5This is the same technique as C$5*$B8 from the editing chapter, and it keeps date logic consistent across every block of the model.
Common errors
- Text dates. Data pasted from another system often arrives as text such as
2026-03-31left-aligned in the cell. Changing the format does nothing, because there is no number to format. Convert with=DATEVALUE(A1)or Data > Text to Columns, and check withISNUMBER. - Typed headers. Typing "Mar-26" into a cell makes Excel guess a date, usually the first day of that month. Mixing first-of-month and month-end dates in one row breaks
EOMONTHchains and lookups that match dates exactly. - Format versus value in lookups. Two cells that both display Mar-26 can hold different serials (1 March and 31 March). An exact-match lookup fails even though the labels look identical. Use month-end dates everywhere.
- Two-digit year ambiguity.
yyhides the century. It is acceptable in a header, but never type a two-digit year as input without checking what Excel stored. - Regional settings. The format codes shown here are English. In other language versions of Excel, codes can differ (German uses
JJJJfor the year, for instance), and theTEXTfunction uses the same local codes. Check the workbook if it will be shared across locales.
Practice
Exercise
Cell C5 holds a date serial. You want it to display as FY2026, but you also want month-end date logic in other formulas to keep working. Which number format do you apply, and why is a TEXT formula the wrong tool here?
Show answer
Apply the custom format "FY"yyyy to C5. The cell keeps its date serial, so EOMONTH and date comparisons still work. A TEXT formula such as ="FY"&TEXT(C5,"yyyy") returns text, which other formulas can no longer use as a date.
Exercise
A monthly timeline starts with 31-Jan-26 in C5. Write the formula for D5 so that filling it right produces 28-Feb-26, 31-Mar-26, and so on, and name the format code that shows these as Feb-26, Mar-26.
Show answer
In D5 enter =EOMONTH(C5,1) and fill right. Format the row with mmm-yy.
Exercise
A lookup for Mar-26 fails even though the header row visibly shows Mar-26. What is the most likely cause and how do you confirm it?
Show answer
The header probably holds a first-of-month serial (1 March 2026) while the lookup value is a month-end serial (31 March 2026). Both display as Mar-26. Confirm by applying the General format (Ctrl+Shift+~) to both cells and comparing the serial numbers, then switch the header to month-end dates built with EOMONTH.