REFERENCE
U.REGION
Summary
Discovers a region of cells in Excel that is entirely surrounded by blank cells, errors and/or the boundary of the worksheet
Syntax
=U.REGION(anchor_range, [max_columns], [max_rows], [as_range_ref], [keep_empty_strings], [keep_error_vectors], [look_up], [look_left])
Parameters
| Parameter | Required | Description |
|---|---|---|
anchor_range |
Yes | The range around which the resulting region will be detected. At least this specified range_ref is always returned in result even if not technically a region itself |
[max_columns] |
No | The max width of the region that will be discovered; set to TRUE to include furthermost column with any value. By default is set to the width of the anchor range. A hard max of 8000 columns is enforced except when TRUE. If set to a range that includes the anchor_range, it will act as a trigger parameter and it width will be the max_columns |
[max_rows] |
No | The max height of the region that will be discovered; set to TRUE to include furthermost row with any value. By default the max is set to the enforced hard max of 1 million except when TRUE |
[as_range_ref] |
No | If set to TRUE then a reference to the detected region is returned. By default the values of the detected region are returned |
[keep_empty_strings] |
No | If set to TRUE then empty strings will be treated as not-empty values and therefore a vector of empty strings will not act as a region boundary. By default cells containing empty strings are treated as empty cells |
[keep_error_vectors] |
No | If set to TRUE then errors will be treated as not-empty values and therefore a vector of errors will not act as a region boundary. By default cells containing errors are treated as empty cells |
[look_up] |
No | If set to TRUE then the returned region may contain cells above the anchor. By default the anchor range acts is the topleft of the returned region |
[look_left] |
No | If set to TRUE then the returned region may contain cells above the anchor. By default the anchor range acts is the topleft of the returned region |
Behavior
The documented public interface is supported by the current U Add-in source signature and the maintained Usage Examples workbook. Optional parameters are shown in square brackets in the syntax above; omit the brackets when entering a formula.
Return Value
Returns the function result or action status described by the formula and parameters above. The maintained sources do not define a narrower, stable return contract for this function.
Examples
Notes
- Formula examples are preserved from maintained workbook usage and normalized to the current
U.prefix. - Complete formulas demonstrate working patterns; they do not imply that undocumented option values are supported.
- Where maintained sources do not specify every accepted value, default, or error message, this page does not infer one.
- For functions that perform actions, use a visible trigger or supported block/throttle parameter to avoid unintended repetition during recalculation.
Related
- Concept: Grids, Tables, and Array Shaping
- Concept: Dynamic Ranges and Spill Results
- How-to: Build a Pivot-Style Grid
- Example: Live Pivot-Style Grid