Power Query Problems

How to Generate Five-Minute Time Intervals in WPS Office Power Query Without Overshooting

Nimra MalikNimra Malik Nov 13, 2026 870 views

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.

How to Generate Five-Minute Time Intervals in WPS Office Power Query Without Overshooting
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.
Before you start

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.

Solution 1Recommended

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.

1
Open Power Query Editor

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.

2
Add a custom column

In the Power Query Editor, click Add Column > Custom Column and name the new column TimeSlots.

3
Enter the List.Times formula

In the custom column formula box, enter: = List.Times(Time.From([Start]), Duration.TotalMinutes([End]-[Start])/5+1, #duration(0,0,5,0)).

4
Expand the list column

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.

Use List.Times with Duration.TotalMinutes to include both endpoints
Both endpoints are included: The /5 + 1 calculation ensures the first and last five-minute intervals are included without overshooting the end time.
Power Query interval fix

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. 1. Open the workbook: Open the target workbook in WPS Office and select the table that contains the Start and End time columns.
  2. 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. 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. 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.
Creates precise five-minute intervals without overshooting the end timeSupports Excel workbooks and Power Query formulas for easy format compatibilityUses the familiar Power Query Editor interface within free WPS OfficeLets you expand interval lists directly into WPS Office worksheets
QA img-9

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.