Display Hourly Time Ranges in an Excel PivotTable
Question details
Display each hour in an Excel PivotTable as a one-hour range, such as 1–2 PM, instead of showing only the starting time.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A PivotTable summarizes hourly data, and each displayed hour represents the period from that hour to the next.
- Observed behavior
- The PivotTable shows starting times such as 1 PM rather than interval labels such as 1–2 PM.
Check that the source times are numeric Excel time or date/time values, not text. Identify the time column and whether you want to combine the same hourly periods across dates or keep each date separate.
Create hourly range labels in the source data and refresh the PivotTable
Use a helper column to generate the exact range labels you want, then use that column as the PivotTable row field.
Excel does not have a standard number format that calculates and displays both ends of a time interval. A source-data text label provides predictable results, including intervals that cross noon or midnight.
In the source worksheet, assume the original time is in A2. Add a column named Hour Start and enter =FLOOR(A2,1/24) in B2. Fill the formula down to round each source value down to the beginning of its hour.
Add a column named Hour Range. In C2, enter =IF(TEXT(B2,"AM/PM")=TEXT(B2+TIME(1,0,0),"AM/PM"),TEXT(B2,"h"),TEXT(B2,"h AM/PM"))&"–"&TEXT(B2+TIME(1,0,0),"h AM/PM") and fill it down. This produces labels such as 1–2 PM, 11 AM–12 PM, and 11 PM–12 AM.
Select the PivotTable and open PivotTable Analyze > Change Data Source. Extend the source range to include Hour Start and Hour Range, then select OK. If your source is an Excel table and the new columns are already included in it, you can skip changing the range.
Select PivotTable Analyze > Refresh. In PivotTable Fields, remove the original hour field from Rows and drag Hour Range into Rows. Keep the fields you summarize in Values. If you need to separate different dates, also place a source Date field above Hour Range in Rows.
Review the row labels because text ranges may sort alphabetically rather than chronologically. For a small set of hourly labels, right-click a label and use Move, or drag the labels into the required order. For a reusable chronological layout, place Hour Start above Hour Range in Rows and sort Hour Start from oldest to newest.

Create hourly PivotTable range labels in WPS Spreadsheet
WPS Spreadsheet can create hourly helper columns and summarize their labels in a PivotTable. Use FLOOR, TEXT, IF, and TIME to turn starting times into readable ranges before building the summary.
- 1. Open the workbook: Open WPS Spreadsheet and choose Menu > Open to select your Excel workbook. Locate the worksheet containing the source times.
- 2. Add an hourly start column: Assuming the original time is in A2, type Hour Start in B1 and enter =FLOOR(A2,1/24) in B2. Drag the fill handle down through your data.
- 3. Generate the display labels: Type Hour Range in C1. In C2, enter =IF(TEXT(B2,"AM/PM")=TEXT(B2+TIME(1,0,0),"AM/PM"),TEXT(B2,"h"),TEXT(B2,"h AM/PM"))&"–"&TEXT(B2+TIME(1,0,0),"h AM/PM") and fill it down.
- 4. Build the hourly summary: Select the source data, including the helper columns, and choose Insert > PivotTable. Choose the destination, then place Hour Range in Rows and your measurement field in Values. If chronological order matters, place Hour Start above Hour Range and sort that field ascending.

Frequently Asked Questions
Can a custom Excel time format show 1–2 PM automatically?
No standard time format calculates a second time one hour later. Create a helper column in the source worksheet that combines the start and end times with TEXT, then use that column in the PivotTable.
What if my source records include minutes, such as 1:35 PM?
First round each record down to its hourly start with =FLOOR(A2,1/24). Build the label from that result so 1:35 PM belongs to the 1–2 PM interval.
How does the formula handle noon and midnight?
The conditional formula compares the start and end AM/PM markers. When they differ, it shows both markers, producing 11 AM–12 PM or 11 PM–12 AM rather than an ambiguous label.
Why is my new Hour Range field missing from the PivotTable Fields list?
The helper column may be outside the PivotTable source range. Select PivotTable Analyze > Change Data Source, include the new column, and then select PivotTable Analyze > Refresh.
Will hourly labels combine records from different dates?
Yes. Identical text labels, such as 1–2 PM, are summarized together. To keep dates separate, add a date-only field to the source data and place it above Hour Range in the PivotTable Rows area.




