Sheets Tip 355: Conditional Formatting (with Gemini and formulas)


Brought to you by:


Hi Reader,

After a few weeks break for the summer πŸ–οΈ, we're back with the Google Sheets Tips newsletter #355, your Monday morning espresso, in spreadsheet form!

What's new?

AI continues to dominate the tech headlines, with new features crammed into every corner of the internet, whether they’re needed or not. But beyond the hype, the tools are improving, and that includes in the spreadsheet domain.

These days, when I need to create a complex formula, I often start with a prompt rather than an equals sign. More often than not, the result is correct, or at least a solid starting point.

Case in point, today's tip: we use Gemini to build conditional formatting. (Don't worry, I'll also show you the classic formula approach, if you don't have access to Gemini in Sheets.)


➜ News

I.
​
What's in store for Spreadsheets in the age of AI? This is a recording of a chat I had with GRID CEO, Hjalmar Gislason, earlier in the summer:

​AI & Spreadsheets Discussion​

II.
​
Sticking with AI + Spreadsheets, OpenAI has entered the chat... In this video, they showcase their Agent model building a spreadsheet (a CSV file) from public data on the web.

It looks impressive, but I think we're still a ways off from truly agentic, hands-off spreadsheets. (At least that's my hope, so I can still add value to the chain πŸ€“.)

​ChatGPT agent Makes Spreadsheets​


Brought to you by: Bricks

Bricks AI Spreadsheet: Create Dashboards & Reports in 1-Click

Bricks makes creating reports and dashboards from your spreadsheet data a breeze. Just import your data and Bricks creates interactive dashboards for you in seconds - complete with charts, KPIs, insights, and tables you can customize and share.

  • Get Instant Insights: Bricks analyzes your data, surfacing patterns, trends, and key insights
  • Generate AI-Powered Summaries and Tables: Bricks organizes and summarizes your data, complete with neatly formatted tables
  • Automatically Create Charts: Bricks builds charts for you and updates them when your spreadsheet data changes

Join 10,000+ professionals from organizations like Amazon, Nvidia, and Stanford who use Bricks to get their reporting done 10x faster.


➜ Sheets Tip #355: Highlight the Top 5 Values using Gemini AI

For today's tip, let's see how to highlight the top 5 and bottom 5 in a set of data, using conditional formatting.

We're using this student dataset:

Let's see how you can do this with two approaches:

  1. with Gemini AI, and
  2. with traditional formulas.

1) Using Gemini AI

Gemini in the sidebar is available to Google Workspace subscribers or personal accounts that pay for an AI plan.

And with Gemini, you can now apply conditional formatting to data with prompts instead of writing the formulas yourself.

This is a HUGE benefit!

Open Gemini via the star button in the top right corner:

Click on a cell somewhere in your dataset and then enter this prompt in the Gemini sidebar:

apply conditional formatting to the whole row that highlights the top 5 exam scores. Highlight the name and the score. Be careful because the scores are percents so e.g. 90% is the value 0.9

(I added the third sentence to help Gemini understand how my numbers were formatted. It took trying a few different prompts for Gemini to give me a correct answer.)

Gemini proposes a plan and the formula looks like it will work:

Best of all, you can click the "Apply" button and have Gemini set up the rule in the actual Sheet.

The output is that the 5 rows with the top exam scores are highlighted yellow:

Impressive!

The formula works, although the second condition ($B2<="1") and the AND formula are not required. But it managed to get all the $ signs in the correct places to ensure the whole row was highlighted.

2) The DIY Approach (if you don't have access to Gemini in Sheets)

If you don't have access to Gemini in your Sheets, you can still apply conditional formatting in the regular way.

Highlight your dataset and go to the menu: Format > Conditional Formatting

Under the Format Rules, choose "Custom formula is" and enter one of the formulas below.

To highlight the top result:

=$B2=MAX($B$2:$B$41)

To highlight the top 5 results:

=$B2>=LARGE($B$2:$B$41,5)

To highlight the bottom result:

=$B2=MIN($B$2:$B$41)

To highlight the bottom 5 results:

=$B2<=SMALL($B$2:$B$41,5)

The order of the rules is important. The rules at the top take precedence.

So, you need to drag the "Top" rule above the "Top 5" rule, because the top result is in both and you want the "Top" formatting to override the "Top 5" formatting.

In your Sheet:

Good work team!


If you enjoyed this newsletter, please forward it to a friend who might enjoy it.

Have a great week!

Cheers,
Ben

P.S. Enjoy this amazing spreadsheet rap song from reader Andrew!

Google Sheets Tips

Get better at working with Google Sheets! Join 50,000 readers to get an actionable tip in your inbox every Monday.

Read more from Google Sheets Tips

Brought to you by: Hi Reader, Welcome to the Google Sheets Tips newsletter #354, your Monday morning espresso, in spreadsheet form! In last week's newsletter we compared wide and tall data, and what the pros and cons of each data "shape" were. Today, I want to show you how to move from one format to the other. How to transform tall data into wide data and vice versa. Going in one direction is easy. Going back, in the other direction, is less so. Find out which way round below! ➜ News I. It's...

Brought to you by: Hi Reader, Welcome to the Google Sheets Tips newsletter #353, your Monday morning espresso, in spreadsheet form! Today we're looking at the shape of data. It's foundational concept that underpins pivot tables and charts in Google Sheets. Once you understand the difference between wide data (for charts) and tall data (for pivot tables), you'll be off to the races! This week is all about the pros and cons of each data shape. Next week, I'll show you how to use formulas and...

video preview

Brought to you by: Hi Reader, Welcome to the Google Sheets Tips newsletter #352, your Monday morning espresso, in spreadsheet form! If you're a parent, then you've undoubtedly watched a lifetime's worth of Disney movies. You can appreciate the genius storytelling, rich characters and beautiful visuals. (But I'm sure you'd also be content to watch a film once, not 10 times!) Anyway, there's a scene in the Disney film Ratatouille where Remy bites into a strawberry and a piece of cheese at the...