In this article:

ChatGPT in Google Sheets [2024 Update]

How to Use ChatGPT in Google Sheets

1. Get API Key From ChatGPT

First, you need to get the API Key from ChatGPT. Make sure you have a paid account and added credits to it before you do this step. 

Hover your cursor to the left side of the browser. A list of options will appear. Click API keys.

Chatgpt get api for google sheets

Your secret API keys will be listed in the page. If it is your first time generating an API key in ChatGPT, you should get the You currently do not have any API keys message in the page. 

Chatgpt api keys screen

To generate an API key, click Create new secret key. You can give it a nickname, but it is optional. Click Create secret key afterwards.

Chatgpt generate new api‍

You may be asked to verify the action as not automated. Complete the puzzle.

Verify you are human to generate chatgpt api key‍

Once done, the secret key will be displayed to you. Copy it and store it somewhere safe. Once you got a copy of the key, click Done

Copy chatgpt api key

2. Copy the Google Sheets Template with ChatGPT Function by

We prepared a Google Sheets template with ChatGPT function added to it. 

Click here to copy it.

After clicking it, you will be asked if you want to copy the template. Click Make a copy. 

chat gpt google sheets‍

You will get a copy of the template with two sheets:

gpt for sheets

The two sheets are named Instructions and Sheet1

3. Insert the API Key to the Sheet

The first sheet named Instructions includes the cell B8 to be used for storing the API key for accessing ChatGPT. Paste the copy of the API key to that cell.

chat gpt for google sheets

4. Use =AskGPT() Formula

The ChatGPT function in the sheet is called AskGPT. The syntax of the formul ais straightforward:


The question may be typed inside the formula enclosed in double quotes or is stored in another cell, which is referenced inside the function. 

For our example, we store the question in A1, and reference it in the formula:

google sheets chat gpt

Press Enter. It takes a few seconds to load the answer. Enjoy!

Automate repetitive tasks with Lido

Save hours on repetitive and tedious work. Lido is a new spreadsheet that connects your spreadsheets, forms, PDFs, and email inbox.

Select trigger
When a cell value in Google Sheets changes
Check Google Sheets for today's date
When a new row is added to Google Sheets
On new Google Form submission
Send me a daily reminder
On new Typeform submission
When a cell value in database changes
Check database for today's date
When a new row is added in database
When a new HubSpot customer is created
Select action
Creates a one- or multiple-day calendar event with optional attendees
Adds an object to Hubspot
Create a Slack channel, and optionally add a topic or members
Makes any HTTP request
Replaces [@column_name] values in a Google Doc with the corresponding table row's values
Replaces [@column_name] values in a Google Doc with the corresponding table row's values, then export it as a PDF
Makes any HTTP request and returns the response
Inserts given array below defined values in given worksheet
Sends an email using your Google account
Sends an email using your Microsoft Outlook account
Sends a Slack message
Sends an SMS message using your Twilio account
Updates cells with given values
Updates a property of a Hubspot object
Trigger is required
Action is required
Get started