You can use ChatGPT’s powerful language capabilities within your Google Sheets with just 2 simple steps.
In this tutorial, we’ll walk through how to create a Google Sheet that utilizes ChatGPT to generate text directly in your spreadsheets.
Open the “Settings” sheet by clicking the tab at the bottom of the page.
Get your OpenAI API key. If you don’t know how to make one, just follow this guide.
Your API key will look something like this:
sk-JGT******************************************Blb
your-api-key
:
Important: Keep your API key confidential. It is used to track your usage when making requests to OpenAI’s gpt-3.5-turbo or gpt-4 API endpoints.
Use the ChatGPT function =GPT
in your Google sheet.
Click on a cell and enter:
=GPT("Generate Greek mythology ideas for a novel")
It will make a request to OpenAI’s gpt-3.5-turbo / gpt-4 depending on what you have selected in your settings. You should get an output like this:
- The story of Persephone and Hades: The abduction of the daughter of Demeter by Hades and her eventual return to the mortal world.
- The tale of Demeter and her search for her daughter Persephone: Demeter’s desperate search for her daughter and how her absence caused the world to be plunged into darkness.
- …
Specify the model ID to use. For most users, “gpt-3.5-turbo” is recommended. If you have access to gpt-4, you can change this setting to “gpt-4” or “gpt4-32k.”
The system prompt has a slightly stronger influence on the output than a normal user prompt. Modify this setting to optimize the behavior of your requests. For instance, if you’re using ChatGPT in Google Sheets to generate email marketing material, you could change this to “You are a professional email marketer.”
To limit the output length, adjust the max_tokens setting. The default value is the maximum allowed by the model:
Consider these rough estimates when setting max_tokens:
The temperature setting controls the randomness of the output, with values ranging from 0 to 2. The default value is 1. Higher values, like 1.5, result in more varied outputs, while lower values, such as 0.2, produce more focused and deterministic responses.
Get updates on new content, exclusive offers, and exclusive materials by subscribing to our newsletter.