profile

Google Sheets Tips

Unveiling the Extremes in Your Data

Published 3 months ago • 2 min read


Hi Reader,

Welcome to the Google Sheets Tips newsletter #292, your Monday morning espresso, in spreadsheet form!

Quick question before this week's email:

If you use Apps Script, what do you use it for? Follow up, what pain points do you have?

(Feel free to just hit reply to this email.)

A big thank you to this week's sponsors who help keep this newsletter free to read:

OCTOBOARD GOOGLE SHEETS DATA EXPORT

Send all your PPC data to Google Sheets for free

Tired of paying hundreds of dollars for data export to Google Sheets? Try our free Google Sheets plug-in.

BUDGETSHEET

Import Bank Transactions Automatically

The easiest way to import bank transactions into Google Sheets. No more manual exports or copying & pasting from CSV files. Just your live bank data in your spreadsheets, auto-categorized and formatted exactly how you like it. Trusted by thousands of happy customers.

➜ New videos on YouTube

🎥 Count Specific Days Between Two Dates in Google Sheets

(inspired by last week's newsletter on counting Mondays)

_______

➜ Google Sheets Tip #292: Finding minimum and maximum names from values

Suppose we have this dataset:

We want to identify the customers with the minimum and maximum revenues. There are many ways to do this, including pivot tables, sorting the data, formulas, etc.

Today, we'll use the powerful FILTER function to find the min/max customers.

First, find the minimum revenue value with this MIN formula:

=MIN(B2:B11)

With the data shown above, this gives us the result of $1,260.

Now, we want to find the customers associated with this value. To do that, let's use the FILTER function.

The filter formula returns values that satisfy specific conditions. It takes two arguments, firstly a range to filter and secondly, the conditions to apply.

We want to find the customer names for the minimum values, i.e. we want to filter the names. So the first argument in the FILTER is the customer names range in A2:A11.

The second argument of our FILTER — the conditions to test — is a test to find when the revenue values (B2:B11) are equal to the minimum value.

We already found the minimum with the MIN formula above.

Hence, our complete formula is:

=FILTER(A2:A11,B2:B11=MIN(B2:B11))

In our Sheet:

I like the FILTER function because it returns more than one result if there are multiple customers with the minimum value.

Find the Top Customer(s) with MAX

To calculate the top customer, swap the MIN function for a MAX function in the formula.

Neater with Named Ranges

Do you use named ranges?

They're a method for attaching names to cell ranges in your Sheets. Then, instead of referring to a range as B2:B11 in your formulas, you can use the name, e.g. revenue.

To create a named range, highlight our data (e.g. B2:B11) and go to the menu: Data > Named ranges

Enter a name in the name box and click Done.

Now we can use this named range inside our formulas and it points to the correct range. For example, the MIN formula above becomes:

=MIN(revenue)

Which, in our Sheet, looks like this:

If we name the range A2:A11 as customers, then our complete FILTER formula becomes even cleaner:

=FILTER(customers,revenue=MIN(revenue))

In our Sheet:

_______

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

Have a great week!

Cheers,
Ben

P.S. Anyone else do this?

Google Sheets Tips

by Ben Collins

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

Hi Reader, Greetings from sunny Harpers Ferry! ☀️ The rain has stopped (until tomorrow at least!) and I'm finally feeling better so I'm optimistic for the week ahead! Welcome to this issue of the Google Sheets Tips newsletter, #303, your Monday morning espresso, in spreadsheet form! Wow, that's a lot of exclamation points in the first few sentences! Oops, that was another. It's the optimism I feel today ;) Today I want to share a data visualization technique for showing change between two...

1 day ago • 3 min read

Hi Reader, Welcome to the Google Sheets Tips newsletter #302, your Monday morning espresso, in spreadsheet form! I'm sick at the moment, battling a nasty sinus infection. I'm not a good patient because I'm too impatient. There are so many things to do! But I'm wiser now than a decade ago and realize that rest comes first. At least I wrote this week's newsletter before getting sick. And I think it's an interesting newsletter. But it's one that might divide opinion. Purists will dislike it...

8 days ago • 3 min read

Hi Reader, Welcome to the Google Sheets Tips newsletter #301, your Monday morning espresso, in spreadsheet form. Earlier this year I sat down to record a new course but progress stalled before I got far. I've been creating courses for 7 years and realized that I need to freshen things up. One change I want to make is to inject more meaning into my work. I'm deeply interested in our natural world and protecting it for future generations. I want to use the skills I have and apply them towards...

15 days ago • 3 min read
Share this post