Formula Errors

Excel Formula to Test Whether Two Ranges Overlap

Steve KSteve K Oct 26, 2026 869 views

Question details

The user needs an Excel formula to check if two numerical ranges overlap, including scenarios where one contains the other or endpoints touch.

How to Test Whether Two Ranges Overlap Using an Excel Formula
Product
Excel
Device & OS
not provided
Scenario
Comparing two sets of numerical boundaries (lower and upper bounds) to identify intersections.
Observed behavior
The goal is to return a TRUE/FALSE value indicating overlap, or to calculate the exact numerical amount of the overlap.
Before you start

Ensure that your lower and upper bound values are placed in separate cells for both ranges, and that the lower bound is always less than the upper bound.

Solution 1Recommended

Use the AND Function to Check for Overlap

This is the most efficient and recommended way to return a TRUE or FALSE result when checking if two ranges overlap.

This formula checks if the start of the second range is less than or equal to the end of the first range, and if the end of the second range is greater than or equal to the start of the first range.

1
Organize your data

Place the lower and upper bounds of Range 1 in cells A2 and B2 respectively. Place the lower and upper bounds of Range 2 in cells C2 and D2.

2
Enter the formula

Select an empty cell where you want the result to appear and type the formula: =AND(C2<=B2,D2>=A2)

3
Evaluate the result

Press Enter. The cell will display TRUE if the ranges overlap or their endpoints touch, and FALSE if they are completely separate.

Use the AND Function to Check for Overlap
Handling touching endpoints: Using the <= and >= operators ensures that endpoints that exactly touch are counted as overlapping. If you only want strict overlaps, remove the equals signs: =AND(C2<B2,D2>A2).
Efficient Data Analysis

Easily Manage Formulas with WPS Spreadsheet

WPS Spreadsheet provides robust support for logical and mathematical functions like AND, MIN, and MAX, making it simple to calculate range overlaps and analyze complex data sets with zero hassle.

  1. 1. Open WPS Spreadsheet: Launch WPS Office and open your workbook containing the data ranges.
  2. 2. Organize your boundaries: Ensure your lower and upper bounds are cleanly separated into distinct columns.
  3. 3. Apply the formula: Type the overlap formula such as =AND(C2<=B2,D2>=A2) into your target cell.
  4. 4. Fill down the column: Click and drag the fill handle at the bottom-right of the cell to apply the formula across multiple rows effortlessly.
100% compatible with Microsoft Excel formulas and functionsBuilt-in function prompts and intuitive syntax hintsFree to use for everyday data analysis and reportingLightweight software with fast calculation speeds
microsoft office alternative - wps office

Frequently Asked Questions

What if the endpoints of my ranges are not in order?

If your lower and upper bounds might be swapped in the columns, you should normalize them within the calculation. You can wrap the cell references in MIN and MAX to guarantee the smaller number is always treated as the lower bound.

How can I return TRUE/FALSE using the overlap amount formula?

You can convert the overlap distance calculation into a logical test by checking if it is greater than zero. Use the formula: =MAX(0, MIN(D2,B2) - MAX(A2,C2)) > 0.

Can I use Conditional Formatting to highlight overlapping ranges?

Yes. Select your data range, go to Conditional Formatting > New Rule, choose 'Use a formula to determine which cells to format', and input the overlapping AND formula (e.g., =AND($C2<=$B2,$D2>=$A2)) to automatically color-code overlapping rows.