GPT for Sheets reference
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.
GPT function
The simplest function to start using GPT in Sheets. Outputs the result in a single cell.
How to use
Syntax | =GPT(prompt, [value], [temperature], [max_tokens], [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) | Text, cell or range containing the prompt. Examples:
|
(optional) value | Text, cell or range you want your prompt to apply to |
(optional) temperature, max_tokens, model | temperature is a number between 0 and 1. Use it to control creativity. max_tokens is a number between 0 and model limit. Decrease if your request times out. Increase if your response is cut. Go to temperature, max_tokens and model to learn more. |
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], [max_tokens], [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) | Text, cell or range containing the prompt. Examples:
|
(optional) value | Text, cell or range you want your prompt to apply to |
(optional) temperature, max_tokens, model | temperature is a number between 0 and 1. Use it to control creativity. max_tokens is a number between 0 and model limit. Decrease if your request times out. Increase if your response is cut. Go to temperature, max_tokens and model to learn more. |
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], [max_tokens], [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 |
split_by (cannot be empty) | How to split the text. Examples:
|
(optional) temperature, max_tokens, model | temperature is a number between 0 and 1. Use it to control creativity. max_tokens is a number between 0 and model limit. Decrease if your request times out. Increase if your response is cut. Go to temperature, max_tokens and model to learn more. |
GPT_FILL function
Magically fill or clean a range from a few examples.
How to use
Syntax | =GPT_FILL(examples, [inputs], [temperature], [max_tokens], [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 GPT should learn from |
(optional) inputs | Range containing incomplete data that GPT should complete from the examples |
(optional) temperature, max_tokens, model | temperature is a number between 0 and 1. Use it to control creativity. max_tokens is a number between 0 and model limit. Decrease if your request times out. Increase if your response is cut. Go to temperature, max_tokens and model to learn more. |
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], [max_tokens], [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) | Text, cell or range containing the prompt. Examples:
|
(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, max_tokens, model | temperature is a number between 0 and 1. Use it to control creativity. max_tokens is a number between 0 and model limit. Decrease if your request times out. Increase if your response is cut. Go to temperature, max_tokens and model to learn more. |
GPT_MAP function
Map the values of two columns by similarity.
How to use
Syntax | =GPT_MAP(search_keys, 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 |
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 mapped. 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) |
(optional) temperature, max_tokens, model | temperature is a number between 0 and 1. Use it to control creativity. max_tokens is a number between 0 and model limit. Decrease if your request times out. Increase if your response is cut. Go to temperature, max_tokens and model to learn more. |
GPT_FORMAT function
Format dates, currencies, addresses, names, etc. Fix capitalization. And so much more.
How to use
Syntax | =GPT_FORMAT(input, target_format, [source_format], [temperature], [max_tokens], [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) | Text, cell or range containing the input to be converted. Examples:
|
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, max_tokens, model | temperature is a number between 0 and 1. Use it to control creativity. max_tokens is a number between 0 and model limit. Decrease if your request times out. Increase if your response is cut. Go to temperature, max_tokens and model to learn more. |
GPT_EDIT function
Applies the given task to the given text. The default ask is to fix grammar and spelling.
How to use
Syntax | =GPT_EDIT(text, [task], [temperature], [max_tokens], [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) | Text, cell or range to be edited. Examples:
|
(optional) task | Text, cell or range specifying how the text should be edited. Defaults to fixing grammar and spelling. Other examples:
|
(optional) temperature, max_tokens, model | temperature is a number between 0 and 1. Use it to control creativity. max_tokens is a number between 0 and model limit. Decrease if your request times out. Increase if your response is cut. Go to temperature, max_tokens and model to learn more. |
GPT_TAG function
Applies user-defined tags to a given text.
How to use
Syntax | =GPT_TAG(text,[tags], [top_k], [examples], [temperature], [max_tokens], [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 |
---|---|
text (cannot be empty) | Text, cell or range. Examples:
|
(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, max_tokens, model | temperature is a number between 0 and 1. Use it to control creativity. max_tokens is a number between 0 and model limit. Decrease if your request times out. Increase if your response is cut. Go to temperature, max_tokens and model to learn more. |
GPT_CLASSIFY function
Classifies a given text into a single category.
This function can use the text-embedding-ada-002 model for stricter application of categories and cheaper cost.
How to use
Syntax | =GPT_CLASSIFY(text, categories, [examples], [temperature], [max_tokens], [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 |
---|---|
text (cannot be empty) | Text, cell or range. Examples:
|
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, max_tokens, model | temperature is a number between 0 and 1. Use it to control creativity. max_tokens is a number between 0 and model limit. Decrease if your request times out. Increase if your response is cut. Go to temperature, max_tokens and model to learn more. |
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], [max_tokens], [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) | Text, cell or range to extract data from. Examples:
|
to_extract (cannot be empty) | Text, cell or horizontal range specifying what you want to extract. Examples:
|
(optional) temperature, max_tokens, model | temperature is a number between 0 and 1. Use it to control creativity. max_tokens is a number between 0 and model limit. Decrease if your request times out. Increase if your response is cut. Go to temperature, max_tokens and model to learn more. |
GPT_SUMMARIZE function
Summarizes text according to a given format (three sentences by default).
How to use
Syntax | =GPT_SUMMARIZE(text, [format], [temperature], [max_tokens], [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) | Text, cell or range to summarize. Examples:
|
(optional) format | Format of the summary. Examples:
|
(optional) temperature, max_tokens, model | temperature is a number between 0 and 1. Use it to control creativity. max_tokens is a number between 0 and model limit. Decrease if your request times out. Increase if your response is cut. Go to temperature, max_tokens and model to learn more. |
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], [maxTokens], [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) | Text, cell or range to translate. Examples:
|
target_language (cannot be empty) | Language of the output. Examples: "spanish", "chinese", "french" |
(optional) source_language | Language of the input. Example: "english" |
(optional) instructions | Additional instructions for the translation. Can include a dictionary of translations. |
(optional) temperature, max_tokens, model | temperature is a number between 0 and 1. Use it to control creativity. max_tokens is a number between 0 and model limit. Decrease if your request times out. Increase if your response is cut. Go to temperature, max_tokens and model to learn more. |
GPT_CONVERT function
Converts from one format to another. For instance json to table, or xml to json.
How to use
Syntax | =GPT_CONVERT(input, target_format, [source_format], [temperature], [max_tokens], [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) | Text, cell or range containing the input to be converted. Examples:
|
target_format (cannot be empty) | Target format for the input. Examples: "json", "html", "markdown", "json-ld", "table", "csv" |
(optional) source_format | Source format of the input. Optional, but including it can yield better results. Examples: "json", "html", "markdown", "json-ld", "table", "csv" |
(optional) temperature, max_tokens, model | temperature is a number between 0 and 1. Use it to control creativity. max_tokens is a number between 0 and model limit. Decrease if your request times out. Increase if your response is cut. Go to temperature, max_tokens and model to learn more. |
GPT_CODE function
Generates code to accomplish the given task. Output is a function.
How to use
Syntax | =GPT_CODE(task, [language], [temperature], [max_tokens], [model]) |
---|---|
Copy/paste example |
|
⚠️ Localization | In some locales, you might need to use ";" to separate parameters instead of "," |
Output | Code that implements task in a single cell |
Parameters
Parameter | Definition |
---|---|
task (cannot be empty) | Text, cell or range specifying what the generated code should do. Examples:
|
(optional) language | Programming language the code needs to be written in. |
(optional) temperature, max_tokens, model | temperature is a number between 0 and 1. Use it to control creativity. max_tokens is a number between 0 and model limit. Decrease if your request times out. Increase if your response is cut. Go to temperature, max_tokens and model to learn more. |
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 GPT 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
|
temperature, max_tokens and model
These parameters are the same for all GPT functions. They are always optional.
Parameter | Definition |
---|---|
(optional) temperature | Number between 0 and 1 that governs the creativity of GPT:
|
(optional) max_tokens | The maximum response size in tokens. Must be a round number greater than 0 and lower than the model limit.
|
(optional) model | All text OpenAI base and fine-tuned models are available by their name. The most popular base models are the following:
|