Getting Started with SheetMagic: A Guide to using Google Sheets with ChatGPT & OpenRouter
Ready to take your Google Sheets game to the next level? Look no further than SheetMagic, a powerful Google Sheets add-on that allows you to
Go to the official SheetMagic Google Sheets Addon and click install. Easy.
Our starter sheet is helpful because it gives easy access to all functions and our prompt library. Here’s how to access it:
IMPORTANT NOTE: You may need to add a card on file to the account first before creating an API key is an option!
Now that you have an API key, you’ll need to set it in SheetMagic. Here’s how:
NOTE: If you want to share your sheet with other teammates or contractors without giving them your API key, you can use the “Save OpenAI Key to Sheet” instead.
Next, we’ll also need to get our SheetMagic license key into the tool. Here’s how:
Congratulations! You’re now ready to start using SheetMagic. Here’s how to use it:
=aitext("your prompt here")
to call ChatGPT.=aitext("the beginning of your prompt,", A3, A5)
.AI Functions | What does it do? |
=aitext(“PROMPT”) | Interact with your Google Sheets data with AI. You can select from GPT-3.5-Turbo, GPT-4, GPT-4-Turbo, or GPT-4o while using the AI function in the sidebar. |
=aiimage(“PROMPT”, “SIZE”) |
Generate an image based on a given prompt using the Example usage: 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”, “horizontal”, “gpt-4o”,) |
Use the =ailist function to easily generate lists with AI. By default, the function uses ‘gpt-4o-mini’ 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. Tip #2: To connect this function AI list to other cells, use the & sign instead of a comma. A comma won’t work for this formula. For example, =ailist(“Give me a list of cities for this country: “&A1) |
=gptv(“IMAGE URL”, “prompt”) |
Use the =gptv() function to easily analyze images and write custom prompts for what you want the AI to respond with. For example, asking for a product description based on the image. Tip: The prompt is optional. By default, the prompt will be “Analyze this image”, so you could just give it an image URL and it will analyze it. |
Scraping Functions | What 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”, 10) |
By default, this will return the top 10 search results from DuckDuckGo in a table with the URL, meta title, and meta description. You can change how many results you get back from the function by editing the number in the second half of the function. DuckDuckGo typically maxes out at 10 results. |
=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. |
=getSelector(“URL”, “selector”) | This is a flexible function where you can give SheetMagic any selector you want and get only the exact data you’re looking for from a webpage. Click here to read the guide. |
=getImg(“URL”) | This function will return every image on the URL you provide and put each image link into different cells below your function. |
=domainCheck(“URL”) | This function will simply check if a domain is available or not for purchase. Simple, but useful when you need it! |
=ailong(), =ai16k(), =gpt4(), =gpt4t(), =gpt432k(), =ai() have all been depreciated.
Please use the =aitext() function and use the SheetMagic sidebar to select the model you'd like to use.
Regarding the =ai() function name, Google has asked us to change it to avoid future conflicts with their products, so we've changed it to =aitext() to go inline with the rest of our naming conventions.
This function is the core way you use AI in Google Sheets.
To interact with your spreadsheet, here's a basic example:
=aitext("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
=aitext("Summarize this information: ", A2:A50)
or
=aitext("Summarize this information: ", A2, B6)
This AI function will use whatever model you have selected in the sidebar. You can also enable safe mode to minimize errors (especially if you are getting a maximum execution time error).
Here is how to change the AI mode:
Go to Extensions -> SheetMagic -> Open sidebar
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.
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:
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.
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.
We have some additional options like caching and giving back the raw text in the cell after running an AI call.
If you find that your cells keep reloading every time you load the sheet, you can enable the "Replace Function" option and it will always give you back the text without keeping the formula in tact.
Enabling cache is also a helpful feature if you ever accidentally reload the function, you won't get charged for the same prompt twice because it gets stored in the cache.
Are you a visual learner? No problem! Here are some videos to get you started!
Automate web scraping with timed interval scraping. (i.e. Scrape price every 4 hours, scrape blog titles every 30 minutes, etc)
Written guides on how to use SheetMagic
Ready to take your Google Sheets game to the next level? Look no further than SheetMagic, a powerful Google Sheets add-on that allows you to
Are you looking for ways to improve your website’s SEO? Look no further than SheetMagic, a powerful tool that can help you generate content ideas,
SheetMagic is a powerful tool that can revolutionize the way you work with Google Sheets. With its AI capabilities, you can automate repetitive tasks, generate
SheetMagic 2.0 is officially released! We are extremely excited to finally have this new update out and with it, you’ll see a lot of improvements
Quick Answer: Yes, you can use GPT in Google Sheets to create AI content like summaries and descriptions directly from your data. It simplifies tasks,
Quick Answer: To paste text from ChatGPT into Google Sheets without carrying over formatting, utilize the “Paste special” option or the Ctrl+Shift+V (Cmd+Shift+V on Mac)
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.
To fix this, go your OpenAI billing settings and make sure you have a paid OpenAI account and paid at least $5 to OpenAI and have credits loaded in your account. If it's still not working, make sure you don't have any quota settings as that may make you hit your limit.
If your OpenAI API balance says $0, add funds to your balance so that you have funds as this is the main reason for this issue.
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 enabling SAFE MODE in the SheetMagic sidebar and this will allow you to bypass the limit and also caches your results from the AI so you don't get charged twice.
Go to extensions and click "Use SheetMagic on this Sheet" to load SheetMagic, otherwise your Google sheet won't recognize custom functions.
When scraping, SheetMagic does not have any limitations, however you may run into this limitation from Google for URL fetching.
The limit is set by Google on a per account basis. Consumer accounts (gmail) have a limit of 20,000 urlfetch calls per day, while business accounts (Google Workspace) can make up to 100,000 urlfetch calls daily.
Usually this is due to a conflict with another extension or Chrome extension. If you try it in incognito mode, it should work.
You can try disabling Google Sheets Addons and Chrome extensions one-by-one to find which one is causing the conflict with SheetMagic.
This could be two things.
Most Likely Case: Sometimes in other countries Google uses a semicolon as a delimiter instead of a comma.
So in order for you to connect to different cells you would type something like this:
=aitext("Summarize this data:"; C2)
This should work and if you want to change it to a comma as a delimiter, you may be able to do that in your Google settings, but this is likely the issue
Still getting the error? You probably just typed your formula incorrectly. Double check that the formula is a valid formula and is exactly as it is explained in the docs.
It's never been easier to create AI content in bulk.
Install SheetMagic now to experience the magic!
INSTALL FOR
Google Sheets
Backed by CV Ventures
© 2025 All rights reserved
Disclosure: SheetMagic's use and transfer of information received from Google APIs to any other app will adhere to Google API Services User Data Policy, including the Limited Use requirements. See privacy policy for more.
Already have an account? Click here to login