SUMIF greater than 0 (or don't count negatives)

Avalanchez

New Member
Joined
Jun 23, 2021
Messages
14
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
  5. 2011
  6. 2010
  7. 2007
Platform
  1. Windows
Curently have

=SUMIF((EW40,FB40,DX40,ER40,DP40,DT40,DD40,DJ40,CT40,CY40,CJ40,CO40,CE40,BU40,BZ40,BI40,BO40,AX40,BD40,AN40,AS40,AD40,AI40,S40,Y40,I40,M40,E40,ED40,EI40,EN40),">0")

These are adding up dollar amounts and I dont want negatives included in the sum. I seem to only get #Value! or #Null! the few ways ive tried to do it. any suggestions? I can not write it as EW40:EN40 as there are other values same row.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
=SUM(MAX(0,EW40),MAX(0,FB40),MAX(EW40,0),MAX(0,FB40),MAX(0,DX40),MAX(0,ER40),MAX(0,DP40),MAX(0,DT40),MAX(0,DD40),MAX(0,DJ40),MAX(0,CT40),MAX(0,CY40),MAX(0,CJ40),MAX(0,CO40),MAX(0,CE40),MAX(0,BU40),MAX(0,BZ40),MAX(0,BI40),MAX(0,BO40),MAX(0,AX40),MAX(0,BD40),MAX(0,AN40),MAX(0,AS40),MAX(0,AD40),MAX(0,AI40),MAX(0,S40),MAX(0,Y40),MAX(0,I40),MAX(0,M40),MAX(0,E40),MAX(0,ED40),MAX(0,EI40),MAX(0,EN40))
 
Upvote 0
EDIT

Scott Huish

maybe better as indirect() is volatile function
couple of ways

'=SUM(SUMIF(INDIRECT({"EW40","FB40","DX40","ER40","DP40","DT40","DD40","DJ40","CT40","CY40","CJ40","CO40","CE40","BU40","BZ40","BI40","BO40","AX40","BD40","AN40","AS40","AD40","AI40","S40","Y40","I40","M40","E40","ED40",""EI40"",""EN40"}),">0"))

=SUMPRODUCT(SUMIF(INDIRECT({"EW40","FB40","DX40","ER40","DP40","DT40","DD40","DJ40","CT40","CY40","CJ40","CO40","CE40","BU40","BZ40","BI40","BO40","AX40","BD40","AN40","AS40","AD40","AI40","S40","Y40","I40","M40","E40","ED40",""EI40"",""EN40"}),">0"))

OR
using choose - gets complicated and long

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

This will possibly enable a quicker and more accurate solution for you.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC

then put the sample spreadsheet onto a share

I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed

Make sure you set any share or google to share to everyone

-
 
Last edited:
Upvote 0
maybe a limit to the number of entries , you can use, i assumed 255

=SUM(SUMIF(INDIRECT({"A3","A5","A9","A12","C21"}),">0"))

Book26
AB
1
212
31212
4
5-2
6
7
8
9
10
110
12
Sheet1
Cell Formulas
RangeFormula
B2B2=SUM(SUMIF(INDIRECT({"A3","A5","A9","A12","C21"}),">0"))
B3B3=SUMPRODUCT(SUMIF(INDIRECT({"A3","A5","A9","A12","C21"}),">0"))
A11A11=SUM(SUMIF(INDIRECT({"C3","C14","C25","C34","C41"}),">0"))
 
Upvote 0
Dang those are some long formulas.... but they work thanks guys!
 
Upvote 0
you are welcome apologies my input did not work
 
Upvote 0
Please try this. I created a helper row in row 1 that has the word Yes in the columns you want to Sum (E1=Yes, I1=Yes......)

=SUMIFS(E40:FB40,E$1:FB$1,"Yes",E40:FB40,">0")
 
Upvote 0
You may already have a row that suits the purpose. Are the headers in your table the same for the columns you want to sum and are they unique from the rest of the headers? If so you can use that row as your criteria instead of my suggested "Yes" row.
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,685
Members
449,117
Latest member
Aaagu

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