- Compound Leverage
- Posts
- Copy My Script, Create an AI Analyst In Google Sheets
Copy My Script, Create an AI Analyst In Google Sheets
Take two minutes out of your day to build an AI Analyst in Google Sheets
Compound Leverage
Issue #0030
I am running my 2025 Strategy from a Google Sheet, and here is how you can do it, too.
I manage the strategy across ten tabs. The old way involved jumping between Google Sheets, writing a prompt in ChatGPT to analyze the data, and then acting on the insights. It worked, but switching back and forth was slowing everything down.
What if you could analyze without leaving Google Sheets? First, I had it write a script to add an AI Analyst inside my Sheet. Then, we tested different data analysis methods until we found what worked best.
Now, I can instantly analyze any tab in my strategy document. Revenue tracking, lead pipeline, product performance—the AI analyzes it all with one click. I even wrote a second script for this.
The best part?
You can copy my code or ask ChatGPT or Claude to write a script.
The script takes just three steps to deploy:
Copy the code into your sheet and paste it
Open your sheet and select Extensions > App Script
Paste the script, give it a name, and save it
Then, refresh your worksheet, and a menu called AI Tools will appear. It will look like this:

Enter your API key when you select Set API Key from the Add-In menu, select Generate Insights, and you're done.
Now, I run the analysis on any tab. The AI spots trends I missed and suggests fixes when we're off track. What used to require switching back and forth between Google Sheets and ChatGPT now happens where I want it to.
Want to try it? Copy my script here and follow these steps. You'll need an API key, but that's it. No complex coding or data imports are needed.
Copy the script here.
PS: Update the prompt in Line 50 of the script.(Optional)
-Marvin
Want more tools like this?
Join THINK School to get access to our entire AI library.
The first 7 days for free, no credit card is required.
Reply