How to use Chat GPT in Google Sheets

How to use Chat GPT in Google Sheets

The recent hype about Chat GPT bears the question of how to use it in Google Sheets.

While Google is preparing its own AI to be integrated into Google Sheets, numerous plugins exist for Chat GPT and Open AI.

I found a great free plugin called Chat GPT for Sheets and Docs that lets you use Chat GPT in Google Sheets.

How to Use Chat GPT in Google Sheets

To use Chat GPT in Sheets, do the following:

  1. Sign up at Openai.com
  2. Get an Open AI API key. Your Open AI key will start with sk-
  3. Go to Google Sheets
  4. Click on “Extensions,” “Add-ons,” “Get add-ons”
  5. Search for “Chat GPT for Sheets and Docs”
  6. Click on the button “Individual install”
  7. Now find the extension under “Extension,” “GPT for Sheets and Docs”
  8. Enter your API Key that you generated on the OpenAI website
  9. Click on SET API Key
  10. Save the API Key
  11. Click on “Enable GPT Functions”
  12. Type =GPT(“hello”) into any cell
  13. When you see “loading..” it is waiting for an Chat GPT response
  14. The response will be something along the way of “Hello! How can I assist you today?” meaning that you can now use Chat GPT in Google Sheets
How To Use Chat GPT In Google Sheets
How To Use Chat GPT In Google Sheets

Chat GPT with Google Sheets Video Tutorial

Use the OpenAI API as an AI Writer in Sheets Video

Chat GPT for Sheets and Docs Free Plugin Step By Step

In this section, I will guide you through every step to integrate Chat GPT into Google Sheets using the free plugin Chat GPT for Sheets and Docs.

1. Sign up at Openai.com

Sign up to OpenAI API
Sign up to OpenAI API

The first thing to be done is to get an API key. The API key is needed to send a request to the Openai API and receive an answer.

You will have to set up billing for it as each call to the API costs. The good news is that it is incredibly cheap.

The plugin uses the model gpt-3.5-turbo as a default. GPT-3.5-turbo costs $0.002 per 1,000 tokens. A token is an equivalent of a word.

So if you set the request to max_tokens=1000 and Chat GPT to create an article of 1000 words as an example, it would cost you $0.002. for an API reply of 1000 words.

But not always will the answer exactly match the max tokens. You can set the token to 4000 max. So an API call will cost you $0.008 at most.

2. Get an Open AI API key

Create an API key on the OpenAI website
Create an API key on the OpenAI website

To get an API key, you need to signup for the OpenAI API. Once you sign up, go to “Personal” and “View API Keys” in the dropdown.

Create a key and copy it using the green Copy button.

This is your personal API key that you will need to bring with you to use the Chat GPT plugin.

Store the key somewhere safe, and never share it anywhere online. Otherwise, others can generate API requests at your expense.

3. Go into Google Sheets

Click on Extensions. Add-ons and then Get add-ons
Click on Extensions. Add-ons and then Get add-ons

Now you will install an add-on to Google Sheets. Add-ons add additional functions to Sheets and are created by third parties. There are many add-ons for Chat GPT and Open AI.

The one add-on I found that works great and is free is called Chat GPT for Sheets and Docs.

4. Click on “Extensions,” “Add-ons,” “Get add-ons”

In this step, we will install the add-on. For this, go to “Extensions” in Google Sheets. Click on “Add-ons” and then click on “Get add-ons.”

5. Search for “Chat GPT for Sheets and Docs”

Type in Chat GPT for Sheets and Docs
Type in Chat GPT for Sheets and Docs

In the search bar, type “Chat GPT for Sheets and Docs.”

You will then see the add-on.

6. Click on the button “Individual install”

Click on install (individual install)
Click on install (individual install)

By clicking on it, you can select “Install” or “Individual install.” You can also install add-ons for the whole organization if you are a Workspace admin.

7. Find the extension under “Extension,” “GPT for Sheets and Docs”

Now that you have installed the extension, you should be able to find it under Extension in Sheets.

8. Enter the API Key that you generated on the OpenAI website

Add your API key. Check it and then click on Save API key
Add your API key. Check it and then click on Save API key

Now you will need your API Key starting with sk-. Enter it to where it says “Set API Key.”

9. Click on SET API Key

By clicking on SET API key, you set it to your key.

10. Save the API Key

Now click on save. All the requests to the API will now use your key. You will be charged a small sum for each request.

11. Click on “Enable GPT Functions”

Enable Chat GPT
Enable Chat GPT

This is an important step and is forgotten easily. The app requires you to enable the GPT functions, or the function prompts, such as =GPT() will not work. Enable it by clicking on “Enable GPT Functions.”

12. Type =GPT(“hello”) into any cell

Go to a cell where you want to add the formula
Go to a cell where you want to add the formula

This is where the fun begins. Now you can use the prompt =GPT() as you would use other functions within Sheets.

You can use the prompt like that or add additional parameters.

The allowed parameters are the following:

[prompt] = This is the prompt for Chat GPT. You could say “Write a blogpost”

[value] = The value can reference a different cell. You could write “Dachshund diet.” Now the request to Chat GPT would be to write a blog post about the Dachshund diet.

[temperature] = Temperature defines how much repetition is allowed and how creative the answer should be. At 0 you will have many repetitions, and 1 would be as creative as possible. Setting it between 0.7-1 will give you the best results.

[max_tokens] = this is a value between 0-4000. It indicates the maximum tokens or words you will get as an answer.

[model] = Model defines which Chat GPT or OpenAI API model is used. The default is GPT-3.5-turbo, a fast and cheap model. It is a great choice. Other options are GPT-4, Davinci, Curie, Babbage, and Ada.

Try the prompt =GPT(“hello”) into any cell to see if the add-on works correctly.

13. “loading..” it is waiting for a Chat GPT response

Once the API call is made you see Loading... as you are waiting for a response
Once the API call is made, you see Loading… as you are waiting for a response

Once you hit enter after writing the prompt, you will see “loading.” This is a good sign as it indicates that your request has been made to the API and that the add-on is waiting for an answer.

14. Get your first Chat GPT response in Google Sheets

Chat GPT OpenAI API Answer
Chat GPT OpenAI API Answer

After a few seconds, you will get a reply. If you do not receive an error message, you sent the request and received an answer.

You can also drag down the formula and use it on multiple cells.

As an example, you could have all US presidents in column A. In column b, you could write the Chat GPT prompt and reference the value to the cells in column a. If you write something like “write a short bio for US president” and drag it down, it will write a short bio for each president.

Congrats! You reached the end of the tutorial. You can now use Chat GPT in Google Sheets.