SUMif exclusing negative values

Stanman

New Member
Joined
Jan 15, 2020
Messages
44
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Hi,

I want to sum a range that has both positive and negative numbers but would like to exclude either. I have tried =SUMIF(Sheet!X2:X2000,"AD",Sheet!D2:D2000, "<0") but it gave a calculation error.

Any help would be appreciated

Thanks
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
You have one argument to many for Countif. Try the same with COUNTIFS.
 
Upvote 0
If I use count, wont that return just the numbers, I was after the total in the column based on the criteria but excluding negative numbers
 
Upvote 0
You need SUMIFS, which takes the sum range first, so to sum negatives:

Excel Formula:
=SUMIFS(Sheet!D2:D2000,Sheet!X2:X2000,"AD",Sheet!D2:D2000, "<0")
 
Last edited:
Upvote 0
I was after the total in the column based on the criteria but excluding negative numbers
Try
Excel Formula:
=SUMIFS(Sheet!D2:D2000,Sheet!X2:X2000,"AD",Sheet!D2:D2000, ">0")

Edit: I missed Rory's post but I think the formula needs SUMIFS, which his post states but missed the 'S' in the formula. :)
 
Upvote 0
Try

Book2
ABCD
1NamesAmountExcluding NegativeExcluding Positive
2AD16-2
3AF1
4AF1
5AF1
6AF1
7AF1
8AD1
9AD1
10AD1
11AD1
12AD1
13AD-1
14AD-1
Sheet1
Cell Formulas
RangeFormula
C2C2=SUMIFS(B:B,A:A,"AD",B:B,">"&0)
D2D2=SUMIFS(B:B,A:A,"AD",B:B,"<"&0)
 
Upvote 0
You need SUMIFS, which takes the sum range first, so to sum negatives:

Excel Formula:
=SUMIF(Sheet!D2:D2000,Sheet!X2:X2000,"AD",Sheet!D2:D2000, "<0")

Isn't it
Excel Formula:
=SUMIFS(Sheet!D2:D2000,Sheet!X2:X2000,"AD",Sheet!D2:D2000, "<0")
 
Upvote 0
Yes, as Peter already pointed out - I copied and pasted the original and forgot to add the S (though I have edited my post now). :)
 
Upvote 0
Haha, don't know at all why I switched to COUNTIF and proposed COUNTIFS. Temporary insanity or so.
 
Upvote 0

Forum statistics

Threads
1,214,935
Messages
6,122,337
Members
449,077
Latest member
Jocksteriom

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