Hey Freelance Friends!

Picture this, we're knee deep in Profreelance's finances on a random Tuesday, muttering at a spreadsheet, when we go looking for one small thing and stumble onto a formula Google barely talks about. Free, sitting inside every Google Sheet you own, and genuinely useful once you know what to actually ask it.

We tested it properly, broke it a few times on purpose, and we’re bringing you the whole thing today, receipts included.

Sponsored

It’s the platform behind some of the world’s most-read newsletters, built for writers who want clean publishing, real growth tools, and monetisation that doesn’t feel bolted on as an afterthought. No duct tape. No fighting your software.

Freelance Forward runs on Beehiiv for a reason. It stays out of the way and lets the writing do the work.

If a newsletter is even a quiet idea at the back of your mind, this is the infrastructure part done right.

We were doing finance admin for Profreelance, trying to get a proper handle on the numbers in a Google Sheet, when we went looking for a way to get AI help working directly with that data, without copying it out to a chat window and back. What we found is a genuinely useful trick, a free custom formula that reads data straight out of a cell and generates an answer about it, a category, a flag, a summary, no subscription attached.

The trick: a formula that reads your data and works with it, for free

Google gives away free access to its Gemini AI models through something called the Gemini API, reached via a tool called Google AI Studio. Paired with a small bit of code called Apps Script that lives inside every Google Sheet, this turns into a custom formula, =GEMINI(...), that you type into any cell like any other formula, on any Google account, free or paid, no subscription attached.

Point it at a cell full of real data, an expense description, an invoice line, a client note, and it reads that and generates a response based on it. Drag it down a column and it runs against every row, classifying, flagging, or summarising each one. Think of it as a formula the same way =SUM() is a formula, except this one calls on AI to read and respond instead of doing arithmetic.

Here's exactly how to set it up. You're copying and pasting twice, no coding knowledge required:

Step 1: Get your free key- Go to aistudio.google.com and sign in with your normal Google account. Click "Get API key," then "Create API key." No credit card, no application, no waiting period. You'll get a long string of letters and numbers. Copy it and keep it somewhere safe, like a notes app, you'll need it in a moment.

Step 2: Open the code editor inside your spreadsheet- Open the Google Sheet you want to use this in. Click "Extensions" in the top menu, then "Apps Script." A new tab opens with a blank code editor. This looks technical but you're not writing anything from scratch.

Step 3: Paste this in- Delete whatever's already in the box and paste this exactly as it is:

❝

function GEMINI(prompt) {
var apiKey = "YOUR_API_KEY_HERE";
var url = "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent";

var payload = {
contents: [{ parts: [{ text: prompt }] }]
};

var options = {
method: "post",
contentType: "application/json",
headers: { "x-goog-api-key": apiKey },
payload: JSON.stringify(payload),
muteHttpExceptions: true
};

var response = UrlFetchApp.fetch(url, options);
var data = JSON.parse(response.getContentText());

if (data.error) {
return "Error: " + data.error.message;
}
return data.candidates[0].content.parts[0].text;
}

Where it says YOUR_API_KEY_HERE, delete that exact text and paste the key you copied in step 1, keeping the quotation marks around it.

Step 4: Save and give it permission- Click the little disk icon to save, and give the project any name you like. Then click the "Run" button once. Google will show you a screen warning that this app isn't verified, this is normal, it's because it's your own private script and nobody's reviewed it but you. Click "Advanced," then "Go to [your project name] (unsafe)," then "Allow." You'll only see this once.

Step 5: Use it- Go back to your spreadsheet. In any cell, type:

❝

=GEMINI("your question or instruction here")

Press enter, and Gemini answers directly in that cell. Point it at another cell's content, like =GEMINI(A1), and drag it down a column to generate content against every row of data you already have.

One thing worth knowing before you get too comfortable: this setup lives inside the one spreadsheet you built it in, not your Google account as a whole. Open a brand new Sheet tomorrow and the =GEMINI(...) formula won't be there, you'd need to go back through Extensions > Apps Script and paste the code in again. The easy fix is to keep this first spreadsheet as a template. Whenever you need the formula somewhere new, go to File > Make a copy, and the script comes along with it, no rebuilding required.

One more honest heads up: the free daily limit on this isn't fixed, and Google has quietly tightened it before without much warning. If a cell suddenly returns an error instead of a normal answer, you've likely hit your daily cap for the day, and it resets at midnight Pacific time, roughly 10am South African time.

What it's actually great at, tested with real prompts

We ran a few tests to see exactly what this formula handles well. Here's the honest picture.

Test 1: Classifying a real expense

❝

=GEMINI("Classify this expense into one category only, choose from: Software, Contractor, Marketing, Admin. Expense: Canva subscription renewal, R270")

What came back: "Software"

One word, exactly what you'd type into a category column yourself, except this can run against every row automatically.

Test 2: Flagging a late invoice from real data

❝

=GEMINI("Today's date is 31 August 2026. This invoice was issued on 22 July 2026 and is unpaid. Is it more than 30 days overdue? Answer only Yes or No.")

What came back: "Yes"

Point this at an actual invoice date column and a payment status column, drag it down, and you've got an automated overdue flag without writing a single formula yourself.

Test 3: Where it draws a line

❝

=GEMINI("Create a simple budget tracker for a freelancer in South Africa. Include columns for date, client name, income received, expense category, expense amount, and running balance. Add five example rows of realistic data.")

What came back: "The necessary data is beyond the provided context. Please use the side panel for help with creating this budget tracker."

Worth knowing so you're not surprised by it: this formula writes content into the cell it lives in, it doesn't build new tabs or lay out columns on your behalf. That fuller version, type one prompt and watch Gemini construct an entire structured spreadsheet with tabs and formulas, does exist, it's just tucked inside a paid Google One or Workspace subscription, R400 to R700 a month depending on the plan. Not something most of you need for what this free formula already handles well.

The takeaway

Free, sits inside a spreadsheet you already use, and does real work on your actual data, classifying expenses, flagging overdue invoices, summarising a column, one row at a time, without needing to build a formula for every edge case yourself. Just keep in mind the daily limit can shift without warning, so it's a genuinely useful tool for a freelancer's toolkit, not one to build a hard deadline around.

Try the prompts above yourself and hit reply, I want to know what you build with it.

— The Profreelance Crew

Tool of the week

Gemini API

The engine behind everything you just read. Free to start, no credit card, and it's what's actually doing the reading, classifying, and flagging when you type =GEMINI(...) into a cell.

If today's trick has you curious about what else it can do outside of Sheets, this is the rabbit hole.

PROFREELANCE (Pty) Ltd

2023/279056/07

Freelance Forward operates under a published Editorial Disclosure and Disclaimer Policy, covering our use of AI, affiliate relationships, and editorial standards.
Read it here.

Recommended for you

View all