MurrayBarn
New Member
- Joined
- May 27, 2012
- Messages
- 32
- Office Version
- 365
- Platform
- Windows
Hi There
I have a set of data that I am using two ranges as criteria as per the below tables. The data is summarised in Branch and Cost Centre names. The user chooses a Dropdown for each Branch and then Cost Centre. I can successfully calculate the SUMIFS if anything other than All is selected. So If I want Cape Town and Electronic Design, SUMIFS works well.
However, if the user selects say Cape Town and All, SUMIFS returns zero as it cannot find All in the second criteria range.
Is there a way that will cause Excel to ignore part of the SUMIFS function if All is selected, in other words if All is selected for Criteria 2, how do I get Excel to sum all the data based on criteria range 2? If say Cape Town and Engineering are chosen, the formula would be something like =-SUMIFS(Data!AJ:AJ,Data!$I:$I,Report!F$1,Data!$J:$J,Report!F$2) where ReportF1 = 60 and ReportF2 = 20. Now the user wants to see the results for all Brnaches and Divisions and chooses All for both. How do I get Excel to eliminate the sections for Criteria 1 and 2 or get it to convert "All" into everything?
I have a set of data that I am using two ranges as criteria as per the below tables. The data is summarised in Branch and Cost Centre names. The user chooses a Dropdown for each Branch and then Cost Centre. I can successfully calculate the SUMIFS if anything other than All is selected. So If I want Cape Town and Electronic Design, SUMIFS works well.
However, if the user selects say Cape Town and All, SUMIFS returns zero as it cannot find All in the second criteria range.
Is there a way that will cause Excel to ignore part of the SUMIFS function if All is selected, in other words if All is selected for Criteria 2, how do I get Excel to sum all the data based on criteria range 2? If say Cape Town and Engineering are chosen, the formula would be something like =-SUMIFS(Data!AJ:AJ,Data!$I:$I,Report!F$1,Data!$J:$J,Report!F$2) where ReportF1 = 60 and ReportF2 = 20. Now the user wants to see the results for all Brnaches and Divisions and chooses All for both. How do I get Excel to eliminate the sections for Criteria 1 and 2 or get it to convert "All" into everything?
Branch Name | Code |
All Branches | All |
Brazil | 70 |
Cape Town | 60 |
Head Office | 00 |
Kimberley | 40 |
Middelburg | 20 |
Randburg | 10 |
Richards Bay | 50 |
Rustenburg | 30 |
Training | 80 |
Cost Centre Name | Code |
Admin | 01 |
All divisions | All |
DEF | 00 |
Detector Assembly | 10 |
Electronic Design | 15 |
Engineering | 20 |
Fabrication | 25 |
Field Service | 30 |
General Assembly | 35 |
ISO | 80 |
MARK | 70 |
Mechanical Design | 40 |
Pack & Crating | 55 |
Paint & Sand | 45 |
PCB Assembly | 60 |
Prod | 09 |
Quality Control | 65 |
Research & Development | 85 |
Sales | 99 |
Stores | 05 |
Testing | 90 |