In this article:

ChatGPT in Google Sheets [2024 Update]

December 5, 2024

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 Lido.app

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:

=AskGPT(question)

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!

Get Google Sheets productivity and automation tips delivered straight to your inbox
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
We'll email you 1-3 times a week — and never share your information.

Work less, automate more!

Use Lido to connect your spreadsheets to email, Slack, calendars, and more to automate data transfers and eliminate manual copying and pasting. View all use cases ->