Summing up values based on multiple criterias and including lookups across multiple sheets

phiman13

New Member
Joined
Jun 1, 2018
Messages
2
Hey guys,

I'm facing a rather tricky issue:

I have two data sheets and one output sheet.

Sheet 1:
Customer-IDEntry DateExit DateMatch-ID
12301. January 201606. May 2016333
23415. April 201423. December 2015444
............

<tbody>
</tbody>

Sheet 2:
Customer-IDSpending 2016Spending 2015Spending ...
3335.000,004.000,00...
4442.000,003.000,00...
............

<tbody>
</tbody>

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:
20162015...
Match-Spending5.000,003.000,00

<tbody>
</tbody>

I suspect that this is somehow solvable either by a combination of SUMIFS and INDEX MATCH ...

Any help would be greatly appreciated!

Cheers
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Try:

ABC
1Match-Spending20162015
250003000

<colgroup><col style="width: 25pxpx"><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet3

Worksheet Formulas
CellFormula
B2=SUMPRODUCT(Sheet2!B2:B10,--(COUNTIFS(Sheet1!$D$2:$D$20,Sheet2!$A$2:$A10,Sheet1!$B$2:$B$20,"<="&DATE(B1,12,31),Sheet1!$C$2:$C$20,">="&DATE(B1,1,1))>0))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

Based on how your dates and numbers are formatted, you may need to change all the commas in this formula to semicolons, to allow for the regional differences.
 
Upvote 0

Forum statistics

Threads
1,215,375
Messages
6,124,576
Members
449,173
Latest member
Kon123

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top