All available functions in GPT for Sheets
Discover all available functions in GPT for Sheets, along with simple examples and an extensive list of paramaters. If you are looking for usage examples, click here.
Prerequisites
GPT function
To process images, use GPT_VISION. To get up-to-date information based on recent web search data, use GPT_WEB.
How to use
Syntax | =GPT(prompt, [value], [temperature], [model]) |
---|---|
Copy/paste example |
|
⚠️ 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. The prompt parameter can be:
|
(optional) value | Text, cell or range you want your prompt to apply to |
(optional) temperature, model | temperature is a number between 0 and 1. Use it to control creativity. |
See more usage 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 |
|
⚠️ 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. The prompt parameter can be:
|
(optional) value | Text, cell or range you want your prompt to apply to |
(optional) temperature, model | temperature is a number between 0 and 1. Use it to control creativity. |
See more usage examples.
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 |
|
⚠️ 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. The text parameter can be:
|
split_by (cannot be empty) | How to split the text. Examples:
|
(optional) temperature, model | temperature is a number between 0 and 1. Use it to control creativity. |
See more usage examples.
GPT_FILL function
Magically fills or cleans a range from a few examples. For best results, use GPT_FILL with the gpt-4o model and add custom instructions to guide the AI.
How to use
Syntax | =GPT_FILL(examples, [inputs], [temperature], [model]) |
---|---|
Copy/paste example |
|
⚠️ Localization | In some locales, you might need to use ";" to separate parameters instead of "," |
Output | The empty part of the range will be filled based on the examples provided |
Parameters
Parameter | Definition |
---|---|
examples | Range containing complete examples that the AI should learn from |
(optional) inputs | Range containing incomplete data that the AI should complete from the examples |
(optional) temperature, model | temperature is a number between 0 and 1. Use it to control creativity. |
See more usage examples.
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 |
|
⚠️ 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. The prompt parameter can be:
|
(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 | temperature is a number between 0 and 1. Use it to control creativity. |
See more usage examples.
GPT_MATCH function
Matches the values of two columns by similarity.
Regardless of the model you choose, this function always uses text-embedding-ada-002. If you have access to text-embedding-ada-002 with your own API key, select it in the model switcher to reduce costs. Learn more about pricing.
How to use
Syntax | =GPT_MATCH(search_keys, lookup_range, [confidence], [stats], [top_k]) |
---|---|
Copy/paste example |
|
⚠️ 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) |
See more usage examples.
GPT_MAP and GPT_MATCH perform the same task. We removed GPT_MAP from the list of available functions, but it still executes if manually typed.
GPT_FORMAT function
Formats dates, currencies, addresses, names, etc. Fixes capitalization. And so much more.
GPT_CONVERT and GPT_FORMAT perform the same task. We removed GPT_CONVERT from the list of available functions, but it still executes if manually typed.
How to use
Syntax | =GPT_FORMAT(input, target_format, [source_format], [temperature], [model]) |
---|---|
Copy/paste example |
|
⚠️ 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. The input parameter can be:
|
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 | temperature is a number between 0 and 1. Use it to control creativity. |
See more usage 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 |
|
⚠️ 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. The text parameter can be:
|
(optional) task | Text, cell or range specifying how the text should be edited. Defaults to fixing grammar and spelling. Other examples:
|
(optional) temperature, model | temperature is a number between 0 and 1. Use it to control creativity. |
See more usage examples.
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], [examples], [top_k], [temperature], [model]) |
---|---|
Copy/paste example |
|
⚠️ 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. The value parameter can be:
|
(optional) tags | Comma-separated tags or range of tags applicable. If left empty, GPT_TAG will automatically come up with the tags |
(optional) top_k | Maximum number of tags to return |
(optional) examples | A table of examples in two columns. The first column should contain the inputs and the second column should contain the outputs. |
(optional) temperature, model | temperature is a number between 0 and 1. Use it to control creativity. |
See more usage examples.
GPT_CLASSIFY function
Classifies a given text into a single category.
How to use
Syntax | =GPT_CLASSIFY(value, categories, [examples], [temperature], [model]) |
---|---|
Copy/paste example |
|
⚠️ 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. The value parameter can be:
|
categories (cannot be empty) | Comma-separated categories or range of categories to choose from. Only the most relevant category will be returned. |
(optional) examples | A table of examples in two columns. The first column should contain the inputs and the second column should contain the outputs. |
(optional) temperature, model | temperature is a number between 0 and 1. Use it to control creativity. |
See more usage examples.
GPT_EXTRACT function
Extracts data (like email addresses or company names) from a text. Outputs as comma-separated values.
How to use
Syntax | =GPT_EXTRACT(text, to_extract, [temperature], [model]) |
---|---|
Copy/paste example |
|
⚠️ 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. The text parameter can be:
|
to_extract (cannot be empty) | Text, cell or horizontal range specifying what you want to extract. Examples:
|
(optional) temperature, model | temperature is a number between 0 and 1. Use it to control creativity. |
See more usage examples.
GPT_SUMMARIZE function
Summarizes text according to a given format (three sentences by default).
How to use
Syntax | =GPT_SUMMARIZE(text, [format], [temperature], [model]) |
---|---|
Copy/paste example |
|
⚠️ Localization | In some locales, you might need to use ";" to separate parameters instead of "," |
Output | A summary in the requested format in a single cell |
Parameters
Parameter | Definition |
---|---|
text (cannot be empty) | Input text to summarize. The text parameter can be:
|
(optional) format | Format of the summary. Examples:
|
(optional) temperature, model | temperature is a number between 0 and 1. Use it to control creativity. |
See more usage examples.
GPT_TRANSLATE function
Translates text from one language into 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 |
|
⚠️ 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. The text parameter can be:
|
(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 | temperature is a number between 0 and 1. Use it to control creativity. |
See more usage examples.
GPT_CREATE_PROMPT helper function
Like CONCATENATE, 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 doesn’t call any model provider's API and thus doesn’t incur any cost.
How to use
Syntax | =GPT_CREATE_PROMPT(arg1, [arg2], [arg3], [...argn]) |
---|---|
Copy/paste example |
|
⚠️ 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
|
(optional) arg2 - argn | Cell or range to concatenate
|
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.
- Regardless of the model you choose, this function always uses gpt-4o. If you have access to gpt-4o with your own API key, select it in the model switcher to reduce costs. Learn more about pricing.
- GPT_VISION is the only function that accepts images as input.
How to use
Syntax | =GPT_VISION(prompt, image_url, [high_res], [temperature]) |
---|---|
Copy/paste example |
|
⚠️ 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. The prompt parameter can be:
|
image_url | Link to the image you want the AI to analyze. Supported formats are PNG, JPEG, WebP, and non-animated GIF. Maximum size is 20MB per image. The image_url parameter can be:
|
(optional) high_res | How the AI processes the image and generates its textual understanding. Possible values are true , false , and auto (default). Learn more. |
(optional) temperature | Number between 0 and 1 that governs the creativity of GPT:
|
GPT_WEB function
Provides up-to-date information sourced from recent web search data. Use GPT_WEB when you need fresh and accurate answers to questions about companies, current events, facts, people, and more. The function is built on the Perplexity API.
- Regardless of the model you select, GPT_WEB always uses the Perplexity API model
llama-3.1-sonar-small-128k-online
. - GPT_WEB is the only function that generates responses based on recent web search data.
If you provide a URL in the prompt, the function attempts to generate a response based on search data from that specific web page.
Searching a specific page only works if:
- Perplexity's web crawler has already independently indexed the content of the page. The crawler does not index new pages on demand based on URLs you provide. In addition, the crawler respects robots.txt directives and does not index disallowed content.
- The URL points directly to the page without any redirects. To check if a URL results in redirects, use the Redirect Checker.
If a specific URL does not produce valid results, use web scraping to retrieve the information from the page.
- GPT_WEB is priced per 1000 executions instead of tokens. In this case, input and output size do not matter. The price of GPT_WEB is $15 or €15 per 1000 executions.
- It is recommended to use Safe mode with GPT_WEB to avoid most timeouts, prevent data loss and avoid extra costs during automatic Sheets refreshes.
- GPT for Sheets settings do not apply to the GPT_WEB function.
How to use
Syntax | =GPT_WEB(prompt, [value]) |
---|---|
Copy/paste example |
|
⚠️ 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. The prompt parameter can be:
|
(optional) value | Text, cell, or range you want your prompt to apply to |
temperature and model
These parameters are present in most GPT functions. They are always optional.
For example with the GPT function, you can set:
The temperature to
0.1
The model to
"gpt-3.5-turbo-0301"
You can also set these values from the sidebar very easily. 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 model:
|
(optional) model | Technical name of the model surrounded by quotes. The technical names are listed in the Model menu of the Settings section of the sidebar. Learn more about models. |