So I have this table where I'm writing down my daily expenses. On one cell I choose the date, the next cell I choose the category and in the third, I insert the amount of money spent. On another sheet I have another table where I want to add the values that have the same months and categories in common:

One cell for "Food" in "January", another for "travel" in "January" then on another table "Food" in "February" and so on...



I tried something like:

=LOOKUP("Food",$E$16:$E$18,$D$16:$D$18 )



or even:


and so on...

But none of this is working as I want.

Does anyone have any idea about how to go about doing this?

My file: https://docs.google.com/spreadsheets/d/13R6xUhZCX-wjOPXfpiZYOgsN18oLo8QTuYJ2H4mqqos/edit?usp=sharing

  • Bruno, you're going to want QUERY or FILTER. It's easy enough to set up, but currently, you haven't given enough information. It's always best to share a link to your sheet (or a copy of your sheet), being sure to set permissions to "Anyone with the link can Edit" (not just "... can View"). That way, we can see and access all of the information you can see and access, and most efficiently write a formula solution for you.
    – Erik Tyler
    Commented Jan 27, 2019 at 2:02
  • docs.google.com/spreadsheets/d/…
    – Bruno
    Commented Jan 27, 2019 at 2:13
  • The link is above. Thanks
    – Bruno
    Commented Jan 27, 2019 at 2:15

1 Answer 1

  • paste this into C3 and drag down:
     "select sum(D) 
      where C = '"&B4&"' and month(B) + 1 matches '"&MONTH(B$3&1)&"' 
      group by C
      label sum(D)''", 0), 0)
  • then copy cell C3 and paste it in G3 and drag down...


  • 1
    Thank you Mark. That's exactly what I wanted! Much appreciated. :)
    – Bruno
    Commented Jan 27, 2019 at 22:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.