How to Generate Five-Minute Time Intervals in WPS Office Power Query Without Overshooting
Question details
The user needs to generate a list of times at five-minute intervals from a start time to an end time in Power Query, including both endpoints without exceeding the end time.

- Product
- WPS Office Power Query
- Device & OS
- not provided
- Scenario
- Creating time-slot or schedule interval lists in Power Query from start and end time columns.
- Observed behavior
- A formula may overshoot the end time or use Duration.Minutes, which returns only the minute component instead of total elapsed minutes.
Open the workbook in WPS Office and confirm that the Start and End columns are time or datetime values. If either column is stored as text, convert it to a time or datetime format before opening Power Query Editor.
Use List.Times with Duration.TotalMinutes to include both endpoints
Use this solution when you need a precise Power Query list that includes the start and end times and advances in five-minute steps.
The interval count must be based on the total duration in minutes, not on the minute component of a duration. Calculating Duration.TotalMinutes([End]-[Start])/5+1 gives the correct number of five-minute slots, including the starting interval.
In WPS Office, select the table that contains the Start and End columns, go to the Data tab, and click From Table/Range to open Power Query Editor.
In the Power Query Editor, click Add Column > Custom Column and name the new column TimeSlots.
In the custom column formula box, enter: = List.Times(Time.From([Start]), Duration.TotalMinutes([End]-[Start])/5+1, #duration(0,0,5,0)).
Click the expand icon in the TimeSlots column header, choose Expand to New Rows, and then click Close & Load to load the interval list into the worksheet.

Generate five-minute interval lists with WPS Office Power Query
Open Power Query Editor in WPS Office, add a custom column with List.Times, and expand the list. The formula uses Duration.TotalMinutes to calculate the full time span, so the output includes both endpoints and does not overshoot.
- 1. Open the workbook: Open the target workbook in WPS Office and select the table that contains the Start and End time columns.
- 2. Launch Power Query Editor: Go to the Data tab and choose From Table/Range to load the selected table into Power Query Editor.
- 3. Add the interval formula: Click Add Column > Custom Column, name it TimeSlots, and enter = List.Times(Time.From([Start]), Duration.TotalMinutes([End]-[Start])/5+1, #duration(0,0,5,0)).
- 4. Expand and load the list: Click the expand button on the TimeSlots column, select Expand to New Rows, and click Close & Load to return the interval list to WPS Office.

Frequently Asked Questions
Why does my Power Query time list go past the end time?
The item count calculation is likely off. Use Duration.TotalMinutes([End]-[Start])/5+1 as the count in List.Times so the list includes both endpoints and does not overshoot.
Can I use Duration.Minutes to create five-minute intervals?
No. Duration.Minutes returns only the minute component of a duration, not the total number of elapsed minutes between two times. Use Duration.TotalMinutes for the full span.
How do I expand the generated time list in Power Query?
In WPS Office Power Query, click the expand icon in the custom list column header, choose Expand to New Rows, and then use Close & Load to load the expanded interval list.
Why do I add 1 after dividing the total minutes by 5?
The +1 includes the starting interval. For example, a 60-minute period has 12 five-minute steps, so 12+1 gives 13 items from the start time through the end time inclusive.
Does this method work when the end time crosses midnight?
It works when Start and End are complete datetime values. If you use time-only values that cross midnight, add date information or convert the fields to datetime before applying the formula.




