Search code examples
google-sheetssumgoogle-sheets-formulagoogle-sheets-querygoogle-query-language

How can I add how much I spent in each category this month?


Im trying to track all of my expenses for this month. Im using Google Sheets and just as a small project I want to make it as automated as possible. Eventually I would want to just input the cost and category, and at the end of the month see how much I spent in each category.

So far I have been able to make a dropdown list of possible categories, but now I'm trying to add up how much I spent in each category.

I want to do this by searching for a specific string in the "category" column, and have it make a list containing each row where that string was found. Then in the column where I input the price of the things I bought, go through each element in the list and return the sum of all the cells.

I tried looking at the google sheets help pages for useful functions, but I couldnt find anything.

I really appreciate any help.


Solution

  • try:

    =QUERY(Spendings!B2:D, "select D,sum(B) where D is not null group by D label sum(B)''")
    

    0