Hey guys,
I'm facing a rather tricky issue:
I have two data sheets and one output sheet.
Sheet 1:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Customer-ID[/TD]
[TD]Entry Date[/TD]
[TD]Exit Date[/TD]
[TD]Match-ID[/TD]
[/TR]
[TR]
[TD]123[/TD]
[TD]01. January 2016[/TD]
[TD]06. May 2016[/TD]
[TD]333[/TD]
[/TR]
[TR]
[TD]234[/TD]
[TD]15. April 2014[/TD]
[TD]23. December 2015[/TD]
[TD]444[/TD]
[/TR]
[TR]
[TD]...[/TD]
[TD]...[/TD]
[TD]...[/TD]
[TD]...[/TD]
[/TR]
</tbody>[/TABLE]
Sheet 2:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Customer-ID[/TD]
[TD]Spending 2016[/TD]
[TD]Spending 2015[/TD]
[TD]Spending ...[/TD]
[/TR]
[TR]
[TD]333[/TD]
[TD]5.000,00[/TD]
[TD]4.000,00[/TD]
[TD]...[/TD]
[/TR]
[TR]
[TD]444[/TD]
[TD]2.000,00[/TD]
[TD]3.000,00[/TD]
[TD]...[/TD]
[/TR]
[TR]
[TD]...[/TD]
[TD]...[/TD]
[TD]...[/TD]
[TD]...[/TD]
[/TR]
</tbody>[/TABLE]
Now to the problem at hand.
I need a formula for that allows me to sum up the spending of the customers from sheet 2 based on two criteria:
a) Their IDs have to be mentioned as "Match-IDs" in sheet 1.
b) The matched customer from sheet 1 has to have been a customer in the respective year (i. e. when summing up 2016 values, only sum those where the respective matching customer has an entry date < 31. Dec 2016 and an exit date > 01. Jan 2016.
Output Sheet:
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]2016[/TD]
[TD]2015[/TD]
[TD]...[/TD]
[/TR]
[TR]
[TD]Match-Spending[/TD]
[TD]5.000,00[/TD]
[TD]3.000,00[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I suspect that this is somehow solvable either by a combination of SUMIFS and INDEX MATCH ...
Any help would be greatly appreciated!
Cheers
I'm facing a rather tricky issue:
I have two data sheets and one output sheet.
Sheet 1:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Customer-ID[/TD]
[TD]Entry Date[/TD]
[TD]Exit Date[/TD]
[TD]Match-ID[/TD]
[/TR]
[TR]
[TD]123[/TD]
[TD]01. January 2016[/TD]
[TD]06. May 2016[/TD]
[TD]333[/TD]
[/TR]
[TR]
[TD]234[/TD]
[TD]15. April 2014[/TD]
[TD]23. December 2015[/TD]
[TD]444[/TD]
[/TR]
[TR]
[TD]...[/TD]
[TD]...[/TD]
[TD]...[/TD]
[TD]...[/TD]
[/TR]
</tbody>[/TABLE]
Sheet 2:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Customer-ID[/TD]
[TD]Spending 2016[/TD]
[TD]Spending 2015[/TD]
[TD]Spending ...[/TD]
[/TR]
[TR]
[TD]333[/TD]
[TD]5.000,00[/TD]
[TD]4.000,00[/TD]
[TD]...[/TD]
[/TR]
[TR]
[TD]444[/TD]
[TD]2.000,00[/TD]
[TD]3.000,00[/TD]
[TD]...[/TD]
[/TR]
[TR]
[TD]...[/TD]
[TD]...[/TD]
[TD]...[/TD]
[TD]...[/TD]
[/TR]
</tbody>[/TABLE]
Now to the problem at hand.
I need a formula for that allows me to sum up the spending of the customers from sheet 2 based on two criteria:
a) Their IDs have to be mentioned as "Match-IDs" in sheet 1.
b) The matched customer from sheet 1 has to have been a customer in the respective year (i. e. when summing up 2016 values, only sum those where the respective matching customer has an entry date < 31. Dec 2016 and an exit date > 01. Jan 2016.
Output Sheet:
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]2016[/TD]
[TD]2015[/TD]
[TD]...[/TD]
[/TR]
[TR]
[TD]Match-Spending[/TD]
[TD]5.000,00[/TD]
[TD]3.000,00[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I suspect that this is somehow solvable either by a combination of SUMIFS and INDEX MATCH ...
Any help would be greatly appreciated!
Cheers