# Sum only positive numbers, not in a range??

#### Mirandaleecon

##### New Member
Hello!
How can I sum only positive numbers that are not in a range. I have tried sumif several different ways and I cannot get it to work without a range.

A B C D E F
-5 -4 -2 3 1 -8

Take the above example. I would only like to sum A, C, and E. What formula would I need to put in to get the answer '1'??

The spreadsheet I'm working needs to sum about 100 alternating cells like this so it needs to be relatively simple.

Thank you!

### Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
A B C D E F
-5 -4 -2 3 1 -8

Take the above example. I would only like to sum A, C, and E. What formula would I need to put in to get the answer '1'??

I don't follow the example. A, C, and E are -1, -2, and 1
A and C are not positive numbers.

Don't you want to sum D and E (3+1=4) ?

This will sum only positive values in A1:F1
=SUMIF(A1:F1,">0",A1:F1)

Last edited:
I think op wants to completely IGNORE B D and F
And only look at A C and D

Then within A C and D only, sum the ones that are positive.

Is that right?

Is there anything in common in another row that indicates which cells you want to include, like a certain text string in a header?
So we can say
Sum if A1:F1 = "sometextstring" AND the Value in A2:F2 is > 0
?

I think op wants to completely IGNORE B D and F
And only look at A C and D

Then within A C and D only, sum the ones that are positive.

Is that right?

Is there anything in common in another row that indicates which cells you want to include, like a certain text string in a header?
So we can say
Sum if A1:F1 = "sometextstring" AND the Value in A2:F2 is > 0
?
Yes! So say A, C, and E have headers of "X" and B,D,F have a header of "Y" what would the formula look like?

A B C D E F
[1] X y x y x y

-5 -4 -2 3 1 -8

Try

=SUMIFS(A2:F2,A\$1:F\$1,"X",A2:F2,">0")

Ugh, I was trying to post a prettier version of my example and pressed something that posted it.

Let me try again
A B C D E F
[1]X y x y x y
[2]-5 -4 -2 3 1 -8

The spacing is going to get jacked up but I think you get the idea...

Try

=SUMIFS(A2:F2,A\$1:F\$1,"X",A2:F2,">0")

That worked! Took me a minute to see the 's' at the end of sumif and I was getting super frustrated (was already frustrated to begin with). I have been trying to figure this out for hours!

Replies
8
Views
378
Replies
3
Views
137
Replies
3
Views
319
Replies
1
Views
203
Replies
1
Views
405

1,216,381
Messages
6,130,293
Members
449,570
Latest member
TomMacca52

### 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.

### Which adblocker are you using?

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

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