sumifs dynamic critiria

rossking

New Member
Joined
Jan 5, 2018
Messages
2
So i have a drop down (B2) that is fed from COL 1 of the Help table

Depending on Which is selected my SumIfs either has no criteria (All the whole dataset), Region (Use Col 1 of the data Table and only add matches) Region-District (Use COL 1 & COL 2)

Col M = Sales

A dynamic Criteria based on the Vlookup return

Is there a simpler way than this

=IF(B2="ALL",SUMIFS('Customer Data'!M:M),IF(VLOOKUP(B2,Help!A:C,3,FALSE)="",SUMIFS('Customer Data'!M:M,'Customer Data'!B:B,VLOOKUP(B2,Help!A:C,2,FALSE)),SUMIFS('Customer Data'!M:M,'Customer Data'!B:B,VLOOKUP(B2,Help!A:C,2,FALSE),'Customer Data'!C:C,VLOOKUP(B2,Help!A:C,3,FALSE))))


HELP Table

[TABLE="width: 192"]
<colgroup><col width="64" span="3" style="width:48pt"> </colgroup><tbody>[TR]
[TD="width: 64"]Region[/TD]
[TD="width: 64"]REG[/TD]
[TD="width: 64"]DIST[/TD]
[/TR]
[TR]
[TD]ALL[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]CA-ALL[/TD]
[TD]CA[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]CA-CAD[/TD]
[TD]CA[/TD]
[TD]CAD[/TD]
[/TR]
[TR]
[TD]CA-CCD[/TD]
[TD]CA[/TD]
[TD]CCD[/TD]
[/TR]
[TR]
[TD]WW[/TD]
[TD]WW[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]NM-ALL[/TD]
[TD]NM[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]NM-EWD[/TD]
[TD]NM[/TD]
[TD]EWD[/TD]
[/TR]
[TR]
[TD]NM-NMD[/TD]
[TD]NM[/TD]
[TD]NMD[/TD]
[/TR]
[TR]
[TD]IM[/TD]
[TD]IM[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]PC[/TD]
[TD]PC[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

[TABLE="width: 93"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]Reg[/TD]
[TD]Dist[/TD]
[/TR]
[TR]
[TD]CA[/TD]
[TD]CAD[/TD]
[/TR]
[TR]
[TD]CA[/TD]
[TD]CAD[/TD]
[/TR]
[TR]
[TD]CA[/TD]
[TD]CAD[/TD]
[/TR]
[TR]
[TD]CA[/TD]
[TD]CAD[/TD]
[/TR]
[TR]
[TD]CA[/TD]
[TD]CAD[/TD]
[/TR]
[TR]
[TD]CA[/TD]
[TD]CAD[/TD]
[/TR]
[TR]
[TD]CA[/TD]
[TD]CAD[/TD]
[/TR]
</tbody>[/TABLE]
 

Forum statistics

Threads
1,226,849
Messages
6,193,330
Members
453,790
Latest member
yassinosnoo1

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