apps-script-utils 2.1.1 Help

doGridRangesIntersect

function doGridRangesIntersect(gridRange1: GridRange, gridRange2: GridRange): boolean;

Ranges that merely touch along an edge do not intersect: the end bounds are exclusive, so A1:B2 and C1:D2 are neighbours, not overlaps. A bound left out means the range is open in that direction and so overlaps anything on that axis.

Parameters

Parameter

Type

Description

gridRange1

GridRange

The first GridRange object to check.

gridRange2

GridRange

The second GridRange object to check.

Returns

boolean — true when at least one cell belongs to both.

Examples

Checking an overlap

const left = { startRowIndex: 0, endRowIndex: 2, startColumnIndex: 0, endColumnIndex: 2 }; const right = { startRowIndex: 1, endRowIndex: 3, startColumnIndex: 1, endColumnIndex: 3 }; doGridRangesIntersect(left, right); // => true

See also

Source

src/appsscript/sheet/doGridRangesIntersect.ts

23 September 2026

This documentation was generated with AI (Claude) from the library's source code.