> For the complete documentation index, see [llms.txt](https://docs.rowsncolumns.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rowsncolumns.app/functions/array-formulas.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.
