Pivot Table Issues

Find Earliest Start and Latest End Times by Agent and Date in Excel

Steve KSteve K Dec 2, 2026 869 views

Question details

Find the earliest start time and latest end time for each agent on each date.

Find Earliest Start and Latest End Times by Agent and Date in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
A worksheet contains agent names, start dates, start times, and end times that need to be summarized by agent and date.
Observed behavior
The desired result is one earliest start time and one latest end time for each agent and start-date combination.
Before you start

Check that each column has a header and that dates and times are stored as Excel date and time values, not text. The Start Date column should contain dates without time components so records from the same day group together.

Solution 1Recommended

Summarize start and end times with an Excel PivotTable

Use a PivotTable to summarize all agents and dates at once.

1
Create the PivotTable

Select a cell in the source data, then choose Insert > PivotTable. Confirm the data range and choose where to place the PivotTable.

2
Add row fields

In the PivotTable Fields pane, drag Agent and Start Date to the Rows area.

3
Add time fields

Drag Start Time and End Time to the Values area. For Start Time, open Value Field Settings and select Min; for End Time, select Max.

4
Format the results

Open Value Field Settings for each time field, select Number Format, and choose a time format. Refresh the PivotTable when the source data changes.

Summarize start and end times with an Excel PivotTable
Overnight records: If an end time can fall after midnight, a time-only value does not identify the latest actual end. Use full date-and-time values for the end field and format the results to show both date and time.
Summarize times in WPS Spreadsheets

Find earliest and latest times with a WPS PivotTable

Use a PivotTable in WPS Spreadsheets to group records by agent and start date, then summarize the time fields with Min and Max.

  1. 1. Open the workbook: Open WPS Spreadsheets and use Open to select the workbook containing the agent, date, and time columns.
  2. 2. Insert a PivotTable: Select a cell in the data and choose Insert > PivotTable. Confirm the source range and destination.
  3. 3. Arrange the fields: Drag Agent and Start Date to Rows, then drag Start Time and End Time to Values.
  4. 4. Set the summaries: Open the value field settings for Start Time and select Min. Set End Time to Max, then format the results as times.
Summarize start and end times for multiple agents and datesOpen and edit Excel XLSX workbooksUse a familiar spreadsheet interfaceRefresh the PivotTable after source data changes
microsoft office alternative - wps office

Frequently Asked Questions

Why does my PivotTable show a count instead of a time?

The source time values may be stored as text. Convert them to numeric Excel times, refresh the PivotTable, and choose Min or Max in Value Field Settings.

How do I update the results after adding records?

Right-click the PivotTable and choose Refresh. If the new records are outside its source range, update the data source to include them first.

Can I use these methods for shifts that end after midnight?

Yes, if the end values include both the date and time. A time-only value cannot distinguish an end after midnight from an earlier end on the start date.

Why do MINIFS and MAXIFS return zero?

They return zero when no cells match the criteria. Check the agent name, date value, and formula ranges; a date containing a hidden time component may not match a date-only criterion.