Sheets Tip 365: Analyze data by week with pivot tables


Brought to you by:


Hi Reader,

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

Fall is beautiful on the Eastern seaboard of the US right now. The colors near me are peaking in an explosion of reds, oranges, purples, and yellows:


➜ News

I.
More powerful pivot tables now available in Connected Sheets. Connected Sheets lets you use the Sheets interface to analyze BigQuery data (huge datasets with millions of rows).

Read more here >>

II.
Google hints at AI Advanced Services in Apps Script. Ooh, let's hope this prediction comes true!

Read more here >>


Brought to you by: Rows

Can You Outsmart an AI Spreadsheet?

Rows.com is an AI-powered spreadsheet that helps you load, analyze, and share data faster than ever. Its built-in AI Analyst can handle just about anything you throw at it… or can it?

This week Rows is challenging spreadsheet fans like you to find a prompt that Sheets or Excel can solve, but Rows can’t.

Prove it, share your results using #BreakTheAnalyst and tagging @rowshq, and you could win a $50 Amazon gift card.

The first 20 successful challengers win. Entries close November 8.


➜ Sheets Tip #365: Weeks in Pivot Tables

If you work with pivot tables a lot, you definitely want to be using the date grouping option. We featured this in tip 319 last year.

It lets you group dates by days, months, quarters, or years.

Weirdly though, the feature does not have a week grouping option.

I think it's possibly to do with the fact that some start their weeks on Sunday whilst some others start theirs on Monday.

So how can we fix this in a pivot table?

Since we can't do it directly in the pivot table, we need to add a column to our original data that calculates the week number of a given date.

If you start your weeks on a Sunday, use this WEEKNUM formula:

=WEEKNUM(A1)

For a Monday start, use this one:

=WEEKNUM(A1,2)

The extra argument "2" tells the formula to consider Monday as the first day of the week.

Our data looks like this with the additional column of week numbers (counting from the start of the year):

Back in our pivot table, we can use this new Weeknum column as our Rows setting:

The week numbers are counting up from the 1st week of the year. If you want a different week number (e.g. we want to show 1, 2, 3, 4 etc. instead of 36, 37, 38 etc.) subtract a fixed number from your WEEKNUM formula, e.g.

=WEEKNUM(A1,2) - 35

Have a great week!

Cheers,
Ben

P.S. The retirement equivalent of a mic drop.

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

Hi Reader, Welcome to the Google Sheets Tips newsletter #364, your Monday morning espresso, in spreadsheet form! Thanks to the hundreds of you who signed up for the Modern Google Sheets course last week. I'm excited to teach the workshops, which start next week. And thanks for your patience with the extra course promotion emails. We're now back to business as usual, with the once-a-week Google Sheets Tips newsletter. Lastly, Happy Halloween! It's a fun night here in our little town. Most of...

Hi Reader, Welcome to the Google Sheets Tips newsletter #363, your Monday Tuesday* morning espresso, in spreadsheet form! (* arriving in your inbox on a Tuesday, because it was Columbus Day in the US yesterday.) Almost two years ago, I launched a course called "The AI Playbook for Google Sheets", which explored how to use basic AI inside Sheets. (Fun fact: this was my last course launch!) A lot has changed since then! Today, Gemini and other AI tools can manipulate data, generate formulas,...

Brought to you by: Hi Reader, Welcome to the Google Sheets Tips newsletter #362, your Monday morning espresso, in spreadsheet form! Last week I finished recording and editing all the video lessons for the new Modern Google Sheets course (woohoo!). I keep track of progress in a Google Sheet (where else of course!) using Tables and dropdown chips: (click to enlarge) I'm using Tables extensively now in my Sheets work. I find the benefits over plain data—such as the dropdown chips, table...