This Google Sheets tutorial details two methods to count transactions by day of the week. We’ll explore the versatility of the QUERY function and delve into the power of Pivot Tables to create these summaries. Let’s get started!
Make a copy of this live Google Sheet to follow along. Adjust the directions accordingly when using your data.
Contents
Desired Outcome
First, let’s define our goal. We want to find totals for each day of the week from a list of transactions on multiple days. The output will be a list of each day next to its corresponding total.

Now, let’s start with the first solution. If you don’t want a formula, this will be the one for you.
Example 1 – Pivot Table with Date Grouping
This first example will use the built-in date grouping feature for pivot tables in Google Sheets. This feature will do most of the work for you, eliminating the need for formulas.
Pivot tables summarize large amounts of data using menus instead of formulas. See this YouTube video for a primer on pivot tables if you are unfamiliar with them.

With the example sheet open, go to the Insert menu and choose Pivot table. Specify A1:C1001 as the data range.
Press OK once you have the correct data range.
Then Google Sheets will ask where you want the Pivot table.
We’ll place it on the Existing sheet in cell E2. Click Create after choosing the location.


Clicking the Create button brings up the Pivot table editor in the sidebar. In the editor, we’ll drag and drop the Manufacture Date field into the Rows and the Price field into the Values.
Change the Summarize by drop-down from SUM to COUNT. COUNT works since you’re counting a field with dates. If you were counting text, consider using COUNTA.
Then, right-click on the dates, choose Create pivot date group, and select Day of the week.

Now, you have a finished pivot table with the amounts counted by day of the week.

As you can see, pivot tables do much of the work without code. However, the query function is the best fit if you want to use a formula. Let’s look at that now.
Example 2 – Query Function
The query function is in a class of its own compared to traditional spreadsheet functions. It allows the spreadsheet user to write SQL commands inside the formula. We’ll use query to get daily counts, just as we did above, but with a formula. Let’s take a look at the query syntax.
Query Function Syntax
=QUERY(data, query, [headers])
data– Location of the dataquery– The query statement. The query is composed of optional clauses that you must use in order.select– The columns to return. If omitted, the query returns all columns.where– Conditions that rows must meet- group by – Aggregates values
pivot– Aggregates values into new columnsorder by– Sorts rows by valueslimit– Limits the number of rows returnedoffset– Skips a specified number of rowslabel– Creates column labelsformat– Formats outputsoptions– Sets additional options
[headers]– The number of header rows at the top of thedata
Writing the Query
Now that we know the syntax, let’s write out the formula. We will still use A1:C1001 as the range and there’s one header row. So, we know the values for the data and headers arguments. Here is what we have so far:
=QUERY(A1:C1001, query, 1)
For the query, we want to return a column for the day of the week and a column for the counts. SQL has a scalar function called dayOfWeek and an aggregation function called count. We’ll use both of those. We’ll then use the group by clause to tell the function how to show the output, and we’ll add headers using the label clause. To polish it off, we’ll use the format clause to change the day numbers to words and the numbers to show no decimal places but have a thousands separator if needed. This is what the formula looks like now:
=QUERY(A1:C1001, "select dayOfWeek(Col2), count(Col3) group by dayOfWeek(Col2) label dayOfWeek(Col2)'Day',count(Col3)'Count' format dayOfWeek(Col2)'dddd',count(Col3)'#,##0'", 1)

💡Unlike the native spreadsheet COUNT function, the count inside a QUERY counts text and numbers.
The long formula creates this simple, compact table of just the data you need, sorted by day of the week!
Video Tutorial
Conclusion
Google Sheets has two great options for counting data by day of the week. Choose the pivot table for ease of use and the query function for the power of a formula written in SQL. Whichever technique you use, you’ll get the answer you’re looking for.
Related Tutorials
-
Count Amounts by Day of the Week in Google Sheets
Learn how to count transactions by day of the week and return a table with the day names and their corresponding counts.
-
Sum Amounts for Each Day of the Week in Google Sheets
Learn two techniques to sum values by day of the week.
-
Conditionally Count Unique Values in Google Sheets
Three techniques to count unique values based on specified criteria.
