Table of contents:
- Goal: Use the power of GPT directly within Google Sheets
- Step 1: Create OpenAI account
- Step 2: Configure OpenAI account
- Step 3: Create your API key
- Step 4: Download GPT for Sheets
- Step 5: Activate API key
- Done
Goal: Use the power of GPT directly within Google Sheets
To do so, I’ll be using the Google Sheets extension GPT for Sheets™ and Docs™. Which will let you do cool things like this:
The add-on can help tremendously with tasks like:
- extracting enhanced data
- cleaning up and validating data
- generating text templates
- summarizing text
- classifying data with sentiment analysis
and much more.
It enables you to use GPT-3’s power by connecting to the OpenAI API, and using a couple of simple functions:
Here’s how I set up GPT for Google Sheets from scratch.
Step 1: Create OpenAI account
If you don’t already have an account, head over to openai.com/api/ and create one.
Step 2: Configure OpenAI account
Once you’ve successfully registered and logged in, you should be looking at some page of the OpenAI platform.
Now, click on your account image in the upper-right corner and navigate to “Manage account” → “Billing”.
The Google Sheets add-on works by connecting with OpenAI’s API. It does that, by using your personal API key (see Step 3). Unfortunately, using your key to make API calls (= using ChatGPT in Google Sheets) is currently not free of cost. That’s why you will need to change your OpenAI account from a “free trial” to a “paid account”.
So, in the “Billing Overview”
- click on “Set up paid account”
- and set up your payment method.
That’s it. You’re now on a “paid account” and can use the API.
If you’re anxious about spending too much money on the GPT x Google Sheets magic, you can head over to “Usage limits” and set up a spending limit. Once that is reached, further requests will be denied. By default, the hard limit is set to $120.
Step 3: Create your API key
- Head over to API Keys
- Click on “Create new secret key”
- In the pop-up, copy your freshly generated API key
Step 4: Download GPT for Sheets
- Head over to page of GPT for Sheets™ and Docs™ in the Google Workspace Marketplace
- Click “Install”
- Give permission for the add-on with the Google account you want to install it for
- Go through the steps shown to you
Step 5: Activate API key
Once the add-on is installed, you need to set up your API key within the add-on’s settings.
- Open Google Sheets
- Click on “Extensions” → “GPT for Sheets™ and Docs™” → “Set API key”
- Paste in the API key you copied earlier and click “Save API key”
- You should now be able to use the GPT formulas. Try it by typing =GPT("Hello world") in a cell.
The easiest way to work around this, is to simply open a new Chrome Incognito tab (Cmd ⌘ + Shift + N (Mac) / Ctrl + Shift + N (Windows)) and set up the API key there. By default, you won’t be logged into any accounts in Incognito mode, so just log in to the Google account you installed the add-on for, and go to Google Sheets again to set up your API key. For more troubleshooting, see the add-on’s creators’ Errors overview.
Done
For more use cases of this add-on, check out the creators’ website.
Also, feel free to let me know of any cool ways you’re using this!
← Blog
Resources: