SUMPRODUCT - SUMIF - MULTIPLE TABLES; To Get Results From Single Criteria

MixedUpExcel

Board Regular
Joined
Apr 7, 2015
Messages
222
Office Version
  1. 365
Platform
  1. Windows
Hi,

I can get so far with my formula but not sure how to finish it off. Please help.

I have 4 tables, Table 2 / 3 and 4 have data - the first table has the initial criteria and the formula next to it to bring back the result.

BCDEFGHiJKL
2TABLE 1TABLE 2
3 JAN
4N. England - Sales N. England - SalesNorthern England
5N. England - Margin N. England - MarginNorthern England
6Central England - Sales Central England - SalesCentral England
7Central England - Margin Central England - MarginCentral England
8Scotland & N. Ireland - Sales Scotland & N. Ireland - SalesScotland & Northern Ireland
9Scotland & N. Ireland - Margin Scotland & N. Ireland - MarginScotland & Northern Ireland
10S. East England - Sales S. East England - SalesSouth East England
11S. East England - Margin S. East England - MarginSouth East England
12S. W. England & Wales - Sales S. W. England & Wales - SalesSouth West England & Wales
13S. W. England & Wales - Margin S. W. England & Wales - MarginSouth West England & Wales
14
15TABLE 4TABLE 3
16Paul10Northern EnglandPaul
17Mark20Northern EnglandMark
18James30Northern EnglandJames
19Peter40Northern EnglandPeter
20Craig50Northern EnglandCraig
21Andrea60Central EnglandAndrea
22Claire70Central EnglandClaire
23Donna80Scotland & Northern IrelandDonna
24Amanda90South East EnglandAmanda
25Rick100South East EnglandRick
26Julie110South East EnglandJulie
27Kate120South West England & WalesKate
28Lisa130South West England & WalesLisa
29
30First Example
31N. England - SalesResult150
32150=SUMPRODUCT(SUMIF($B$16:$B$28,IF($F$16:$F$28=B33,$G$16:$G$28),$C$16:$C$28))
33Northern England
34
35Paul10
36Mark20
37James30
38Peter40
39Craig50
40

<colgroup><col><col><col span="3"><col><col><col span="5"></colgroup><tbody>
</tbody>

In Cell C4, I want to put the formula which looks for 'N. England - Sales' in Table 2. This will result in 'Northern England' as the next criteria. Using 'Northern England' in Table 3, I will get Paul / Mark / James / Peter / Craig as the next criteria. Using those 5 criteria in Table 4, it will sum up 10 / 20 / 30 / 40 / 50 and give me a result of 150 in Cell C4.

The following formula only uses 3 of the tables, I can't work out how to put the final step into it.

Code:
=SUMPRODUCT(SUMIF($B$16:$B$28,IF($F$16:$F$28=B33,$G$16:$G$28),$C$16:$C$28))

Instead of using B33 in the formula, I would like to use Table 2 to get this part of the formula.

How do I do this please? Please stick with SUMPRODUCT as the base formula as I may need to 'tweak' it a little in the future.

Thanks in advance for any help.

Simon
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
try replace B33 with VLOOKUP(B4,$F$4:$G$13,2,0)

Code:
=SUMPRODUCT(SUMIF($B$16:$B$28,IF($F$16:$F$28=[COLOR="#B22222"]VLOOKUP(B4,$F$4:$G$13,2,0)[/COLOR],$G$16:$G$28),$C$16:$C$28))
 
Upvote 0
Thanks AlanY.

Not what I expected but a simple solution that I wish I'd though of :)

Thanks for the quick response. That appears to do the job.

Thanks again.

Simon
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

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