profile

Google Sheets Tips

Sheets Tip 297: Threshold Value Formulas

Published about 1 month ago • 1 min read


Hi Reader,

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

Coming to your inbox on a Tuesday this week because many folks have a long weekend for Easter.

In the mountains near where I live, the Virginia Bluebells are in full bloom and the trails are beautiful!

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

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.

SHORTFORM

The Smart Way to Read More

With Shortform you get deep insights that go beyond the typical 1-pager, with chapter breakdowns, well-researched commentary and analysis, connections to other books and counter-arguments, and interactive exercises. Instead of spending days on a single book, use that time to master entire subjects in tech, business, self-improvement, and more.

➜ News

I.
This is an entertaining read on what happens when you challenge Gemini (Google's AI tool) to a game of battleship in Google Sheets!

Of course, the author (Dmitry Kostyuk) had to first create the Battleships game in his Sheet. The post runs through how he constructed the game and includes his code.

Battleship in Sheets >>

_______

➜ Google Sheets Tip #297: Threshold Value Formulas

Suppose we have a set of values to cap at a certain threshold level. I.e. everything above the threshold value, e.g. 100, gets set to that value. We're saying that the specific value doesn't matter beyond this threshold.

Perhaps, we would approach this by writing an IF formula. We could check whether the value is above 100 and then set it to 100 if TRUE, or the actual value if FALSE, like so:

=IF(A2>100,100,A2)

But, there is a shorter way!

We can replace the whole IF function with a more succinct MIN function.

=MIN(100,A2)

MIN outputs the smallest value between 100 and the actual value. So, if the actual value is larger than 100, the result is the threshold value of 100.

Similarly, we can use a MAX function to replace IF statements when we're looking at a threshold on the low side.

For example, suppose we're not interested in small values below a threshold, e.g. 10. This time we could use this MAX function:

=MAX(A2,10)

Writing efficient formulas is good practice. Not only is it quicker, but they're often easier to understand.

_______

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

Have a great week!

Cheers,
Ben

P.S. Chances that a cow steals your shoes are slim, but never zero

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...

about 9 hours 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...

7 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...

14 days ago • 3 min read
Share this post