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

RegionREGDIST
ALL
CA-ALLCA
CA-CADCACAD
CA-CCDCACCD
WWWW
NM-ALLNM
NM-EWDNMEWD
NM-NMDNMNMD
IMIM
PCPC

<colgroup><col width="64" span="3" style="width:48pt"> </colgroup><tbody>
</tbody>

RegDist
CACAD
CACAD
CACAD
CACAD
CACAD
CACAD
CACAD

<colgroup><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
What are the values B2 can show besides ALL? Region and Region-District do not show in your HELP Table...
 
Upvote 0

Forum statistics

Threads
1,214,912
Messages
6,122,204
Members
449,072
Latest member
DW Draft

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