1

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...

l

5

I tried something like:

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

or:

=IF(MONTH(B16)=1, 
 IF(C16="Food",+D16))+
 IF(MONTH(B17)=1, 
 IF(C16="Food",+D17))

or even:

=IF(ISBLANK(D2);"";SUM(FILTER($B$2:B;$A$2:A=D2)))

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 Jan 27 at 2:02
  • The link is above. Thanks – Bruno Jan 27 at 2:15
0
  • paste this into C3 and drag down:
    =IFERROR(QUERY(Daily!$B:$D, 
     "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...

    0

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

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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