# Arrays

An array can be written using `{}`, with `,` between values within a row and `;` between rows. For example, `{1, 2, 3; 4, 5, 6}` is an array with two rows and three columns:

| 1 | 2 | 3 |
| - | - | - |
| 4 | 5 | 6 |

Arrays cannot be empty and every row must be the same length.

Numeric ranges (such as `1..10`) and cell ranges (such as `A1:A10`) also produce arrays. All operators and most functions can operate on arrays, following these rules:

1. Operators always operate element-wise. For example, `{1, 2, 3} + {10, 20, 30}` produces `{11, 22, 33}`.
2. Functions that take a fixed number of values operate element-wise. For example, `NOT({TRUE, TRUE, FALSE})` produces `{FALSE, FALSE, TRUE}`.
3. Functions that can take any number of values expand the array into individual values. For example, `SUM({1, 2, 3})` is the same as `SUM(1, 2, 3)`.

When arrays are used element-wise, they must be the same size. For example, `{1, 2} + {10, 20, 30}` produces an error.

When an array is used element-wise with a single value, the value is expanded into an array of the same size. For example, `{1, 2, 3} + 10` produces `{11, 12, 13}`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.quadratichq.com/formulas/arrays.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
