Function Problems

Excel Formula to Find Agents Scheduled for Full Two-Hour Shifts

Khadija KhanKhadija Khan Oct 8, 2026 868 views

Question details

The user needs an automated way to identify agents who are scheduled for consecutive 30-minute intervals that completely fill a specific two-hour block.

Excel Formula to Find Agents Scheduled for Full Two-Hour Shifts
Product
Excel
Device & OS
not provided
Scenario
Managing an employee schedule containing 30-minute interval data and attempting to extract or highlight agents working complete two-hour shifts like 7:00-9:00 AM.
Observed behavior
The goal is to successfully filter the data to display only the agents who appear in all four required 30-minute intervals for the designated date and time period.
Before you start

Ensure your schedule data is organized in clear columns (e.g., Date, Time, Agent) and that all time values are properly formatted as 'Time' rather than standard text.

Solution 1Recommended

Use Helper Columns and COUNTIFS

By categorizing individual time intervals into two-hour blocks using an IF formula, you can use COUNTIFS to count if an agent fulfills all four 30-minute slots.

This method is highly recommended because it breaks the logic down into manageable steps. First, you classify each 30-minute slot into a broader two-hour shift group. Then, you simply count how many times an agent appears in that specific group.

1
Add a Shift Classification Helper Column

Create a new column next to your time data. Assuming your time intervals are in column B starting at row 3, enter the formula: =IF(B3<TIME(9,0,0),"7-9 AM",IF(B3<TIME(11,0,0),"9-11 AM","Other")).

2
Apply the Formula to All Rows

Drag the fill handle down to apply this helper formula to the rest of the rows in your schedule, categorizing every time slot.

3
Count the Agent Occurrences

In a separate summary table, use the COUNTIFS function to count occurrences for each agent in a specific shift. Use a formula like: =COUNTIFS(DateColumn, TargetDate, ShiftColumn, "7-9 AM", AgentColumn, TargetAgent).

4
Filter for Full Shifts

Review the COUNTIFS results. Since a two-hour shift consists of four 30-minute intervals, any agent with a result of '4' has worked the full shift.

Use Helper Columns and COUNTIFS
Customizing the Formula: You can nest additional IF statements or use IFS (if supported) to categorize the rest of the day, such as 11:00 AM-1:00 PM and so on.
Schedule Management

Easily Track Agent Shifts with WPS Spreadsheet

WPS Spreadsheet provides powerful built-in calculation capabilities, including full support for complex logical functions like IF, COUNTIFS, and SUMPRODUCT, making it incredibly easy to manage comprehensive employee schedules.

  1. 1. Open Your Schedule: Launch WPS Spreadsheet and open your existing scheduling workbook.
  2. 2. Insert the Helper Formula: Use the IF and TIME functions in an adjacent column to categorize the 30-minute shifts.
  3. 3. Count the Shifts: Apply the COUNTIFS formula to accurately detect which agents meet the 4-interval requirement.
Fully compatible with Microsoft Excel formulas and .xlsx file formats.Supports advanced array formulas for precise time and shift tracking.Lightweight software with a familiar, easy-to-use interface.Free built-in scheduling templates to help you organize data faster.
microsoft office alternative - wps office

Frequently Asked Questions

Why does the TIME function return an error in my formula?

This usually happens if your underlying cell formatting is set to text instead of time, or if the arguments inside TIME(hour, minute, second) exceed their standard limits. Ensure your time data is properly formatted as Time.

Can I use Pivot Tables to find agents working full shifts instead of formulas?

Yes. Once you add the helper column to classify the two-hour blocks, you can insert a Pivot Table. Place the Agent names in the Rows area and the Helper Column in the Columns area. Apply a value count, and simply filter for agents showing a count of 4.

How do I adjust the formula for 15-minute scheduling intervals?

If you are using 15-minute intervals instead of 30-minute intervals, a full two-hour shift will consist of 8 intervals. You will need to check for a COUNTIFS or SUMPRODUCT result of 8 instead of 4.