All available functions in Gemini for Sheets and Docs
Discover all available functions in Gemini for Sheets and Docs, along with simple examples and an extensive list of paramaters.
Prerequisites
You have opened a Google spreadsheet and selected Extensions > Gemini for Sheets™ and Docs™. To enable GEMINI functions, you must be the Creator of the spreadsheet.
GEMINI function
The simplest function to start using Gemini in Google Sheets. Outputs the result in a single cell.
How to use
Syntax | =GEMINI(prompt, [value], [temperature], [model]) |
---|---|
Copy/paste example | =GEMINI("Write a tagline for a cafe .") |
⚠️ 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. Go to temperature and model to learn more. |
GEMINI_LIST/GEMINI_HLIST function
GEMINI_List the responses in a column / The GEMINI_HLIST the responses in a horizontal list of items.
How to use
Syntax | =GEMINI_LIST(prompt, [value], [temperature], [model]) |
---|---|
Copy/paste example | =GEMINI_LIST("Top 5 Google product names.") |
⚠️ 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 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. Go to temperature and model to learn more. |
GEMINI_SPLIT/GEMINI_HSPLIT function
GEMINI_SPLIT text based on input / GEMINI_HSPLIT function is used to horizontally split data
How to use
Syntax | =GEMINI_SPLIT(text, split_by, [temperature], [model]) |
---|---|
Copy/paste example | =GEMINI_SPLIT("Unlock the Power of Gemini: The Google Sheets Add-on that streamlines your workflows", "nouns") |
⚠️ 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, model | temperature is a number between 0 and 1. Use it to control creativity. Go to temperature and model to learn more. |
GEMINI_HSPLIT: The GEMINI_HSPLIT function is used to horizontally split data
GEMINI_FILL function
Fills or cleans a range
How to use
Syntax | =GEMINI_FILL(examples, [inputs], [temperature], [model]) |
---|---|
Copy/paste example | =GEMINI_FILL(S4:U5,S6:S14) |
⚠️ 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. Go to temperature and model to learn more. |
GEMINI_TRANSLATE function
Translates text from one language into another. Works better if you specify the source language.
How to use
Syntax | =GEMINI_TRANSLATE(text, [target_language], [source_language], [instructions],[temperature], [model]) |
---|---|
Copy/paste example | =GEMINI_TRANSLATE("Happy New Year!", "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.
|
(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. Go to temperature and model to learn more. |
GEMINI_SUMMARIZE function
Summarizes text according to a given format.
How to use
Syntax | =GEMINI_SUMMARIZE(text, [format], [temperature], [model]) |
---|---|
Copy/paste example | =GEMINI_SUMMARIZE("some long content here") |
⚠️ 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.
|
(optional) format | Format of the summary. Examples:
|
(optional) temperature, model | temperature is a number between 0 and 1. Use it to control creativity. Go to temperature and model to learn more. |
GEMINI_EXTRACT function
Extracts data (like email addresses or company names) from a text. Outputs extracted values in a cell.
How to use
Syntax | =GEMINI_EXTRACT(text, to_extract, [temperature], [model]) |
---|---|
Copy/paste example | =GEMINI_EXTRACT("The major AI players in the market are OpenAI, Google & Amazon", "companies") |
⚠️ Localization | In some locales, you might need to use ";" to separate parameters instead of "," |
Output | The extracted entities as values in a single cell |
Parameters
Parameter | Definition |
---|---|
text (cannot be empty) | Input text to extract from.
|
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. Go to temperature and model to learn more. |
GEMINI_VISION function
Applies a prompt to an image. For example you can ask a question about the image, or ask for a description of it. This function requires access to the gemini-1.5-flash model.
How to use:
Syntax | =GEMINI_VISION(prompt, image_url, [temperature]) |
---|---|
Copy/paste example | =GEMINI_VISION("Write a short description for this product", A1) |
⚠️ 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.
|
image_url | Link to the image you want the AI to analyze. Supported formats are PNG, JPEG, WEBP, HEIC or HEIF.
The image_url parameter can be:
|
(optional) temperature | temperature is a number between 0 and 1. Use it to control creativity. Go to temperature and model to learn more. |
GEMINI_CODE function
GEMINI_CODE generate the output as a code for given prompt
How to use
Syntax | =GEMINI(prompt, [temperature], [model]) |
---|---|
Copy/paste example | =GEMINI_CODE("Print Hello World in Java.") |
⚠️ 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) temperature, model | temperature is a number between 0 and 1. Use it to control creativity. Go to temperature and model to learn more. |
GEMINI_TABLE function
Outputs the results in a table. Very practical when the output is a table.
How to use:
Syntax | =GEMINI_TABLE(prompt, [head], [inputs], [temperature], [model]) |
---|---|
Copy/paste example | =GEMINI_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 | A response to your prompt according to the information extracted from the image The best applicable category |
Parameters
Parameter | Definition |
---|---|
prompt (cannot be empty) | Instruction to generate a table.
|
(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 GEMINI_TABLE categories (cannot be empty) |
(optional) temperature | temperature is a number between 0 and 1. Use it to control creativity. Go to temperature and model to learn more. |
GEMINI_CLASSIFY function
Classifies a given text into a single category.
How to use:
Syntax | =GEMINI_CLASSIFY(value, categories, [temperature], [model]) |
---|---|
Copy/paste example | =GEMINI_CLASSIFY("banana", "fruit, vegetable") |
⚠️ 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 The best applicable category |
Parameters
Parameter | Definition |
---|---|
prompt (cannot be empty) | Input text to classify.
|
(optional) inputs | Comma-separated categories or range of categories to choose from. Only the most relevant category will be returned. |
(optional) temperature | temperature is a number between 0 and 1. Use it to control creativity. Go to temperature and model to learn more. |
GEMINI_TAG function
Applies user-defined tags to text or automatically suggests relevant tags if none are specified.
How to use:
Syntax | =GEMINI_TAG(value, [tags], [top_k], [temperature], [model]) |
---|---|
Copy/paste example | =GEMINI_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.
|
tags (optional) | Comma-separated tags or range of tags applicable. If left empty, GEMINI_TAG will automatically come up with the tags |
top_k (optional) | Maximum number of tags to return |
(optional) temperature | temperature is a number between 0 and 1. Use it to control creativity. Go to temperature and model to learn more. |
GEMINI_FORMAT function
Formats dates, currencies, addresses, names, etc. Fixes capitalization. And so much more.
NOTE : GEMINI_CONVERT and GPT_FORMAT perform the same task. We removed GEMINI_CONVERT from the list of available functions, but it still executes if manually typed.
How to use:
Syntax | =GEMINI_FORMAT(input, target_format, [source_format], [temperature], [model]) |
---|---|
Copy/paste example | = GEMINI_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.
|
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 | temperature is a number between 0 and 1. Use it to control creativity. Go to temperature and model to learn more. |
GEMINI_EDIT function
Applies the given task to the given text. The default task is to fix grammar and spelling.
How to use:
Syntax | =GEMINI_EDIT(text, [task], [temperature], [model]) |
---|---|
Copy/paste example | =GEMINI_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.
|
task (optional) | Text, cell or range specifying how the text should be edited. Defaults to fixing grammar and spelling. Other examples:
|
(optional) temperature | temperature is a number between 0 and 1. Use it to control creativity. Go to temperature and model to learn more. |
GEMINI_MATCH function
Matches the values of two columns by similarity.
How to use:
Syntax | =GEMINI_MATCH(search_keys, lookup_range, [confidence], [stats], [top_k]) |
---|---|
Copy/paste example | =GEMINI_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) |
GEMINI_SPAM function
Classify if the given text is spam or non-spam.
How to use:
Syntax | =GEMINI_SPAM(text,[temperature], [model]) |
---|---|
Copy/paste example | =GEMINI_SPAM("Your text here") |
⚠️ Localization | In some locales, you might need to use ";" to separate parameters instead of "," |
Output | Spam text in single cell |
Parameters
Parameter | Definition |
---|---|
text (cannot be empty) | Input text to edit.
|
(optional) temperature | temperature is a number between 0 and 1. Use it to control creativity. Go to temperature and model to learn more. |
GEMINI_FORMULA function
Description about your Google Sheet formulas
How to use:
Syntax | =GEMINI_FORMULA(prompt,[temperature], [model]) |
---|---|
Copy/paste example | =GEMINI_FORMULA("I want to multiply the values in cells A2 and B2") |
⚠️ Localization | In some locales, you might need to use ";" to separate parameters instead of "," |
Output | Google Sheet formulas |
Parameters
Parameter | Definition |
---|---|
prompt (cannot be empty) | Input formula description.
|
(optional) temperature | temperature is a number between 0 and 1. Use it to control creativity. Go to temperature and model to learn more. |
More functions coming soon
......
Advanced Parameter
These parameters are present in most GEMINI functions. They are always optional.
For example with the GEMINI function, you can set:
- the temprature to
0.1
- the model to
"gemini-1.5-flash"
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 |
---|---|
max output tokens | Maximum number of tokens that can be generated in the response. A token is approximately 4 characters. Specify a lower value for shorter responses and a higher value for potentially higher responses. |
temperature | The temperature controls the degree of randomness in token selection. Lower temperatures are good for prompts that require a less open-ended or creative response, while higher temperatures can lead to more creative responses. A temperature of 0 means that the highest probability tokens are always selected. If the model returns a response that's too generic, too short, or the model provides a fallback response, try increasing the temperature. Number between 0 and 1 that governs the creativity of the model:
Note: In some locales, you might need to use "0,5" instead of "0.5". |
model | Technical name of the model surrounded by quotes. The technical names are listed in the Model menu of the Default Settings section of the sidebar. |
top K | Top-K changes how the model selects tokens for output. A top-K of 1 means the next selected token is the most probable among all tokens in the model's vocabulary, while a top-K of 3 means that the next token is selected from among the three most probable tokens by using temperature. Specify a lower value for less random responses and a higher value for more random responses. |
top P | Top-P also changes how the model selects tokens for output. Tokens are selected from the most to least probable until the sum of their probabilities equals the top-P value. For example, if tokens A, B, and C have a probability of 0.3, 0.2, and 0.1 respectively, and the top-P value is 0.5, then the model will select either A or B as the next token by using temperature, excluding C as a candidate. Specify a lower value for less random responses and a higher value for more random responses. |