LibreOffice Calc Header and Footer Variables
When printing spreadsheets in LibreOffice Calc, headers and footers can automatically display dynamic document metadata using predefined variables. This article outlines all the built-in variables available for headers and footers—including page counts, dates, times, file names, and sheet names—and explains how to apply them to your print layouts.
Accessing the Header and Footer Editor
To insert variables into a header or footer in LibreOffice Calc:
- Open your spreadsheet and navigate to Format in the top menu.
- Select Page Style (or Page in older versions).
- Click either the Header or Footer tab.
- Ensure the Header on or Footer on checkbox is enabled, then click the Edit… button.
The editor window provides three distinct sections (Left area, Center area, and Right area) where you can enter custom text and insert dynamic variable buttons.
Available Header and Footer Variables
LibreOffice Calc provides standard variable buttons located below the text entry fields in the editor:
- Page Number (
Page): Inserts the current page number. - Total Pages (
Pages): Inserts the total number of pages in the current print job. - Date (
Date): Inserts the current system date, which updates automatically upon printing. - Time (
Time): Inserts the current system time at the moment of printing. - File Name (
File Name/Document Title): Inserts the name of the file. Clicking the arrow next to the button allows you to choose between:- Title: The title set in the document properties.
- File Name: The name of the file without its full system path.
- Path/File Name: The full directory path along with the file name.
- Sheet Name (
Sheet): Inserts the name of the specific worksheet currently being printed.
Creating Common Formats
You can combine static text with dynamic variables to create standard document notations:
- “Page X of Y”: Click the Page
Number button, type
of, and then click the Total Pages button. The field will display asPage 1 of 5during printing. - Timestamped Sheet Tracking: Combine text and
variables such as
Sheet:followed by the Sheet Name button, and on a new line,Printed on:followed by the Date and Time buttons.