|
Welcome to the Google Sheets Tips newsletter #378, your Monday morning espresso, in spreadsheet form! Last week, I shared an essay about how we’re at a threshold in 2026 where writing complex formulas from scratch doesn't make sense anymore (and others have come to similar conclusions). It’s simply no longer economically viable to spend 45 minutes wrestling with syntax when Gemini can generate the same result in seconds. Today, we’re putting that theory to the test with one of the most powerful—but notoriously difficult—functions in Sheets. But you don't even need to know which function it is. Just know what problem you're trying to solve. Find out more below. Also this week, I've been way too much fun with Google's Agentic coding tool, Antigravity. I had fun building an interactive dashboard for my Strava activities without writing a single line of code myself. Perhaps most transformational of all though, I'm using Wispr Flow to dictate everything, rather than typing it on my keyboard. In fact, I'm even dictating this email using Wispr Flow rather than typing. And although it's taking a bit of getting used to, overall it's much quicker than typing. ➜ NewsI. II. ➜ Sheets Tip #378: How to use Gemini to create formulasRegular Expressions functions (REGEX functions) are like a superpower for text, but the syntax looks like someone spilt coffee over their keyboard. So instead of memorizing obtuse strings of backslashes and brackets, let’s get Gemini to do the heavy lifting. Suppose you have a column of text data containing phone numbers, formatted like (123)-456-7890, which you want to extract. If you don't have Gemini integrated into your Sheets (paid plans only), you can use the standalone browser app at gemini.google.com. Method 1: The Gemini Browser App (Available to Everyone)Be specific with your prompt and include "Google Sheets", the input cell(s), and the expected output. The prompt: generate a Google Sheets formula that extracts the phone number from a cell B2. The phone number is of the format three digits-three digits-four digits. Gemini will generate the formula for you: =REGEXEXTRACT(A2, "\(\d{3}\)-\d{3}-\d{4}") Boom! Just copy and paste that into your Sheet. (And you can see why that is not an easy formula to write yourself!) In your Sheet: Method 2: The Gemini Sidebar (For Paying Users)If you have Gemini for Workspace, or pay for an AI plan, you can do this without ever leaving your Sheet. Click the Ask Gemini star icon in the top-right toolbar, which looks like this when you hover over it: You can use a shorter prompt because you're already in the Google sheet, so you don't need to tell Gemini. The prompt: Generate a formula that will extract a telephone number from the cell in B2 Gemini will present the formula in the sidebar. Because it's integrated, you can often click an "Insert" button to have it write the formula directly into your selected cell. The result is the same REGEX formula. Method 3: The AI/Gemini Formula (For Paying Users)You can also generate the same REGEX formula directly in a cell using the AI function (also available using the GEMINI function name). The prompt generate the REGEX formula: Generate a formula that extracts the phone number from text in column B In your Sheet, the formula works like this: =GEMINI("Generate a formula that extracts the phone number from text in column B. ",B5) Or =AI("Generate a formula that extracts the phone number from text in column B. ",B5) This will generate the same REGEX formula that we saw in the examples above. But... You can also just do it directly with the AI/GEMINI function and don't even bother generating a formula. Just ask the AI/GEMINI function to extract the data for you, like this: =AI("extract the phone number",B5) But, if you have a lot of data, it's more efficient to ask Gemini to create one REGEX formula that you can then apply to the whole column. This is much faster than asking the AI function to solve the same problem over and over. So whether you use the browser, the sidebar, or the AI formula, you get the exact same powerful REGEX logic. This lets you move past the technical syntax so you can focus on the insights and outcomes. ---------------- There's a small part of me that's sad that I'll (probably) never wrestle with complex formulas again (like the days of deep thinking to build the formula clock, for example). But mostly, I'm excited that more of us will be able to build the solutions we want because we won't be held back by the syntax barrier anymore. 😍 If you enjoyed this newsletter, please forward it to a friend who might enjoy it. Have a great week! Cheers, |
Get better at working with Google Sheets! Join 50,000 readers to get an actionable tip in your inbox every Monday.
Brought to you by: Hi Reader, Welcome to the Google Sheets Tips newsletter #377, your Monday morning espresso, in spreadsheet form! Coming to your inbox on a Tuesday this week, because it was a public holiday here in the US yesterday. Today I'm pondering whether it makes sense to write your own formulas anymore. AI tools are getting so good at writing formula syntax (and Apps Script code) that it doesn't make sense (economically at least) to spend hours crafting complex formulas yourself, if...
Brought to you by: Hi Reader, Welcome to the Google Sheets Tips newsletter #376, your Monday morning espresso, in spreadsheet form! I've been using Gemini and Gemini Canvas a lot recently for various projects. It's mind-blowing how quick it is at generating formulas and scripts that work. We're definitely at the threshold (or maybe already past it 🤔) where it doesn't make sense to write your own complex formulas or code from scratch (for specific problems with limited scope). Having said...
Brought to you by: Hi Reader, Welcome to the Google Sheets Tips newsletter #375, your Monday morning espresso, in spreadsheet form! We're still in an ice box on the east coast of the US with the snow set to hang around for a while yet. It's beautiful but I am looking forward to the ice melting so it's easier to get around. The Potomac river is covered with ice Today's newsletter is not directly related to Google Sheets. Instead, I'm sharing the sources I use to stay informed of AI...