# GPT functions reference for Excel

Discover all custom functions in [GPT for Excel – Autosheet](https://autosheet.com/docs/gpt-for-excel), along with simple examples and an extensive list of parameters. If you're looking for more examples, download our [Autosheet examples template](https://drive.google.com/file/d/1JsiR_cAIbuBi-O53VmfNLsXlW0v8SXPS/view), and open it in Excel as a new workbook.

[Watch video on YouTube](https://www.youtube.com/watch?v=q_9YN1nPP_E)

> **Tip**
>
> To generate responses based on fresh web search data, use a model with web search capabilities (indicated by the 🌐 icon in the model switcher).

## GPT function

The simplest function included in GPT for Excel – Autosheet. Outputs the result in a single cell.

> **Info**
>
> To process images, use [GPT_VISION](https://autosheet.com/docs/gpt-for-excel/gpt-functions/reference#gpt_vision-function).

### How to use

| **Syntax**             | =GPT(prompt, \[value], \[temperature], \[model])                                 |
| ---------------------- | -------------------------------------------------------------------------------- |
| **Copy/paste example** | `=GPT("Write a tagline for an ice cream shop.")`                                 |
| **⚠️ Localization**    | In some locales, you might need to use ";" to separate parameters instead of "," |
| **Output**             | A response to your prompt in a single cell                                       |

### Parameters

| **Parameter**                     | **Definition**                                                                                                                                                                                                   |
| --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **prompt (cannot be empty)**      | Instruction provided to the AI to generate a result in a single cell.<br>The prompt parameter can be:<br>- A string: `"Write a tagline for an ice cream shop."`<br>- A cell: `A1`<br>- A range of cells: `A1:C3` |
| **(optional) value**              | Text, cell or range you want your prompt to apply to                                                                                                                                                             |
| **(optional) temperature, model** | See [temperature and model](https://autosheet.com/docs/gpt-for-excel/gpt-functions/reference#temperature-and-model).                                                                                             |

See more [usage examples](https://autosheet.com/docs/gpt-for-excel/gpt-functions/create-gpt-formulas/examples).

## GPT_CLASSIFY function

Classifies a piece of text into a single category selected from a predefined list of categories.

### How to use

| **Syntax**             | =GPT_CLASSIFY(value, categories, \[instructions], \[temperature], \[model])      |
| ---------------------- | -------------------------------------------------------------------------------- |
| **Copy/paste example** | `=GPT_CLASSIFY("banana", "fruit, vegetable")`                                    |
| **⚠️ Localization**    | In some locales, you might need to use ";" to separate parameters instead of "," |
| **Output**             | The best applicable category                                                     |

### Parameters

| **Parameter**                        | **Definition**                                                                                                                    |
| ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------- |
| **value (cannot be empty)**          | Input text to classify.<br>The value parameter can be:<br>- A string: `"banana"`<br>- A cell: `A1`<br>- A range of cells: `A1:C3` |
| **categories** **(cannot be empty)** | Comma-separated categories or range of categories to choose from. Only the most relevant category will be returned.               |
| **(optional)** **instructions**      | Additional instructions for the classification. Can include examples.                                                             |
| **(optional) temperature, model**    | See [temperature and model](https://autosheet.com/docs/gpt-for-excel/gpt-functions/reference#temperature-and-model).              |

See more [usage examples](https://autosheet.com/docs/gpt-for-excel/gpt-functions/create-gpt-formulas/examples).

## GPT_EDIT function

Applies the given task to the given text. The default task is to fix grammar and spelling.

### How to use

| **Syntax**             | =GPT_EDIT(text, \[task], \[temperature], \[model])                               |
| ---------------------- | -------------------------------------------------------------------------------- |
| **Copy/paste example** | `=GPT_EDIT("For sum reezon thoose nunsberz arnt addin up")`                      |
| **⚠️ Localization**    | In some locales, you might need to use ";" to separate parameters instead of "," |
| **Output**             | The edited text in a single cell                                                 |

### Parameters

| **Parameter**                     | **Definition**                                                                                                                                                                                                        |
| --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **text (cannot be empty)**        | Input text to edit.<br>The text parameter can be:<br>- A string: `"For sum reezon thoose nunsberz arnt addin up"`<br>- A cell: `A1`<br>- A range of cells: `A1:C3`                                                    |
| **(optional) task**               | Text, cell or range specifying how the text should be edited. Defaults to fixing grammar and spelling. Other examples:<br>- "Make it funnier"<br>- "Make it shorter"<br>- "Make it sound formal"<br>- "Add an ending" |
| **(optional) temperature, model** | See [temperature and model](https://autosheet.com/docs/gpt-for-excel/gpt-functions/reference#temperature-and-model).                                                                                                  |

See more [usage examples](https://autosheet.com/docs/gpt-for-excel/gpt-functions/create-gpt-formulas/examples).

## GPT_EXTRACT function

Extracts specific elements from text, such as names, dates, email addresses, URLs, or product attributes. Outputs as comma-separated values.

### How to use

| **Syntax**             | GPT_EXTRACT(text, to_extract, \[temperature], \[model])                                 |
| ---------------------- | --------------------------------------------------------------------------------------- |
| **Copy/paste example** | `=GPT_EXTRACT("I worked 5 years at Amazon.com and then 3 years at Apple", "companies")` |
| **⚠️ Localization**    | In some locales, you might need to use ";" to separate parameters instead of ","        |
| **Output**             | The extracted entities as comma-separated values in a single cell                       |

### Parameters

| **Parameter**                     | **Definition**                                                                                                                                                                              |
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **text (cannot be empty)**        | Input text to extract data from.<br>The text parameter can be:<br>- A string: `"I worked 5 years at Amazon.com and then 3 years at Apple"`<br>- A cell: `A1`<br>- A range of cells: `A1:C3` |
| **to_extract (cannot be empty)**  | Text, cell or horizontal range specifying what you want to extract.<br>Examples:<br>- "companies"<br>- B3:E3                                                                                |
| **(optional) temperature, model** | See [temperature and model](https://autosheet.com/docs/gpt-for-excel/gpt-functions/reference#temperature-and-model).                                                                        |

See more [usage examples](https://autosheet.com/docs/gpt-for-excel/gpt-functions/create-gpt-formulas/examples).

## GPT_FORMAT function

Formats dates, currencies, addresses, names, etc. Fixes capitalization. And so much more.

### How to use

| **Syntax**             | =GPT_FORMAT(input, target_format, \[source_format], \[temperature], \[model])              |
| ---------------------- | ------------------------------------------------------------------------------------------ |
| **Copy/paste example** | `=GPT_FORMAT("14 February 71", "iso")`                                                     |
| **⚠️ Localization**    | In some locales, you might need to use ";" to separate parameters instead of ","           |
| **Output**             | The converted input in a single cell unless it is converted a table, which outputs a table |

### Parameters

| Parameter                           | Definition                                                                                                                                                       |
| ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **input (cannot be empty)**         | Input text to format.<br>The input parameter can be:<br>- A string: `"14 February 1971"`<br>- A cell: `A1`<br>- A range of cells: `A1:C3`                        |
| **target_format (cannot be empty)** | Target format for the input. Examples: "iso", "currency iso", "international phone number", "lowercase/uppercase/camelcase/snake case/title case/sentence case"… |
| **(optional) source_format**        | Source format of the input. Optional, but including it can yield better results.                                                                                 |
| **(optional) temperature, model**   | See [temperature and model](https://autosheet.com/docs/gpt-for-excel/gpt-functions/reference#temperature-and-model).                                             |

See more [usage examples](https://autosheet.com/docs/gpt-for-excel/gpt-functions/create-gpt-formulas/examples).

## GPT_LIST / GPT_HLIST function

Like GPT, but outputs the results in a column. Very practical when the output is a list.

- Use GPT_LIST to return options listed vertically.
- Use GPT_HLIST to return options listed horizontally.

### How to use

| **Syntax**             | =GPT_LIST(prompt, \[value], \[temperature], \[model])                            |
| ---------------------- | -------------------------------------------------------------------------------- |
| **Copy/paste example** | `=GPT_LIST("Give me 5 good short ads about spreadsheets.")`                      |
| **⚠️ Localization**    | In some locales, you might need to use ";" to separate parameters instead of "," |
| **Output**             | As many responses to your prompt as you asked, one response per cell             |

### Parameters

| **Parameter**                     | **Definition**                                                                                                                                                                                      |
| --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **prompt (cannot be empty)**      | Instruction provided to the AI to generate a list.<br>The prompt parameter can be:<br>- A string: `"Give me 5 good short ads about spreadsheets."`<br>- A cell: `A1`<br>- A range of cells: `A1:C3` |
| **(optional) value**              | Text, cell or range you want your prompt to apply to                                                                                                                                                |
| **(optional) temperature, model** | See [temperature and model](https://autosheet.com/docs/gpt-for-excel/gpt-functions/reference#temperature-and-model).                                                                                |

See more [usage examples](https://autosheet.com/docs/gpt-for-excel/gpt-functions/create-gpt-formulas/examples).

## GPT_MATCH function

Matches the values of two columns by similarity.

> **Info**
>
> Regardless of the model you select in the model switcher, this function uses [text-embedding-ada-002](https://developers.openai.com/api/docs/models/text-embedding-ada-002), for a fixed cost of $0.25 per 1M tokens.

> **Warning**
>
> - GPT for Excel – Autosheet [settings](https://autosheet.com/docs/gpt-for-excel/gpt-functions/configure-behavior) do not apply to the GPT_MATCH function.
> - You can only match up to about 1,000 rows at a time.

### How to use

| **Syntax**             | =GPT_MATCH(search_keys, lookup_range, \[confidence], \[stats], \[top_k])         |
| ---------------------- | -------------------------------------------------------------------------------- |
| **Copy/paste example** | `=GPT_MATCH(A1:A10,B1:B4)`                                                       |
| **⚠️ Localization**    | In some locales, you might need to use ";" to separate parameters instead of "," |
| **Output**             | A column of the best matches to each value in the range                          |

### Parameters

| **Parameter**                      | **Definition**                                                                                                          |
| ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| **search_keys (cannot be empty)**  | The values that you want to look for in the range                                                                       |
| **lookup_range (cannot be empty)** | The range in which to look for values that are similar to search keys                                                   |
| **confidence (optional)**          | Set a similarity threshold: only values with a superior similarity score are matched. Must be comprised between 0 and 1 |
| **stats (optional)**               | "true" to display similarity scores                                                                                     |
| **top_k (optional)**               | Number of matching values to return per search_key (default: 1 - only the best match)                                   |

## GPT_SPLIT / GPT_HSPLIT function

Splits text semantically, such as by section, paragraph, sentence, customer…

- Use GPT_SPLIT to return outputs listed vertically.
- Use GPT_HSPLIT to return outputs listed horizontally.

### How to use

| **Syntax**             | =GPT_SPLIT(text, split_by, \[temperature], \[model])                             |
| ---------------------- | -------------------------------------------------------------------------------- |
| **Copy/paste example** | `=GPT_SPLIT("Hello! How are you? Have you heard of Autosheet?", "sentences")`    |
| **⚠️ Localization**    | In some locales, you might need to use ";" to separate parameters instead of "," |
| **Output**             | Input text is split as requested, one element per cell                           |

### Parameters

| **Parameter**                     | **Definition**                                                                                                                                                          |
| --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **text (cannot be empty)**        | Input text to split.<br>The text parameter can be:<br>- A string: `"Hello! How are you? Have you heard of Autosheet?"`<br>- A cell: `A1`<br>- A range of cells: `A1:C3` |
| **split_by (cannot be empty)**    | How to split the text. Examples:<br>- sections<br>- paragraphs<br>- sentences<br>- punctuation                                                                          |
| **(optional) temperature, model** | See [temperature and model](https://autosheet.com/docs/gpt-for-excel/gpt-functions/reference#temperature-and-model).                                                    |

## GPT_TABLE function

Like GPT, but outputs the results in a table. Very practical when the output is a table.

### How to use

| **Syntax**             | =GPT_TABLE(prompt, \[head], \[inputs], \[temperature], \[model])                 |
| ---------------------- | -------------------------------------------------------------------------------- |
| **Copy/paste example** | `=GPT_TABLE("top 10 most eaten fruits and their nutrition data")`                |
| **⚠️ Localization**    | In some locales, you might need to use ";" to separate parameters instead of "," |
| **Output**             | The response to your prompt in the shape of a table                              |

### Parameters

| Parameter                         | Definition                                                                                                                                                                             |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **prompt (cannot be empty)**      | Instruction to generate a table.<br>The prompt parameter can be:<br>- A string: `"top 10 most eaten fruits and their nutrition data"`<br>- A cell: `A1`<br>- A range of cells: `A1:C3` |
| **(optional) head**               | Range containing at least one row. the first row should be headers, the following rows can be used to specify examples If left empty, headers will be generated automatically.         |
| **(optional) inputs**             | Range containing partial rows to complete with GPT_TABLE                                                                                                                               |
| **(optional) temperature, model** | See [temperature and model](https://autosheet.com/docs/gpt-for-excel/gpt-functions/reference#temperature-and-model).                                                                   |

## GPT_TAG function

Applies user-defined tags to text or automatically suggests relevant tags if none are specified.

### How to use

| **Syntax**             | =GPT_TAG(value, \[tags], \[instructions], \[top_k], \[temperature], \[model])    |
| ---------------------- | -------------------------------------------------------------------------------- |
| **Copy/paste example** | `=GPT_TAG("I love chocolate", "food, positive, negative")`                       |
| **⚠️ Localization**    | In some locales, you might need to use ";" to separate parameters instead of "," |
| **Output**             | The applicable tags as csv in a single cell                                      |

### Parameters

| Parameter                         | Definition                                                                                                                             |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| **value (cannot be empty)**       | Input text to tag.<br>The value parameter can be:<br>- A string: `"I love chocolate"`<br>- A cell: `A1`<br>- A range of cells: `A1:C3` |
| **(optional) tags**               | Comma-separated tags or range of tags applicable. If left empty, GPT_TAG will automatically come up with the tags                      |
| **(optional) instructions**       | Additional instructions for the tag application. Can include examples.                                                                 |
| **(optional) top_k**              | Maximum number of tags to return                                                                                                       |
| **(optional) temperature, model** | See [temperature and model](https://autosheet.com/docs/gpt-for-excel/gpt-functions/reference#temperature-and-model).                   |

See more [usage examples](https://autosheet.com/docs/gpt-for-excel/gpt-functions/create-gpt-formulas/examples).

## GPT_TRANSLATE function

Translates text from one language to another. Works better if you specify the source language.

### How to use

| **Syntax**             | =GPT_TRANSLATE(text, \[target_language], \[source_language], \[instructions],\[temperature], \[model]) |
| ---------------------- | ------------------------------------------------------------------------------------------------------ |
| **Copy/paste example** | `=GPT_TRANSLATE("Cool off with our delicious treats!", "spanish")`                                     |
| **⚠️ Localization**    | In some locales, you might need to use ";" to separate parameters instead of ","                       |
| **Output**             | The requested translation in a single cell                                                             |

### Parameters

| **Parameter**                     | **Definition**                                                                                                                                                 |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **text (cannot be empty)**        | Input text to translate.<br>The text parameter can be:<br>- A string: `"Cool off with our delicious treats!"`<br>- A cell: `A1`<br>- A range of cells: `A1:C3` |
| **(optional) target_language**    | Language of the output. Examples: "spanish", "chinese", "french". Defaults to "english".                                                                       |
| **(optional) source_language**    | Language of the input. Example: "english"                                                                                                                      |
| **(optional) instructions**       | Additional instructions for the translation. Can include a dictionary of translations.                                                                         |
| **(optional) temperature, model** | See [temperature and model](https://autosheet.com/docs/gpt-for-excel/gpt-functions/reference#temperature-and-model).                                           |

See more [usage examples](https://autosheet.com/docs/gpt-for-excel/gpt-functions/create-gpt-formulas/examples).

## GPT_VISION function

Applies a prompt to an image. For example you can ask a question about the image, ask for a description of it, or generate alt text for images. [Learn more.](https://autosheet.com/blog/bulk-write-alt-text-chatgpt-excel-google-sheets)

> **Info**
>
> - GPT_VISION is the only function that accepts images as input.
> - If you want to use GPT_VISION, you must use a [vision model](https://autosheet.com/docs/gpt-for-excel/gpt-functions/use-images-in-prompts#supported-vision-models), like `gpt-5.4`.

### How to use

| **Syntax**             | =GPT_VISION(prompt, image_url, \[high_res], \[temperature], \[model])            |
| ---------------------- | -------------------------------------------------------------------------------- |
| **Copy/paste example** | `=GPT_VISION("Write a short description for this product", A1, , , "gpt-4.1")`   |
| **⚠️ Localization**    | In some locales, you might need to use ";" to separate parameters instead of "," |
| **Output**             | A response to your prompt according to the information extracted from the image  |

### Parameters

| **Parameter**                     | **Definition**                                                                                                                                                                                                                                                                                                                |
| --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **prompt (cannot be empty)**      | Instruction provided to the AI to analyze an image.<br>The prompt parameter can be:<br>- A string: `"Write a short description for this product"`<br>- A cell: `A1`<br>- A range of cells: `A1:C3`                                                                                                                            |
| **image_url**                     | Link to the image you want the AI to analyze. Supported formats are PNG, JPEG, WebP, and non-animated GIF.<br>The image_url parameter can be:<br>- A string: `"https://static.nike.com/a/images/t_PDP_1280_v1/f_auto,q_auto:eco/b5ab0a6c-6393-4af6-abbc-4f1acaa6ed94/air-max-dawn-womens-shoes-224mWf.png"`<br>- A cell: `A4` |
| **(optional) high_res**           | How the AI processes the image and generates its textual understanding. Possible values are `true`, `false`, and `auto` (default). [Learn more.](https://developers.openai.com/api/docs/guides/images-vision?api-mode=chat#specify-image-input-detail-level)                                                                  |
| **(optional) temperature, model** | See [temperature and model](https://autosheet.com/docs/gpt-for-excel/gpt-functions/reference#temperature-and-model).                                                                                                                                                                                                          |

See more [usage examples](https://autosheet.com/docs/gpt-for-excel/gpt-functions/create-gpt-formulas/examples).

## GPT_WEB function

> **Info**
>
> GPT_WEB uses the web search model set for your space. [Learn more.](https://autosheet.com/docs/admin/ai-configuration/manage-models#set-the-default-bulk-models)

### How to use

| **Syntax**             | =GPT_WEB(prompt, \[value])                                                       |
| ---------------------- | -------------------------------------------------------------------------------- |
| **Copy/paste example** | `=GPT_WEB("Who won the last presidential elections in Argentina?")`              |
| **⚠️ Localization**    | In some locales, you might need to use ";" to separate parameters instead of "," |
| **Output**             | A response to your prompt based on recent web search data                        |

### Parameters

| **Parameter**                | **Definition**                                                                                                                                                                                                                                                      |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **prompt (cannot be empty)** | Instructions provided to the AI to generate results based on recent web search data. Provide instructions in English for better results.<br>The prompt parameter can be:<br>- A string: `"Who won the last presidential elections in Argentina?"`<br>- A cell: `A1` |
| **(optional) value**         | Text, cell, or range you want your prompt to apply to                                                                                                                                                                                                               |

See [more usage examples](https://autosheet.com/docs/gpt-for-word/use/search-web).

## GPT_CREATE_PROMPT helper function

Like the native **CONCAT** function, but inserts spaces and newlines automatically. Helps you create a prompt from scattered, disjointed cells and ranges. You can then use that prompt in GPT functions. This function does not call any AI provider's API and thus does not incur any cost.

### How to use

| **Syntax**             | =GPT_CREATE_PROMPT(arg1, \[arg2], \[arg3], \[...argn])                           |
| ---------------------- | -------------------------------------------------------------------------------- |
| **Copy/paste example** | `=GPT_CREATE_PROMPT(A1:B1, A2, C3:D5, E1:E6)`                                    |
| **⚠️ Localization**    | In some locales, you might need to use ";" to separate parameters instead of "," |
| **Output**             | A prompt ready to use in GPT, GPT_LIST or GPT_TABLE                              |

### Parameters

| **Parameter**                  | **Definition**                                                |
| ------------------------------ | ------------------------------------------------------------- |
| **arg1 (cannot be empty)**     | Cell or range to concatenate. For example:<br>- A1<br>- A1:C3 |
| **(optional)** **arg2 - argn** | Cell or range to concatenate. For example:<br>- A2<br>- G2:H4 |

## temperature and model

These parameters are present in most GPT functions. They are always optional.

For example with the GPT function, you can set:

- **temperature** to `0.1`

- **model** to `"gpt-4o-mini"`

  ![These two parameters come last in the formula](https://autosheet.com/docs/article-images/gpt-for-sheets/reference-maxtokens-temperature-model.png)

You can also set these values from the sidebar under **Model settings**. In this case, they become the default values for all future executions.

| Parameter                  | Definition                                                                                                                                                                                                                                                                 |
| -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **(optional) temperature** | Number between 0 and 1 that governs the creativity of the output:<br>- **0** - Strictly according to the prompt<br>- **0.5** - Slightly creative<br>- **1** - Very creative<br>**Info**<br>In some locales, you might need to use "0,5" (comma) instead of "0.5" (period). |
| **(optional) model**       | Name of the model surrounded by quotes. You can find model names in the model switcher in the sidebar.                                                                                                                                                                     |
