Sheet Surfer

Documentation

Documentation

Sheet Surfer Setup & Introduction

Getting started 

  1. In the top right of this page, click the “Open Sheet Surfer” button
  2. On the sheet go to “File” then click “Make a copy”
  3. Go to OpenAI, login to your account (or create one), and create a new secret key for Sheet Surfer
  4. In your copy of the sheet, go to the Sheet Surfer dropdown and click “Set API Key”
  5. Follow the authorization steps (may show a warning, but you can bypass that)
  6. Once, authorized click “Set API Key” again and paste in your OpenAI key.

You’re now setup & ready to start using any of the Sheet Surfer functions!

How to create an OpenAI account and API key

In order to use Sheet Surfer, you’ll need to have an OpenAI account and create a new secret key. Here’s how to do it:

  1. Go to OpenAI’s website and create an account (if you don’t have one already).
  2. Once you’re logged in, go to the API Keys page.
  3. Click on “New Secret Key” and give it a name like “Sheet Surfer”.
  4. Copy the API key that is generated.

 

Use Sheet Surfer in your Google Sheet

Congratulations! You’re now ready to start using Sheet Surfer. Here’s how to use it:

  1. In any cell in your Sheet, type =ai("your prompt here") to call ChatGPT.
  2. To use multiple cells in your prompt, separate them with commas. For example, =ai("the beginning of your prompt,", A3, A5).
  3. Press Enter and watch Sheet Surfer generate text based on your prompt!

Functions

All Functions Available

AI Functions What does it do?
=ai(“PROMPT”) Interact with your Google Sheets data with AI.
=ailong(“PROMPT”) Slower version of the AI function, but better for bulk work or if you’re getting timeout errors for your prompts. Use this if you keep experiencing #ERROR messages.
=gpt4(“PROMPT”) Use GPT-4 to interact with your Google Sheets data with AI.
=gpt4t(“PROMPT”) Uses OpenAI’s new GPT-4 Turbo model (still in beta from OpenAI, so there may be errors)
=gpt4long(“PROMPT”) Slower version of the GPT4 function, but better for bulk work or if you’re getting timeout errors for your prompts.
=gpt432k(“PROMPT”) This uses the GPT-4-32k model and allows for extremely long inputs & outputs
=aiimage(“PROMPT”)

Generate an image based on a given prompt using the =aiimage() function. By default, the function creates a square image. To specify the image orientation, add a size parameter: “portrait”, “landscape”, or “square”.

Example usage: =aiimage(“giraffe”, “landscape”)

TIP: If you want the image to show up in a cell (instead of the link to an image), you can use the =image() function on the image link that Dall-E generates.

=ailist(“List 10 books”, “gpt-4-turbo”, “horizontal”)

Use the =ailist function to easily generate lists with AI. By default, the function uses ‘gpt-3.5-turbo’ in a vertical format. Enter your list request as =ailist(“Your list prompt here”). For tailored outputs, you can customize the model to ‘gpt-4-turbo’ and adjust the orientation to ‘horizontal’ or other preferences as needed.

Tip: Copy & Paste as values after your list is created (CTRL + SHIFT + V) so you don’t lose it.

Scraping FunctionsWhat does it do?
=visit(“URL”)Visits a URL and returns all of the content on that page (which you can then interact with using AI)
=serp(“SEARCH QUERY”)This will return the top 20 search results from DuckDuckGo in a table with the URL, meta title, and meta description.
=bulkserp(“SEARCH QUERY”)Gets top 5 search results from DDG and puts them horizontally.
=getMetaTitle(“URL”)This will return the meta title for a given URL
=getMetaDescription(“URL”)This will return the meta description for a given URL
=getH1(“URL”)This will return the H1 for a given URL.
=getH2(“URL”)This will return any H2s on a page for a given URL.
=getHeadings(“URL”)This will return all the headings on a page for a given URL.
=getp(“URL”)This will return all paragraphs wrapped in a <p> tag for a given URL.
=pagedata(“URL1”, “URL2”)This will get a lot of the page data listed above for a list of URLs and put it into an organized table for you.

