profile

Google Sheets Tips

A case of the Mondays

Published 3 months ago • 2 min read


Hi Reader,

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

Coming to you on a Tuesday, because yesterday was Presidents' Day here in the US.

Oh, the quiet irony of making Monday the subject of a newsletter I send on Mondays... only for it to fall on a week that I send the newsletter on a Tuesday instead.

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

UNITO

Automatically Collect Your Marketing Data in Google Sheets

Tired of pulling numbers one platform at a time? Use Unito to import the metrics you need from Google Analytics, Google Ads, Facebook Ads, and more into Google Sheets. We’ll keep your data fresh in real-time, so you can ditch the repetitive data work.

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

Check out my newest video tutorials on YouTube:

🎥 How To Create Formula Pie Charts in Google Sheets

And here's the accompanying blog post:

Formula Pie Charts in Google Sheets

If you enjoy these videos, please consider subscribing so I can continue to make more free tutorials in the future :)

_______

➜ News

I.
Google is bringing an improved comment experience to Sheets soon.

Sort, filter, and manage comments faster in Sheets

_______

➜ Google Sheets Tip #291: Counting all Mondays between two dates

Today's tip comes from a question from Łukasz W. (thank you!).

He wanted to create an automatic way to count how many Mondays fell between two dates.

The NETWORKDAYS.INTL function counts the number of working days between a start date and an end date, excluding weekends and holidays.

There's a lot of customization possible with this function but what we're going to use today is the option to set a custom "weekend".

If we specify Monday as the only workday and set Tuesday to Sunday as the "weekend", then we can count the number of Mondays between 2 dates.

We add a third argument to the function: a string with 7 digits, consisting of 0's and 1's.

The 0s represent workdays (which are included in the count) and the 1s represent "weekends" (excluded). The first digit represents Monday and the last represents Sunday.

Let's assume our start date is in cell A2 and our end date is in cell B2.

Thus, our formula to count the Mondays is:

=NETWORKDAYS.INTL(A2,B2,"0111111")

In our Sheet, it looks like this:

It gives an answer of 4, which is indeed how many Mondays there are in February 2024.

What if I want to count Thursdays?

To do this, we need the code: 1110111

The 0, which is our "workday" that we count, is in the 5th position, i.e. represents Thursday.

Our formula becomes:

=NETWORKDAYS.INTL(A3,B3,"1110111")

In our Sheet:

And this time the answer is 5 Thursdays in February.

Other combinations

Of course, we can have more than one day in our count.

This formula will count Wednesdays and Sundays:

=NETWORKDAYS.INTL(A4,B4,"1101110")

See if you can spot how we set up the code inside the formula.

And here's how it looks in our Sheet:

Nice!

I love it when there's a dedicated formula that solves the problem.

Originally, I solved this with a complex REDUCE formula, but I knew there were a bunch of Date functions that I rarely use. So, don't forget to search the Google Sheets function list sometimes to check what you're missing!

_______

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

Have a great week!

Cheers,
Ben

P.S. The coolest iceberg picture (no pun intended).

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

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