Extract Names Inside or Outside a Time Range with Excel FILTER
Question details
Extract names associated with times inside or outside a specified time range.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet contains names and corresponding times that need to be filtered against start and end times.
- Observed behavior
- The desired result is a list of names matching either the inside-range or outside-range condition.
For the examples below, place names in B3:B12, their corresponding times in C3:C12, the start time in C16, and the end time in D16. Ensure the time cells contain actual Excel time values and that the start time is earlier than or equal to the end time.
Use FILTER to extract names inside a time range
Use multiplication to require each time to meet both range boundaries.
Click an empty cell with enough clear space below it for the matching names.
Enter =FILTER(B3:B12,(C3:C12>=C16)*(C3:C12<=D16),"No matches") and press Enter.
Review the spilled list in the output cells. Times equal to either boundary are included.

Use FILTER to extract names outside a time range
Use addition to include times that are before the start or after the end.
Extract names by time range in WPS Spreadsheet
Use FILTER in a WPS Spreadsheet version that supports it to return names inside or outside your chosen time range.
- 1. Open the workbook: Open WPS Spreadsheet and select Open to choose your Excel workbook.
- 2. Set the time boundaries: Enter the start time in C16 and the end time in D16; place names in B3:B12 and corresponding times in C3:C12.
- 3. Filter the names: In an empty cell, enter =FILTER(B3:B12,(C3:C12>=C16)*(C3:C12<=D16),"No matches") and press Enter. For outside times, replace the condition with (C3:C12<C16)+(C3:C12>D16).
- 4. Save the workbook: Review the results, then select File > Save or Save As to save your changes.

Frequently Asked Questions
How do I include times equal to the start or end?
Use >= for the start comparison and <= for the end comparison, as in (C3:C12>=C16)*(C3:C12<=D16).
Why does the formula return No matches?
Check that C3:C12, C16, and D16 contain actual time values rather than text, and confirm that at least one time meets the selected conditions.
Can these formulas handle a range that crosses midnight?
Not as written. For a time-only range such as 10:00 PM to 2:00 AM, the inside condition is (C3:C12>=C16)+(C3:C12<=D16), and the outside condition is (C3:C12<C16)*(C3:C12>D16).
What if Excel does not recognize FILTER?
Check whether your Excel version supports FILTER and dynamic arrays. If it does not, use a supported version or filter the time column through Data > Filter.




