Hi Reader,
Welcome to the Google Sheets Tips newsletter #204!
I. The QUERY Function Course
In case you missed the announcement earlier today, my newest course is now open for enrollment! Find out more:
The QUERY Function in Google Sheets
(Enjoy 50% off this week, until Friday at midnight EDT.)
_______
Here is your Google Sheets tip, which you can think of as your Monday morning espresso, in spreadsheet form.
Working with dates in the QUERY function is tricky.
With today's tip, I want to show you how to reference dates correctly in the QUERY function.
If you simply drop a date into your QUERY function, for example as a condition in the WHERE filter, it won't return the data you're looking for.
This formula does NOT return any data:
=QUERY( A1:E100 , "select * where B > '5/16/2022' ")The QUERY function needs dates in the ISO format, which is "YYYY-MM-DD".
That's a 4-digit year, a dash, two digits for the month, a dash, and finally, two digits for the day.
For example, today's date is written 2022-05-16.
Putting that into the formula looks like this:
=QUERY( A1:E100 , "select * where B > '2022-05-16' ")Unfortunately, it still doesn't return any results. Hmm, there's one more thing we need to do...
The last piece of the puzzle is to add the "date" keyword before the date in your filter condition, like this:
=QUERY( A1:E100 , "select * where B > date '2022-05-16' ")Woohoo!
Now the QUERY function will parse the data correctly and return all data after today's date.
Read more about filtering dates with the QUERY function.
Or, dive deep into the QUERY function (including dates!) in my new course:
The QUERY Function in Google Sheets
_______
If you enjoyed this newsletter, please forward it to a friend who might enjoy it.
Have a great week!
Cheers,
Ben
Get better at working with Google Sheets! Join 50,000 readers to get an actionable tip in your inbox every Monday.
Hi Reader, Welcome to the Google Sheets Tips newsletter #390, your Monday Tuesday* morning espresso, in spreadsheet form! * public holiday in the US yesterday. Speaking of coffee, I usually work from my local coffee shop twice a week. It makes for a nice change of scenery from home. And everytime I order the same thing: a regular cappuccino, no frills, no syrups, no fancy milks. I think it says a lot about my personality and stage in life. As a working parent, neck deep in the world of AI,...
Brought to you by: Hi Reader, Welcome to the Google Sheets Tips newsletter #389, your Monday morning espresso, in spreadsheet form! After a major work sprint to launch the 28 Days to Gemini Mastery course earlier this spring, I recently took a few weeks off to visit my brother and his family in Australia. We spent time hiking and packrafting in Tasmania's remote and beautiful Southwest National Park. It was an incredible trip and, without cell service for 12 days, a true break from the noise...
Hi Reader, Welcome to the Google Sheets Tips newsletter #388, your Monday morning espresso, in spreadsheet form! ➜ Sheets Tip #388: Merged Cells To many power users who live in spreadsheets, merged cells are often treated like a patch of poison ivy on a hiking trail. They see them, turn their nose up, and steer well clear. But are they always the villain? Let's find out. Why Purists Cringe At Merged Cells In a structured dataset or a table, merged cells are, quite frankly, a nightmare. They...