All GPT functions in GPT for Sheets
Discover all custom functions in GPT for Sheets, along with simple examples and an extensive list of parameters. If you are looking for more examples, make a copy of our GPT for Sheets examples template.
To generate responses based on fresh web search data, use a model with web search capabilities (indicated by the 🌐 icon in the model switcher).
Prerequisites
To enable GPT functions, you must be the Owner/Creator of the spreadsheet. Learn more.
GPT function
The simplest function included in GPT for Google Sheets. Outputs the result in a single cell.
To process images, use GPT_VISION.
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 |
See more usage 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, [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 |
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 |
See more usage 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 |
|
⚠️ 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 |
See more usage 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 |
|
⚠️ 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" |