# Auto Category Sum

**URL:** https://community.tiller.com/t/auto-category-sum/466
**Category:** Google Sheets
**Tags:** how-to
**Created:** [September 19, 2019, 9:57pm UTC](https://community.tiller.com/t/auto-category-sum/466 "2019-09-19T21:57:55Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![treasurer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tiller.com/treasurer/32/542_2.png) [@treasurer](https://community.tiller.com/u/treasurer)
#### Post date: [September 19, 2019, 9:57pm UTC](https://community.tiller.com/t/auto-category-sum/466/1 "2019-09-19T21:57:55Z")

</div>

I want my dashboard to reflect each category sum automatically. How can I do this?

---

<div class="post-metadata">

### Author: ![jono](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tiller.com/jono/32/283_2.png) [@jono](https://community.tiller.com/u/jono)
#### Post date: [September 19, 2019, 10:06pm UTC](https://community.tiller.com/t/auto-category-sum/466/2 "2019-09-19T22:06:24Z")

</div>

Hi @treasurer,  
Here’s a quick formula you can use:  
`=QUERY(Transactions!D:E,"SELECT D,SUM(E) WHERE D IS NOT NULL GROUP BY D ORDER BY D LABEL SUM(E) 'Sum'")`

This assumes that your Categories are in Column D in the Transactions sheet and your Amounts are in Column E in the Transactions sheet.

If your columns are different, change the references to D and E to match your columns.

An English translation of that formula is:

> Use the QUERY function on the data in the Transaction sheet in columns D to E.  
> Then select the Categories in Column D and the Sum of the Amounts in Column E.  
> Do this only where D is not null, so uncategorized columns are not shown.  
> Then group the data by category.  
> Order the result by the Categories in Column D.  
> Finally label column SUM(E) with the word Sum.

Did that work for you?

---

<div class="post-metadata">

### Author: ![cogreg](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tiller.com/cogreg/32/7002_2.png) [@cogreg](https://community.tiller.com/u/cogreg)
#### Post date: [April 11, 2024, 3:48am UTC](https://community.tiller.com/t/auto-category-sum/466/3 "2024-04-11T03:48:59Z")

</div>

Where does one enter this formula?

---

<div class="post-metadata">

### Author: ![cogreg](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tiller.com/cogreg/32/7002_2.png) [@cogreg](https://community.tiller.com/u/cogreg)
#### Post date: [April 11, 2024, 4:12am UTC](https://community.tiller.com/t/auto-category-sum/466/4 "2024-04-11T04:12:13Z")

</div>

Where does one enter the formula?  
Thank you.

---

<div class="post-metadata">

### Author: ![jono](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tiller.com/jono/32/283_2.png) [@jono](https://community.tiller.com/u/jono)
#### Post date: [April 11, 2024, 4:52am UTC](https://community.tiller.com/t/auto-category-sum/466/5 "2024-04-11T04:52:03Z")

</div>

You could put this on a new sheet in the spreadsheet.  
Perhaps on a Dashboard sheet.

---

<div class="post-metadata">

### Author: ![cogreg](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tiller.com/cogreg/32/7002_2.png) [@cogreg](https://community.tiller.com/u/cogreg)
#### Post date: [April 11, 2024, 1:26pm UTC](https://community.tiller.com/t/auto-category-sum/466/6 "2024-04-11T13:26:43Z")

</div>

Thank you.  
How would I modify that formula to work only on a specified date range?  
For example, I’d like it to sum transactions by category only for the first quarter – 01 Jan. through 31 March.  
Thank you.

---

<div class="post-metadata">

### Author: ![jono](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tiller.com/jono/32/283_2.png) [@jono](https://community.tiller.com/u/jono)
#### Post date: [April 11, 2024, 5:26pm UTC](https://community.tiller.com/t/auto-category-sum/466/7 "2024-04-11T17:26:28Z")

</div>

Filtering by dates is certainly possible but it’s a little tricky.

Here’s a link to an article that explains it better than I can:

> **[Filtering With Dates In The QUERY Function -](https://www.benlcollins.com/spreadsheets/query-dates/)**
>
> Working with dates in the Query function in Google Sheets can be tricky. This tutorial shows you the correct syntax and examples.
