Excel Format Date in Header: Quick Guide
In this article
Yes, you can format a date in an Excel header, but the method depends on whether you want a static date (typed manually) or a dynamic date (updates automatically). For a dynamic date, you use the Header & Footer tools with the "Date" field, which inserts a code that displays the current date in your chosen format. This guide covers both approaches, including how to control the date format, common problems, and workarounds.
Understanding Header & Footer Dates in Excel
Excel's header and footer feature is designed for print layouts. It lets you add page numbers, file paths, sheet names, and dates to the top or bottom of each printed page. The date you insert can be either:
- Static: Typed as plain text, it never changes.
- Dynamic: Inserted via the "Date" field, it updates to the current system date whenever the worksheet is opened or printed.
By default, Excel uses the date format from your Windows regional settings (e.g., MM/DD/YYYY for US, DD/MM/YYYY for UK). However, you can customize this to display dates like "15 March 2025" or "Mar-25" by editing the field code directly.
How to Insert a Date in the Header
Here are the steps for both Excel 2016, 2019, 2021, and Microsoft 365 (the process is identical in most modern versions):
- Go to the Insert tab on the ribbon.
- Click Header & Footer in the Text group. Excel switches to Page Layout view and shows a text box labeled "Click to add header".
- Click inside the left, center, or right header section where you want the date.
- On the Header & Footer tab (which appears when you're in the header), click Date in the Header & Footer Elements group. This inserts a code like .
- Click anywhere outside the header to see the result. The date appears in the default format from your system settings.
If you want a static date, simply type the date as text (e.g., "March 15, 2025") instead of using the Date button. It won't change when you reopen the file.
Changing the Date Format in the Header
The code uses your system's short date format. To change it to a specific format (e.g., "15-Mar-2025"), you need to edit the field code manually:
- Click on the header section that contains the date.
- Right-click and select Edit Header, or just click into the header text.
- Select the code (it may appear as a highlighted field).
- Press Ctrl+F9 to add field braces around it. The code should look like (the braces are special field characters, not normal curly brackets).
- Type @ "dd-mmm-yyyy" inside the braces, after the date code. For example: .
- Press F9 to update the field, then click outside the header to see the result.
This works because the header date is a Word field. The @ switch specifies the date format using the same codes as Excel cells (d for day, m for month, y for year). Common formats:
dd/mm/yyyy→ 15/03/2025mmmm d, yyyy→ March 15, 2025mmm-yy→ Mar-25dddd, mmmm d→ Saturday, March 15
Why the Date Format Doesn't Stick
Users often find that after they set a custom format, the header reverts to the default on the next print or when the file is reopened. This happens because the field code is not updated automatically. You need to update it manually each time you change it, and Excel may reset it when the file is saved in certain formats (like .xls). Also, if you use the Date button again, it overwrites your custom code. To avoid this, always edit the code directly and update it with F9 before printing.
Another common issue: the date appears as a number (e.g., 45000). This occurs when the field code is missing the @ switch or when the braces are not proper field braces. Ensure you use Ctrl+F9 to create them, not typed curly brackets.
Alternative: Use a Cell Reference in the Header
If you want the header to show a date that you can control from a cell (e.g., a dynamic date that you can set to a specific value), you can't directly reference a cell in the header. However, a workaround is to use a macro or a third-party tool. For most users, the built-in Date field is sufficient. If you need a cell-driven header, you can use a simple VBA macro that updates the header whenever the cell changes, but that requires programming knowledge.
Printing Considerations and Page Setup
The header appears only in print preview and on printed pages, not in the normal worksheet view. To ensure the date prints correctly:
- Go to Page Layout > Page Setup dialog launcher.
- Under the Header/Footer tab, you can see a preview of the header.
- Use the Custom Header button to edit sections manually.
- Check the print preview (Ctrl+F2) to confirm the date format looks right.
Remember that the header date uses your system's date, not the worksheet's calculation date. If you need a date that updates based on a formula (like =TODAY()), you cannot put that formula directly in the header. You'd have to put the formula in a cell and then use a macro to copy it to the header.
Frequently Asked Questions
How do I add a date to the header in Excel for Mac?
The process is similar: go to the Insert tab, click Header & Footer, then click in the header section and click the Date button on the Header & Footer tab. To change the format, you can use the same field code method, but the keyboard shortcut for field braces is Cmd+F9 on Mac.
Why does my header date show as a number like 45000?
This happens when the field code is malformed. The code without the @ switch should still show a date, but if you manually typed braces or the field got corrupted, it may display the serial number. Delete the code and reinsert it using the Date button, then apply the format switch correctly.
Can I use a different date format for the header than the rest of the sheet?
Yes, the header format is independent of cell formats. You can set the header to display "March 15, 2025" while cells use "15/03/2025". Just use the field code switch to set the header format.
Does the header date update automatically when I print?
Yes, the field updates to the current system date each time you print or open the file in Print Preview. However, if you want it to update every time you print, ensure the field is set to update automatically (it usually is). If it doesn't, press Ctrl+A to select all, then F9 to update all fields before printing.
How do I remove the date from the header?
Click on the header section, select the date code, and press Delete. If the header is empty, it will show a blank space. You can also go to Page Setup > Header/Footer and choose (none) for the header.