| Turbocharge Your Google Sheets with GPT-4

Turbocharge Your Google Sheets with GPT-4

ChatGPT is great, but have you tried using it directly with Google Sheets (without 3rd party software)? With a few simple tricks, you can use your data in your prompts, and get it processed in a smart way by GPT-4.

In this tutorial, I will demonstrate how we use the intelligence of GPT-4 with Google Sheets at to automate otherwise unscalable tasks that we would need to do manually.

PLEASE NOTE: Even though GPT-4 API pricing is relatively affordable ($0.03 per ~800 words of prompt and $0.06 per ~800 words of responses), things could get out of hand, if you want to process thousands or tens of thousands of rows. “Luckily”, you will start getting rate limit errors from OpenAI API after processing dozens of rows at a time, so you will need to do some manual manipulation for hundreds or thousands of rows anyway. Still, make sure your API usage limits are properly set in OpenAI account settings (they are by default).

Making GPT-4 available in Google Sheets


To get started, you will only need a Google account (so you can use Google Sheets). Getting everything else will be explained below. Please note that for this to work, you need a pay-as-you-go OpenAI account, so you will need to configure billing in your OpenAI account. However, API calls are relatively low cost—GPT-4 API calls cost you $0.03 for ~800 words of prompt, and $0.06 for ~800 words of response. Unless you need to process thousands of Google Sheet rows and/or use really large prompts, it will not be really expensive.

OpenAI account and API key

If you don’t have one, you need to create an OpenAI account (this is NOT a ChatGPT or ChatGPT Plus account!). Here’s how you create one:

  1. Log into OpenAI with your Google Account here (click Continue with Google).
  2. Enter your name, company name (if relevant), and birth date.
  3. Verify your phone number.
  4. Select “API – Integrate OpenAI models into your application or business”.
  5. Set up billing information here.
  6. Click “Set up paid account” and then enter your billing information and click “Set up payment method”.

Also, you will need an API key for this to work. Navigate to API keys and click “Create new secret key” and then type in a nickname for your key (can be whatever). Make sure you don’t share this key with anyone. Copy/paste it somewhere as you will need it later.

Set up Google Apps Script

Open (or create) the Google Sheet you want to use GPT-4 with. In the menu, select “Extensions” and then “Apps Script”. A code editor like this will open: | Turbocharge Your Google Sheets with GPT-4

Delete all the content in the right side of the window (starting with “function myFunction…”) and then copy paste code below in to the same window, also replacing YOUR_API_KEY with the OpenAI API key you saved earlier: | Turbocharge Your Google Sheets with GPT-4

Click the “Save Project” button (CTRL+s or CMD+s) and close the “Untitled project – Project Editor” browser tab. Congrats! You’re ready to use GPT-4 in your Google Sheet now. In a nutshell, this is how you use it: In the cell, you want to generate GPT-4 output in, write a formula using GPT_GENERATE() function, and provide it with the prompt you want to get a GPT-4 response to. That’s it, it’s really that simple.

Let’s look at a few real-world examples of using GPT-4 with Google Sheets.

Use Case #1: Sorting email responses by level of excitement

For a lead generation company, positive responses to email campaigns we send on behalf of our clients, are the most beautiful thing to read. We’re just updating our website, and I thought why don’t we include some of the most upbeat positive responses (anonymized, of course) on our website, as a testimonial to the quality of our service?

One could spend hours digging through hundreds of positive responses we received over the past few months, but there’s a better way to do it—by using GPT-4 to do sentiment analysis on our data. We only need the list of all responses and a Google Sheet configured as specified in the instructions above.

First, I exported the ~800 such positive responses we received in the past few months from various prospects, from our database into a Google Sheet (shown anonymized): | Turbocharge Your Google Sheets with GPT-4

Now, I want to assign every response an “excitement score” between 0 and 100, so I can then sort responses by excitement level, and only pick the most exciting for our website. I created a new column called Excitement score, and now I can use the following Google Sheets formula in the cell B2: | Turbocharge Your Google Sheets with GPT-4

This will produce the following result—note the “60” score in the cell B2. This value was provided by GPT-4: | Turbocharge Your Google Sheets with GPT-4

The only thing left to do now is to expand the formula to the remaining cells in column B, so we calculate scores for the rest of responses: | Turbocharge Your Google Sheets with GPT-4

Voila, and there they are, all the positive responses scored by their level of excitedness (as per GPT-4, which is not perfect, of course). Some of the responses had scores above 90, which were indeed more interesting and sounded more upbeat than the rest.

