Build a Smart Google Sheet with Gemini¶
| Category | Everyday AI (ChatGPT, Gemini, Grok, n8n) |
| Status | ๐ก Partially completed |
| Repo | nextwork-build-a-smart-google-sheet-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 Build a Smart Google Sheet 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¶
Spreadsheet AI is most useful for cleaning and categorising, and most dangerous when its formulas look right but aren't. I made a messy 190-order file of my own, asked the model how to clean and categorise it, then did the job in code to see where its advice held up.
Summary¶
Asked a local chat stand-in for cleaning rules, a Sales formula, a one-formula category column, three charts with a summary, and steps for adding a new month, all for a made-up messy tea-shop order file. Then did the work myself with my own scripts (docs/sheet-tools/): 198 raw rows to 190 clean orders, 12 product spellings to 8, three date formats parsed, a Sales and Category column, three charts and a June refresh that surfaced a product no rule covers. Partial: no Gemini in Sheets, and several of the model's formulas would fail in a real sheet.
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 model's cleaning rules, formulas, chart and summary suggestions, and June steps.docs/sheet-tools/:make_orders.py(my messy made-up data: 190 orders plus 8 duplicates, mixed dates and spellings),make_june.py,clean_and_report.py(Clean, Sales, Category, charts, summary), and their outputs: the clean CSVs,report.txt,analysis.png, and the with-June versions.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 'clean orders 190' docs/sheet-tools/report.txt && echo CHAT OK
What isn't done, and why¶
This doesn't use Gemini in 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. This isn't Google Sheets: the 'tabs' are CSV files and PNG charts made by my script, and the AI-filled column is a rule I wrote, not a model call per row.
Original project: https://nextwork.ai/projects/31376ca6-977d-4bd9-8e94-2891ff503777 ยท 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 'clean orders 190' docs/sheet-tools/report.txt && echo CHAT OK
... [100%]
3 passed in 0.02s
CHAT OK
[exit code 0]