Excel Group Time by Intervals: 5 Easy Ways
In this article
To group time data in Excel by intervals such as 5, 10, 15, or 30 minutes, use the FLOOR function to round each time down to the nearest multiple of your desired interval, then use that rounded value as your grouping field in a pivot table or summary. This article explains the formula, shows how to set it up, and covers common pitfalls.
in t | Time (minutes) | min | 450 | 0 in interval | Interval (minutes) | min | 15 | 1 out group | Group start (min) | min | floor(t / interval) * interval | 0 out group_time | Group start (clock) | clock | floor(t / interval) * interval | 0
Formula
The core formula is:
Group start = FLOOR(time / interval) * interval
Where:
- time is the time value you want to group (in Excel, a time is stored as a fraction of a day, but you can work in minutes by multiplying by 1440).
- interval is the number of minutes in each group (e.g., 5, 10, 15, 30).
If your time is in a cell like A2 (formatted as time), the formula to get the group start as a time is:
=FLOOR(A2*1440/interval,1)*interval/1440
This converts the time to minutes, divides by the interval, rounds down to the nearest whole number, multiplies back, and converts to a time value. Alternatively, you can use the MROUND function to round to the nearest interval (not just down) or CEILING to round up.
Worked Example
Using the default values from the calculator above: time = 450 minutes (which is 7:30 AM) and interval = 15 minutes.
- Divide time by interval: 450 / 15 = 30
- Floor the result: 30 (already an integer)
- Multiply by interval: 30 * 15 = 450 minutes
- Convert to clock time: 450 minutes after midnight = 7:30 AM
So the group start is 7:30 AM. If you had a time of 7:36 AM (456 minutes), 456 / 15 = 30.4, floor = 30, group start = 450 minutes = 7:30 AM. That time belongs to the 7:30-7:44 group.
Why Group Time in Excel?
Grouping time data is common when analyzing call logs, sales transactions, website visits, or any timestamped events. Instead of seeing a long list of individual times, you want to see totals per 15-minute or hourly block. This makes it easier to spot patterns, like peak hours or daily trends.
How to Group Time Using a Pivot Table
If your data has a column of timestamps, you can group them directly in a pivot table:
- Select your data and insert a pivot table (Insert > PivotTable).
- Drag the time field to the Rows area.
- Right-click any time value in the pivot table and choose Group.
- In the dialog, set Minutes as the grouping unit and enter the interval (e.g., 15).
- Click OK. The pivot table now shows time groups like 7:30, 7:45, 8:00, etc.
This method is quick and doesn't require a helper column, but it only works if your time values are actual Excel times (not text). If you have dates and times combined, you may need to extract the time first using =MOD(A2,1).
Using Formulas to Create a Group Column
If you prefer to add a helper column, use the formula above. For example, with time in A2 and interval in B2 (e.g., 15), put in C2:
=FLOOR(A2*1440/B2,1)*B2/1440
Format C2 as a time. Then you can use this column as a row label in a pivot table or in a COUNTIFS/SUMIFS summary.
Common Mistakes and How to Avoid Them
- Using MROUND when you want floor: MROUND rounds to the nearest, so 7:36 with 15-minute interval would round to 7:30 (down) but 7:37 would round to 7:45 (up). Decide whether you want each time to belong to the interval that starts at or before it (floor) or the nearest one.
- Forgetting to convert to minutes: If you use
=FLOOR(A2/B2,1)directly on time values, Excel treats times as fractions of a day, so the result will be wrong. Always multiply by 1440 to get minutes. - Text-formatted times: If your times are stored as text, the formula won't work. Convert them to real times using
=TIMEVALUE(A2)or use Text to Columns. - Grouping by hours when you need minutes: In pivot table grouping, you can select multiple units (like hours and minutes) but be careful—if you select both, Excel will group by hour and minute, which may not be what you want.
Comparing FLOOR, CEILING, and MROUND
- FLOOR: rounds down to the nearest multiple of the interval. Use this when you want each time to be assigned to the interval that starts at or before it (e.g., 7:36 goes to 7:30).
- CEILING: rounds up to the nearest multiple. This assigns 7:36 to 7:45. Useful for grouping into 'end-of-interval' buckets.
- MROUND: rounds to the nearest multiple (up or down). This can cause times near the boundary to be assigned to either side, which may be inconsistent if you need strict non-overlapping groups.
Frequently Asked Questions
How do I group time by 30 minutes in Excel?
Use the same formula with interval = 30. For example, =FLOOR(A2*1440/30,1)*30/1440 will round any time down to the nearest half-hour. In a pivot table, set the grouping to 30 minutes.
Can I group time by hour and minute at the same time?
Yes, in a pivot table you can select both 'Hours' and 'Minutes' in the grouping dialog. This will create groups like 7:30, 7:45, 8:00, etc. But be aware that if you select both, Excel will use both as grouping levels, which may create a hierarchy rather than a single combined group.
Why does my pivot table show dates instead of times?
If your data contains both dates and times, Excel treats the whole value as a datetime. To group by time only, extract the time with =MOD(A2,1) and use that in the pivot table.
How do I group times into custom intervals like 7 minutes?
Use the formula with any interval you like. For 7-minute intervals, replace the interval with 7. The formula works for any positive number.
What if my times are in different time zones?
Excel doesn't handle time zones natively. Convert all times to a common time zone before grouping, or use a helper column that adjusts the time to your reference time zone.