Doing this task with Google Sheets and GPT-4 saved hours of time of our account managers manually sifting through past responses.

Use Case #2: Converting full company names into nicknames

Let’s say you want to convert full company names into “handles”, i.e. shorter names you can refer to in an email, for example.

This is useful if you’re sending email campaigns and want to personalize emails per-prospect with their company name (but don’t want to use “ACME, Inc.”, because that sounds unnatural).

This is very easily doable with the Google Sheets + GPT-4 approach described above.

Let’s say we have the following list of company names: | Turbocharge Your Google Sheets with GPT-4

Now, I want to derive a Company Nickname for every Full Company Name in the list. I created a new column called Company Nickname, and now I can use the following Google Sheets formula in the cell B2: | Turbocharge Your Google Sheets with GPT-4

This will produce the following result—note the nickname in cell B2. This value was provided by GPT-4: | Turbocharge Your Google Sheets with GPT-4

The only thing left to do now is to expand the formula to the remaining cells in column B, so we get the nicknames for all company names: | Turbocharge Your Google Sheets with GPT-4

Wrapping up

I hope you found this guide helpful. It’s not difficult to imagine tons of other potential uses for such Google Sheets + GPT-4 integration.

Oh, there’s one thing that might make your life easier when using this approach: when you have generated responses in desired cells, it make sense to do a simple 1) “copy” and 2) “paste values only” on those cells, as this will ensure those cells won’t get recalculated when you manipulate them further (or reopen the sheet), and that you won’t get charged multiple times for the same result.

Good luck!

Customer testimonials | Turbocharge Your Google Sheets with GPT-4
Karim Mohammed
CEO @ Tranquil Clinical Research, Clinical Research Organization & Clinical Site has mastered the ability to open doors that were previously closed. The impressive team of folks that works to continuously build business for me, learns my business and then sets out to build my business. If you need a team to get you out in front of the right clients, has consistently performed for my organization. | Turbocharge Your Google Sheets with GPT-4
Rafael Rosengarten
CEO @ Genialis, Data science and drug discovery company gets you in front of your customers with insane efficiency. They figure out the right people to talk with, and deliver that meeting directly to your calendar. Doing business in the life sciences and biotech industries requires a deep understanding of these markets. The team gets it, and this enables a personalized approach to outreach that resonates with its audience. | Turbocharge Your Google Sheets with GPT-4
Kyle Giffin
Chief Operating Officer, LatchBio simply delivers. A totally professional team, they have increased our meeting count and helped us close real customers. I’m grateful to be working with Klemen and Urska, and would recommend their service to others in biotech.
Switzerland-based service provider are true domain experts and have consistently delivered highly qualified leads for us. Their approach to lead-generation is highly targeted and focused allowing me to spend my time and efforts on pursuing high-ticket business opportunities. I highly recommend to anyone looking to optimize their marketing budgets, whilst still making meaningful connections in the life-science industry.
VP Sales
San Diego-based platform biotechnology company
Running a lean start up requires effective lead generation for commercial activities. The team at took the time to learn our technology and our solution services with our company. They worked effectively to bring our organization high quality prospects for our early access program and sales. I would highly recommend their organization for any company looking to outsource their lead generation.
Head of Business Development
European CRO helped us to generate a multitude of introductory meetings with potential clients and some of these meetings were the starting point of new exciting business relationships. The collaboration is smooth and efficient and when comparing costs per high quality lead the approach is superior compared to other lead generating methods such as congresses or webinars.

Check if you qualify

To take advantage of services, your business must fulfill the following eligibility requirements:

  • Sales process includes exploratory sales meeting
  • Target one or more of supported industries
  • Audience size > 1,000 - Calculate your target audience size
  • Average annual contract value > $5,000
  • Direct sales, not (only) via distributors
Fill Your Calendar with Sales Meetings star

How our clients describe

“An efficient company that helps us to find good leads for new projects so that we could close contracts from leads we got from them. I recommend trying them out.”
“An efficient way of outsourcing contacting new business leads.”
“Provides quality contacts/prospects for sales.”
“ has helped us to find several of our recurring customers.”
“Flexible, focused, responsive, experts.”
“A risk-free method to collect new leads.”
“Reactive and collaborative company that can create meetings for you.”
“Helps us find clients by booking meetings on our behalf.”
“A facilitator to generate great qualified leads using tailored mail marketing strategy.”
“A great way to get meetings without having to worry about how to send and manage cold emails.”
“Resource for targeted lead generation to supplement your business development initiatives.”
“Reliable and efficient leadgen service provider for life sciences.”
“An extension of your business development team to help you find new valid leads.”