Supercharge Your Spreadsheets with ChatGPT
The increasing number of plug-ins has illuminated the power of ChatGPT, or other LLMs.
These plug-ins enable integration of the OpenAI API with a variety of tools, thereby facilitating the use of models that OpenAI offers, including GPT-3.5 and GPT-4.
One of the tools that can be enhanced with the power of LLMs is Google spreadsheets. The practicality and easy access make spreadsheets one of the top tools for dealing with tabular data. When they're equipped with LLMs, the end result becomes mind blowing.
Let's set up the "GPT for Sheets and Docs" plug-in and explore the ways it can be used for handling a variety of tasks with just one click.
Setup GPT for Sheets and Docs
Open a new Google Sheet in your browser, find "Add-ons" under the "Extensions" menu, and click on "Get add-ons":

In the marketplace, find "GPT for Sheets and Docs" and install it. Make sure to read terms and conditions before you install it because you will need to give it access to certain things in your Google account:

After the installation, you need to provide it with an API key, which you can obtain from the API Keys menu on OpenAI website. Create a new key and copy it. Then, you just need to enter it in the pop-up menu of the plug-in. Here is a step-by-step guide on how to integrate your API key for "GPT for Sheets and Docs" plug-in. You do it for once, not every time you use it.
Summarize text
Let's say you're a product manager and need to summarize a bunch of product reviews from an e-commerce website. It usually takes a lot of time to read reviews and extract the key points from them.
We know that LLMs are great at summarizing text. With the help of the plug-in we have just installed, we can summarize product reviews with just one click.
We need a master prompt. I'm using the following one but feel free to customize it however you want.
Your task is to generate a short summary of a given product review from an ecommerce site. Use at most 20 words.
Then, we can use this prompt in the GPT
function as follows:

Hit enter and you're done. You can apply the same prompt to all the cells just like you apply any other function in your spreadsheet.
Here are the results I got for 3 product reviews:

If you don't want to write a prompt, you can use the GPT_SUMMARIZE
function, which summarize the text in the given cell:

I always prefer writing a prompt because it allows me to customize the output to best fit my needs.
The sentiment of reviews
Let's say you don't need a summary of the reviews but want to find the sentiment of them. You can customize your prompt and get the sentiment in any format you'd like such as 1 for positive and 0 for negative.
I will use the following prompt to extract the sentiment from reviews:
Your task is to find the sentiment of a given product review. Answer with a single word from one of the following: positive, negative, neutral.
Here are the results for two product reviews:

Sky is the limit
We've only just scratched the surface with the two use cases we've discussed. Integrating an LLM into spreadsheets holds potential to accelerate a variety of tasks. Once you get comfortable using it, you'll find your efficiency and effectiveness reaching new heights.
Some of things you can consider using ChatGPT plug-in in your spreadsheets for:
- Generating automated reports
- Data validation
- Inferring
- Expanding
Truly, the sky is your limit.
It has the potential to redefine the way we work with spreadsheets by not only increasing our productivity, but also our creativity.
You can become a Medium member to unlock full access to my writing, plus the rest of Medium. If you already are, don't forget to subscribe if you'd like to get an email whenever I publish a new article.
Thank you for reading. Please let me know if you have any feedback.