top of page

How to Use the Gemini =AI() Function in Google Sheets

  • May 21
  • 2 min read

With built-in Gemini capabilities in Google Sheets, you can now use the =AI() function to talk to your spreadsheet, to tell it what you want it to do, without knowing the exact formula.


An Easy Example of the =AI function in Google Sheets


It is a simple structure to remember. It begins with the =AI (


Followed by the instruction, in the example below, I have given it the simple task of addition.


=AI ("write the total"


Followed by the data set you would like Gemini to use

=AI ("write the total", H2:H28)


Don't forget to use the brackets (), the " and the comma,


Cell displaying "June Total" and formula =AI("write the total", H2:H28) highlighted in blue.

Once you hit enter, you will see the option to 'Generate and insert'.


Floating button labeled "Generate and insert" with options in a text box on a spreadsheet. Blue accent, white background.

Wait whilst it generates the answer to your request.


Spreadsheet cell with the text "June Total" and a progress message "Generating..." with a blue dotted circle loading icon.

And you should be given the answer you were looking for!


Spreadsheet showing "June Total" next to a highlighted cell with £11,935. Background is grid lines, creating an orderly appearance.

That is a basic example to show you how the =AI function in Google Sheets works and how to structure the prompt.


What Else Could You Do?


We like to use it to clean up messy spreadsheets, especially our training sign-up spreadsheets that some clients like to create themselves.


We end up with a lot of sheets with cells containing first and last names, when we need them separately, so we use Gemini to separate the names.


As shown below =AI is perfect for this. We have asked Gemini to "Extract just the last name from this cell", as we have already done the first names.


Spreadsheet showing names in column A, AI formula in cell C2 extracts first names to column B. Cell C2 contains a formula in blue.

Once we hit enter, it generates the first cell, and we can drag the formula down the rest of the column to complete our task.


Spreadsheet showing names split into columns: full names in column A, first names in B, last names in C. Formula shown at C2.

Other ways you could use it to clean your data:

  • To standardise phone numbers or locations, for example, NY, NYC or New York

  • Extract email addresses from cells (another one we use a lot in training sign-up)

  • Remove duplicates


To learn more about Google Sheets or Gemini book, CloudShed's live and interactive Google Sheets training sessions.








bottom of page