Skip to main content

Named Ranges

Named ranges are a feature of spreadsheets that allow a cell or a range of cells to be named so they can be easily referenced. Named ranges is one of the ways Sheetloom hooks into a template and knows where to place data. In order to know this, the range name must match the Pattern and Stitch name it references in Sheetloom, and be structured according to the dot notation detailed in the following section.

Dot Notation

Sheetloom uses a dot notation to reference Stitches within their Patterns, similar to the schema.table style found in most SQL queries. When placing a Stitch reference anywhere in a sheet, it must be specified it as pattern.stitch.

Creating a Named Range

Microsoft Excel

In Microsoft Excel this can be done one of two ways:

  • In the ribbon bar, click on Formulas then click on Name Manager. From here, click on New... to add a new named range to the sheet.
  • Highlight the cell or cells to name. Click in the dialogue box located to the left of the formula bar, type the name for the range and press enter.
tip

Sheetloom does not need the named range to match the size of the result set. The upper-left most cell of the named range is where results are placed, and will fill as many rows and columns as required. Because of this, it is useful to know in advance how wide/long the data output will be, especially if multiple Stitches are being blended into the same sheet.

tip

Named Range replacement works slightly differently to tab replacement. Named Range replacement will preserve any formatting in the cells it replaces, but is slower to generate than a tab replacement.

Example

In this example a named range has been defined in the top corner of this sheet, corresponding with the Pattern cool_cargo_pattern and the Stitch office_list from Sheetloom.

empty named range

In a database tool such as DBeaver, the office_list query is crafted and copied into the Data Stitch in the Pattern Manager.

example query

When Sheetloom runs it maps the named range in the template to the corresponding Data Stitch, executes the Stitch´s SQL query, and injects the query results into a new spreadsheet.

The new spreadsheet, populated with the data from the SQL query.

filled named range