Skip to main content

grapher.infer_dynamic_offset_targets()

Infer the union of all possible OFFSET targets for a formula.

Usage

Source

grapher.infer_dynamic_offset_targets(
    formula,
    *,
    current_sheet,
    cell_type_env,
    limits=None,
    bounds=None,
    named_ranges=None,
    named_range_ranges=None,
    current_row=None,
    current_col=None,
    allow_wide_bounds=False,
    blank_rects=None
)

This helper is intentionally focused and conservative: - Only OFFSET calls are analysed (INDIRECT is currently ignored). - Arguments may use a small Excel expression subset supported by core.expr_eval.evaluate_expr. - Leaf cells referenced by OFFSET/INDEX arguments must have a numeric domain in cell_type_env unless they appear only in ref_only argument positions (see excel_grapher.core.excel_function_meta). - Integer interval domains must be finite and small enough to enumerate, unless allow_wide_bounds is True. In that case intervals wider than max_branches become a bounding rectangle of possible OFFSET results instead of raising DynamicRefError, so constraint-candidate scanning can still reach downstream leaves.

blank_rects applies only inside an exact-MATCH selector: an untyped lookup cell in those rectangles is numeric 0.