# Array formulas

Spreadsheet can display formulas that return an array of values, which spans across multiple cells. This is useful if you want to display dynamic tabular data in the spreadsheet.

Below is a sample Array formula that fetches covid data

```
=IMPORTDATA("https://api.covidtracking.com/v1/us/daily.csv")
```

With the power of Structured references, you can convert this data to table, and start filtering/sorting on this data.

<figure><img src="/files/TqM5urjg0jbRySohniLT" alt=""><figcaption><p>Array formula to structured data</p></figcaption></figure>

## Collision detection

If an array formula tries to overwrite a non-empty cell, a `REF` error is thrown.

## Creating a custom Array formula

Returning a 2-D array from a custom formula function will mark a cell as an array function cell.

```typescript
const MY_FUNCTION = (parser: FormulaParser, arg: FunctionArgument) => {
  return [
    [
      "foo",
      "bar"
    ]
  ]
}
```


---

# 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.rowsncolumns.app/functions/array-formulas.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.