=ai("PROMPT") and other AI functions

This function is the core way you use AI in Google Sheets.

To interact with your spreadsheet, here's a basic example:

=ai("Summarize this information: ", A2)

This would summarize all the information in the cell A2.

You could also use a range of cells OR with multiple cells separated by commas. For example, you could type

=ai("Summarize this information: ", A2:A50)

or

=ai("Summarize this information: ", A2, B6)

You can use all the other AI functions in the same way.

Important note: If you are in a country outside of the US, the delimiter used may be a semicolon instead of a comma.

That means to interact with your data you would need to do =ai("Summarize this info: "; A1)

=visit("URL")

This function will visit a URL and return all of the content on that page (which you can then interact with using AI).

For example, if you type into a cell:

=visit("https://www.hubspot.com/inbound-marketing")

It would return all of the content on that page in the cell,

This can be helpful for a wide variety of reasons, but as an example, you could use AI on the content to create a better blog post. You could use AI to extract the important topics your competitors talk about in their post or use AI to determine topics that they missed so you can create something more unique.

Opportunities are endless and you could use it for a wide variety of use cases - that is just a small one.

=serp("SEARCH QUERY")

This function will return the top 20 search results from DuckDuckGo in a table with the URL, meta title, and meta description.

For example, if you type into a cell:

=serp("Best running shoes for men")

It would return the top 20 search results for that search query:

=PageData("MULTIPLE URLS")

This function will get all sorts of page data for a list of URLs and put it into an organized table for you.

For example, if you type into a cell:

=pagedata("https://www.hubspot.com/", "https://callscaler.com")

It would scrape and return the URL, Meta Title, Meta Description, H1, all the headings shown on the page, and all the paragraphs on the page each into their own cell.

Other scraping functions

You can also use other scraping functions as well for specific parts about a page:

=getMetaTitle("URL")
This will return the meta title for a given URL

=getMetaDescription("URL")
This will return the meta description for a given URL

=getH1("URL")
This will return the H1 for a given URL.

=getH2("URL")
This will return any H2s on a page for a given URL.

=getHeadings("URL")
This will return all the headings on a page for a given URL.

=getp("URL")
This will return all paragraphs wrapped in a <p> tag for a given URL.

Videos

Are you a visual learner? No problem! Here are some videos to get you started!

Sheet Surfer Setup & Introduction

Common Errors

Unable to get a response from AI

We've recently updated this so that it outputs the exact error so that you can learn & fix the issue yourself. You may also see the message "An error occurred from OpenAIs side. This is not related to Sheet Surfer & the issue stems directly from your OpenAI account."

There are two typical errors in this situation...


Error #1: The model `gpt-4` does not exist or you do not have access to it

Fix: As of August 4, 2023, you fix this by going to your OpenAI billing settings and make sure you have a paid OpenAI account and paid at least $1 to OpenAI. If it's not working, check the OpenAI help article on how to get GPT-4 access as this may be more up to date as they make changes.


Error #2: You exceeded your current quota, please check your plan and billing details

Fix: To fix this, go your OpenAI billing settings and make sure you have a paid OpenAI account and paid at least $1 to OpenAI. If it's still not working, make sure you don't have any quota settings as that may make you hit your limit.


If you're still having trouble, please include a shareable link to your sheet in a support message so we can check the issue and let us know what error you're seeing.

#ERROR - Exceeded maximum execution time

Unfortunately Google Sheets has a hard limit of 30 seconds for each function to run, so if you try to create longer outputs it will not work because it takes too long and it will cause an error because of the Google Sheets limit.

Fix: Try using the function =ailong() to get around that limit.

I get a #NAME? error

Make sure you are using a copy of the original sheet on your account page. Otherwise you may be using a sheet that does not have the AI and scraping features enabled.