Analyze Google Sheets Data with Gemini¶
| Category | Everyday AI (ChatGPT, Gemini, Grok, n8n) |
| Status | ๐ก Partially completed |
| Repo | nextwork-analyze-google-sheets-data-with-gemini |
| Original NextWork guide | nextwork.ai |
Learning project
Practice work following a NextWork guide, separate from my production projects.
๐ NextWork learning project. This is a practice project I built while working through NextWork's Analyze Google Sheets Data with Gemini guide. It is part of my Learning portfolio and is fully separate from my production projects.
Category: Learning โบ Everyday AI (ChatGPT, Gemini, Grok, n8n)
Status: ๐ก Partially completed
Overview¶
The point of check formulas is that you don't take a model's numbers on trust. I asked it about six made-up monthly totals, then recomputed everything myself. It got the best month right and the growth badly wrong.
Summary¶
Asked a local chat stand-in questions about made-up tea-shop monthly totals by region, then asked for the formula behind each answer, a region-filtered monthly chart, and check questions for my own running log. My own checks.py recomputed every answer: the model added May up to 2,010 instead of 3,010 and so reported -9.5% growth where the real figure is +35.6%. Its check formulas also wouldn't have matched the data. Partial: no Gemini or Google Sheets. My scripts (docs/sheet-tools/) do the clean tab and the monthly-by-region chart instead.
The checks behind this are in docs/verification.txt.
Skills & tools¶
Prompt engineering, Iterative prompting, Python, Local LLMs (Ollama)
What I built¶
chat.py: a small local stand-in for the vendor's chat app. It has saved conversations you can rename, list and reopen, custom instructions, a memory file read by every new chat, and artifacts saved as files. It runs on qwen2.5:3b through Ollama.test_chat.pycovers it offline.session.json: my own prompts for a made-up person (none copied from the guide), run withpython chat.py run session.json, which writesdocs/transcript.md.docs/transcript.md: the questions, the model's answers and formulas, the chart steps and the running-log questions.docs/sheet-tools/checks.pyandchecks.txt: my recomputation of every answer, with the matching spreadsheet formula.docs/sheet-tools/:make_orders.pyandclean_and_report.py(my made-up messy order file, the clean tab with 190 orders and no duplicates, andanalysis.pngwith sales by month and region).docs/review.md: my review of how the run went, including what the model got wrong.
How to run¶
# needs Ollama with qwen2.5:3b
python chat.py run session.json # replays my prompts, writes docs/transcript.md
python chat.py list | python chat.py show <id>
python -m pytest -q test_chat.py
Verification¶
I ran the verification command on 2026-12-03. The full output is in docs/verification.txt.
/workspace/nextwork-portfolio/.venv/bin/python -m pytest -q -p no:cacheprovider test_chat.py && test -s docs/transcript.md && grep -q '35.6%' docs/sheet-tools/checks.txt && echo CHAT OK
What isn't done, and why¶
This doesn't use Gemini with Google Sheets or its account: the app is a local stand-in and the model is qwen2.5:3b, which is much weaker than the vendor's model. Features that only exist in the vendor's product aren't reproduced. There's no live sheet or interactive filter: the region split is a grouped chart made by my script.
Original project: https://nextwork.ai/projects/e67a6cd1-ed6d-444e-9f72-d6e7a7ca4998 ยท Part of my NextWork Learning portfolio (hub).
Verification output¶
From docs/verification.txt:
$ /workspace/nextwork-portfolio/.venv/bin/python -m pytest -q -p no:cacheprovider test_chat.py && test -s docs/transcript.md && grep -q '35.6%' docs/sheet-tools/checks.txt && echo CHAT OK
... [100%]
3 passed in 0.03s
CHAT OK
[exit code 0]