Hi. I'm trying to get full control over my expenses. I want to be able to view expenditures depending on year, month(s) and type of expense.
This is a simplification of my data:
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]04.01.2013
[/TD]
[TD]340
[/TD]
[TD]Transportation
[/TD]
[TD]All
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]10.02.2014
[/TD]
[TD]460
[/TD]
[TD]House
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]23.02.2014
[/TD]
[TD]200
[/TD]
[TD]Food
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]17.03.2013
[/TD]
[TD]340
[/TD]
[TD]Power
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD]24.03.2014
[/TD]
[TD]500
[/TD]
[TD]House
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6
[/TD]
[TD]24.03.2014
[/TD]
[TD]25
[/TD]
[TD]Transportation
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7
[/TD]
[TD]01.07.2014
[/TD]
[TD]123
[/TD]
[TD]Food
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8
[/TD]
[TD]21.08.2013
[/TD]
[TD]320
[/TD]
[TD]Cloths
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]9
[/TD]
[TD]25.08.2014
[/TD]
[TD]105
[/TD]
[TD]Transportation
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]10
[/TD]
[TD]28.08.2014
[/TD]
[TD]150
[/TD]
[TD]Power
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Input field:
D1. Month values: All, 1-12
MONTH function can only use 1 to 12 for January to December, but I would like to also select the sum of the whole year. So this is what I've come up with so far.
=IF(D1="All";(SUMPRODUCT((YEAR(A1:A10)=2014)*(B1:B10)));(SUMPRODUCT((YEAR(A1:A10)=2014)*(MONTH(A1:A10)=D1)*( B1:B10))))
This gives me the sum (1563) for the whole year of 2014. It also gives me value for individual months if needed. But I have left out the Expense type here. So, I tried to add this.
=IF(D1="All";SUMPRODUCT((YEAR(A1:A10)=2014)*(SUMIF(C1:C10;"Power";B1:B0)));(SUMPRODUCT((YEAR(A1:A10)=2014)*(MONTH(A1:A10)=D1)*( B1:B10))))
This gives me the value of 3430. Instead of adding the numbers, it seems like there is some multiplication going on here. It should give me the value 150. Preferably.
I could of-course add two sheets. One for the whole year, and one for individual months. But I would very much like to have just one sheet for the whole thing. My head is spinning. Hopefully some of you have some suggestions on how to handle this.
Thanks!
This is a simplification of my data:
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]04.01.2013
[/TD]
[TD]340
[/TD]
[TD]Transportation
[/TD]
[TD]All
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]10.02.2014
[/TD]
[TD]460
[/TD]
[TD]House
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]23.02.2014
[/TD]
[TD]200
[/TD]
[TD]Food
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]17.03.2013
[/TD]
[TD]340
[/TD]
[TD]Power
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD]24.03.2014
[/TD]
[TD]500
[/TD]
[TD]House
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6
[/TD]
[TD]24.03.2014
[/TD]
[TD]25
[/TD]
[TD]Transportation
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7
[/TD]
[TD]01.07.2014
[/TD]
[TD]123
[/TD]
[TD]Food
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8
[/TD]
[TD]21.08.2013
[/TD]
[TD]320
[/TD]
[TD]Cloths
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]9
[/TD]
[TD]25.08.2014
[/TD]
[TD]105
[/TD]
[TD]Transportation
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]10
[/TD]
[TD]28.08.2014
[/TD]
[TD]150
[/TD]
[TD]Power
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Input field:
D1. Month values: All, 1-12
MONTH function can only use 1 to 12 for January to December, but I would like to also select the sum of the whole year. So this is what I've come up with so far.
=IF(D1="All";(SUMPRODUCT((YEAR(A1:A10)=2014)*(B1:B10)));(SUMPRODUCT((YEAR(A1:A10)=2014)*(MONTH(A1:A10)=D1)*( B1:B10))))
This gives me the sum (1563) for the whole year of 2014. It also gives me value for individual months if needed. But I have left out the Expense type here. So, I tried to add this.
=IF(D1="All";SUMPRODUCT((YEAR(A1:A10)=2014)*(SUMIF(C1:C10;"Power";B1:B0)));(SUMPRODUCT((YEAR(A1:A10)=2014)*(MONTH(A1:A10)=D1)*( B1:B10))))
This gives me the value of 3430. Instead of adding the numbers, it seems like there is some multiplication going on here. It should give me the value 150. Preferably.
I could of-course add two sheets. One for the whole year, and one for individual months. But I would very much like to have just one sheet for the whole thing. My head is spinning. Hopefully some of you have some suggestions on how to handle this.
Thanks!