Skip to main content

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

ParameterDefinition
prompt (cannot be empty)

Instruction provided to the AI to generate a result in a single cell. The prompt parameter can be:

  • A string: "Write a tagline for a cafe."
  • A cell: A1
  • A range of cells: A1:C3
(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

ParameterDefinition
prompt (cannot be empty)

Instruction provided to the AI to generate a result in a single cell. The prompt parameter can be:

  • A string: "Top 5 Google product names.."
  • A cell: A1
  • A range of cells: A1:C3
(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

ParameterDefinition
text (cannot be empty)

Input text to split.
The text parameter can be:

  • A string: "Unlock the Power of Gemini: The Google Sheets Add-on that streamlines your workflows"
  • A cell: A1
  • A range of cells: A1:C3
split_by (cannot be empty)

How to split the text. Examples:

  • sections
  • paragraphs
  • sentences
  • punctuation
  • nouns
  • adjectives
(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

ParameterDefinition
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

ParameterDefinition
text (cannot be empty)

Input text to translate.
The text parameter can be:

  • A string: Happy New Year!
  • A cell: A1
  • 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

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

ParameterDefinition
text (cannot be empty)

Input text to summarize.
The text parameter can be:

  • A string: Some long content
  • A cell: A1
  • A range of cells: A1:C3
(optional) format

Format of the summary. Examples:

  • "key takeaways"
  • "action items"
  • "2 tweets"
  • "two paragraphs"
  • "100 words"
(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

ParameterDefinition
text (cannot be empty)

Input text to extract from.
The text parameter can be:

  • A string: The major AI players in the market are OpenAI, Google & Amazon
  • A cell: A1
  • A range of cells: A1:C3
to_extract (cannot be empty)

Text, cell or horizontal range specifying what you want to extract. Examples:

  • "companies"
  • C1:C4
(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-pro-vision 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

ParameterDefinition
prompt (cannot be empty)

Instruction provided to the AI to analyze an image.
The prompt parameter can be:

  • A string: Write a short description for this product
  • A cell: A1
  • A range of cells: A1:C3
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:

  • A string: https://lh3.googleusercontent.com/kIs4wRUAS_doZpi9cJE0Kn4vwR1yzcOHPzGX9ElAzCSLsNA52Es0Kb4oLUMFw-1intMQelINWuja6w=rw-lo
  • A cell: A2
(optional) temperature

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

ParameterDefinition
prompt (cannot be empty)

Instruction to generate a table.
The prompt parameter can be:

  • A string: top 10 most eaten fruits and their nutrition data value (cannot be empty)
(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

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

ParameterDefinition
prompt (cannot be empty)

Input text to classify.
The value parameter can be:

  • A string: banana
  • A cell: A1
  • A range of cells: A1:C3
(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

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

ParameterDefinition
value (cannot be empty)

Input text to tag.
The value parameter can be:

  • A string: I love chocolate
  • A cell: A1
  • A range of cells: A1:C3
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

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

ParameterDefinition
input (cannot be empty)

Input text to format.
The value parameter can be:

  • A string: "14 February 1971"
  • A cell: A1
  • 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

temperature is a number between 0 and 1. Use it to control creativity. Go to temperature and model to learn more.

GEMINI_EDIT

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

ParameterDefinition
text (cannot be empty)

Input text to edit.
The text parameter can be:

  • A string: For sum reezon thoose nunsberz arnt addin up
  • A cell: A1
  • A range of cells: A1:C3
task (optional)

Text, cell or range specifying how the text should be edited. Defaults to fixing grammar and spelling. Other examples:

  • "Make it funnier"
  • "Make it shorter"
  • "Make it sound formal"
  • "Add an ending"
(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

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

ParameterDefinition
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

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

ParameterDefinition
text (cannot be empty)

Input text to edit.
The text parameter can be:

  • A string: Your text here
  • A cell: A1
  • A range of cells: A1:C3
(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

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

ParameterDefinition
prompt (cannot be empty)

Input formula description.
The prompt parameter can be:

  • A string: I want to multiply the values in cells A2 and B2.
  • A cell: A1
  • A range of cells: A1:C3
(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

......

Temperature and Model

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-pro"

You can also set these values from the sidebar very easily. In this case, they become the default values for all future executions.

ParameterDefinition
(optional) temperature

Number between 0 and 1 that governs the creativity of the model:

  • 0 - strictly follow the prompt
  • 0.5 - slightly creative
  • 1 - very creative Note: In some locales, you might need to use "0,5" instead of "0.5"
(optional) 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.