SUMIFS Exclusions

Martin Jones

New Member
Joined
Dec 3, 2021
Messages
10
Office Version
  1. 365
Platform
  1. Windows
Hello,
I’m hoping someone can help me with this formula.
=SUMIFS($P$1:$P$99999,$A$1:$A$99999,"<>"&$X$18,$B$1:$B$99999,$U$17,$H$1:$H$99999,$U$1)
This works however it only excludes X18. What I want to do is exclude a range. For instance the exclusion would be &$X$18: $X$26
I have tried this:
=SUMIFS($P$1:$P$99999,$A$1:$A$99999,"<>"&$X$18:$X$26,$B$1:$B$99999,$U$17,$H$1:$H$99999,$U$1)
But I receive a SPILL
Also tried this:
=SUMIFS($P$2:$P$100000,$A$2:$A$100000,"<>"&X17&X18&X19&X20&X21&X22&X23&X24&X25&X26,$B$2:$B$100000,$U$27,$H$2:$H$100000,$U$2)
It will only exclude the first cell i.e., &X17
Thanks in advance
Martin
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Are you sure that there are rows which match all criteria?

Can you post some sample data.
MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
So if the values in Column X are normally blank unless you want to exclude them then you could:
=SUMIFS($P$1:$P$99999,$X$1:$X$99999,"<>",$B$1:$B$99999,$U$17,$H$1:$H$99999,$U$1)
This excludes non blanks in column X
Column X will always have values that need to be excluded from Column A. There is no blanks in Column A or X
 
Upvote 0
Are you sure that there are rows which match all criteria?

Can you post some sample data.
MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
Positive, they are matching values.
I can't install any add-ins on my corporate system.
However, I can generate a sterilized version of the file and send to my home system. It will take some time to generate.
 
Upvote 0
Ok, that's fine. I'm logging off for the night now, but I'll have a look tomorrow.
 
Upvote 0
SEPTEMBER_Ad Hoc Expenditure Report striped.xlsx
ABCDEFGHIJ
1COST CENTEROBJECT CLASSACTIVITYTOTAL OBLIGATION AMOUNTProgramJP102X
2J00000000000JP102X$0.00310026#NAME?This Calculation
3J00000000000JP102X$0.00
4J00000000000JP102X$0.00CC Exclusion
5J90702310026JP102X$0.00J90702
6J90714000000JP102X$0.00J90714
7J90734000000JP102X$0.00J90734
8J90761111001JP108X$2,546.04J90761
9J90111111001JP108X($2,546.04)J90111
10J90102310026JP108X$5,618.88
11J90102111001JP108X($5,618.88)
12J90102111001JP108X$8,428.32
13J90102111001JP108X($8,428.32)
14J90102111001JP108X$9,389.60
15J90102310026JP108X($9,389.60)
16J90702111001JP108X$9,389.60
17J90714111001JP108X$9,389.60
18J90734111001JP108X$9,389.60
19J90761111001JP108X($9,389.60)
20J90111111001JP108X$9,389.60
aru1633356081350 Report
Cell Formulas
RangeFormula
H2H2=SUM(_xlfn._xlws.FILTER($D$1:$D$99998,(ISNA(MATCH($A$1:$A$99998,$J$6:$J$14,0))*($B$1:$B$99998=$G$27)*($C$1:$C$99998=$G$1))))
 
Upvote 0
Thanks for that, however row 5 is the only row that meats the criteria in G1 & G2, so the formula returns 0.
If the criteria range for col A is changed from I6:I14 to I5:I14 I get the #calc error as row 5 is then excluded.
+Fluff 1.xlsm
ABCDEFGHIJ
1COST CENTEROBJECT CLASSACTIVITYTOTAL OBLIGATION AMOUNTProgramJP102X
2J000000JP102X03100260This Calculation
3J000000JP102X0#CALC!
4J000000JP102X0CC Exclusion
5J90702310026JP102X0J90702
6J907140JP102X0J90714
7J907340JP102X0J90734
8J90761111001JP108X2546.04J90761
9J90111111001JP108X-2546.04J90111
10J90102310026JP108X5618.88
11J90102111001JP108X-5618.88
12J90102111001JP108X8428.32
13J90102111001JP108X-8428.32
14J90102111001JP108X9389.6
15J90102310026JP108X-9389.6
16J90702111001JP108X9389.6
17J90714111001JP108X9389.6
18J90734111001JP108X9389.6
19J90761111001JP108X-9389.6
20J90111111001JP108X9389.6
Main
Cell Formulas
RangeFormula
H2H2=SUM(FILTER($D$1:$D$99998,(ISNA(MATCH($A$1:$A$99998,$J$6:$J$14,0))*($B$1:$B$99998=$G$2)*($C$1:$C$99998=$G$1))))
H3H3=SUM(FILTER($D$1:$D$99998,(ISNA(MATCH($A$1:$A$99998,$J$5:$J$14,0))*($B$1:$B$99998=$G$2)*($C$1:$C$99998=$G$1))))
 
Upvote 0

Forum statistics

Threads
1,214,926
Messages
6,122,305
Members
449,079
Latest member
juggernaut24

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