Sum only positive numbers, not in a range??

Mirandaleecon

New Member
Joined
Mar 3, 2016
Messages
4
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!
 

Some videos you may like

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

AlphaFrog

MrExcel MVP
Joined
Sep 2, 2009
Messages
16,377
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:

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
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
?
 

Mirandaleecon

New Member
Joined
Mar 3, 2016
Messages
4
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
 

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061

ADVERTISEMENT

Try

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

Mirandaleecon

New Member
Joined
Mar 3, 2016
Messages
4
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...
 

Mirandaleecon

New Member
Joined
Mar 3, 2016
Messages
4
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!
 

Watch MrExcel Video

Forum statistics

Threads
1,122,371
Messages
5,595,784
Members
414,020
Latest member
Meghdad

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
Top