convert_to_block
Convert an existing cell table into a named block with fields and row keys, enabling formula references by name instead of cell coordinates.
Instructions
Turn a table that already exists in ordinary cells into a block, in place, without touching its values.
This is how you adopt a workbook someone hands you. create_block is for new tables and refuses to write over existing data; this one takes the data as it stands and gives it a name, fields and row keys, so you can address it as (block, row_key, field) and reference it from formulas by name instead of by coordinate.
Give position and the counts for the DATA only, leaving out any header row, then either header_row to read the field names from the titles or fields to state them. The first field is the row-key column, so put the column that identifies each record first.
Converting is a one-time cost: the block and its schema survive saving and reloading, and afterwards the region behaves exactly like one created as a block.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Ref name for the new block — BLOCKREF's first argument. Must be unique. | |
| sheet | Yes | Sheet the table is on. | |
| fields | No | Field names, when there is no header row. Length must equal col_count. | |
| position | Yes | Top-left cell of the data, excluding the header row. | |
| col_count | Yes | Number of columns. | |
| row_count | Yes | Number of data rows. | |
| header_row | No | Row holding the column titles; field names are read from it. Usually one row above `position`. |