Function Problems

Check Multiple Time Ranges and Return a Team Value in WPS Spreadsheet

Camila MilosovichCamila Milosovich Nov 12, 2026 869 views

Question details

Create a formula that checks all records for the team in the current row and returns that team value when a timeline time falls within a matching start and end time range.

Check Multiple Time Ranges and Return a Team Value in WPS Spreadsheet
Product
WPS Spreadsheet
Device & OS
not provided
Scenario
A timeline grid needs to identify whether the time in each column matches any record belonging to the team listed on the current row.
Observed behavior
The desired result is to display the current team value in matching timeline cells and leave nonmatching cells blank.
Before you start

Make sure the start-time and end-time columns contain real date/time values rather than text. Confirm that the tolerance value in K1 uses the same time unit as the values in the timeline and record table.

Solution 1Recommended

Use COUNTIFS to return the team when a matching time range exists

Use this option when you only need to confirm that at least one record for the current team contains the timeline time. It is concise and avoids returning an error when no record matches.

This formula checks the team, start time, and end time together. It returns the value in column J only when at least one matching record is found.

1
Select the first timeline result cell

Click cell L3, or select the first cell where the team result should appear for the time shown in L2.

2
Enter the range-matching formula

Enter =IF(COUNTIFS(Table23[TEAM],$J3,Table23[STA],"<="&L$2+$K$1,Table23[STD],">="&L$2-$K$1)>0,$J3,"") and press Enter.

3
Fill the formula across the timeline and down the team rows

Use the fill handle at the lower-right corner of L3 to drag the formula across and down. The $J3 reference keeps the team column fixed, while L$2 keeps the timeline header row fixed.

4
Apply conditional formatting if needed

Select the timeline result range, then choose Home > Conditional Formatting and create a rule for cells that are not blank or that equal the team number.

Use COUNTIFS to return the team when a matching time range exists
How the tolerance works: K1 expands each matching window. The formula accepts a timeline time up to K1 before the start time or K1 after the end time.
Work with time-range formulas in WPS Spreadsheet

Match Team Time Ranges with WPS Spreadsheet Functions

WPS Spreadsheet lets you build time-range checks with COUNTIFS, LET, and FILTER, then fill the formula through a timeline grid and highlight matching team values with conditional formatting.

  1. 1. Open the workbook in WPS Spreadsheet: Open the source .xlsx or .xls file and verify that the TEAM, STA, and STD columns are included in Table23.
  2. 2. Check the time inputs: Select the start, end, and timeline cells, then use Home > Number Format to confirm that they are recognized as date/time values.
  3. 3. Add the matching formula: Click the first result cell, such as L3, and enter the COUNTIFS formula that references the current team, timeline header, and tolerance cell.
  4. 4. Fill the timeline grid: Drag the fill handle across the timeline and down the team rows to apply the adjusted references.
  5. 5. Highlight returned values: Select the output range and choose Home > Conditional Formatting to format cells containing returned team values.
Use COUNTIFS to test team, start-time, and end-time criteria in one formula.Apply conditional formatting to visually identify matched timeline cells.Open and edit Microsoft Excel .xlsx and .xls spreadsheets with formula compatibility.Use a familiar spreadsheet interface for seamless migration from Microsoft Excel.
microsoft office alternative - wps office

Frequently Asked Questions

Why does the formula return a blank when the timeline time looks like it is inside the range?

Check whether STA, STD, and the timeline header are stored as real date/time numbers. Select the cells and use Home > Number Format to apply a date or time format; text values cannot be reliably compared by COUNTIFS.

How do I match an exact time range without any tolerance?

Set K1 to 0. The formula then matches only when the timeline value in L2 is greater than or equal to STA and less than or equal to STD.

Can the formula return a team name instead of a team number?

Yes. Keep the team name in column J and in Table23[TEAM]. The formula returns $J3, so it can return text names as well as numeric identifiers.

What happens if more than one record matches the same team and time?

The COUNTIFS version still returns the team value because it only tests whether one or more matches exist. Use the LET and FILTER version if you need to inspect the individual matching records.

How can I color only the cells where a team was returned?

Select the output grid, choose Home > Conditional Formatting, and create a rule for nonblank cells or for cells equal to a specific team value.