Solved

# Sum if negative

Posted on 2015-02-18
58 Views
Hi,

Attached are 5 numbers from d5-h5

in the attrition cell I need to sum the negative cells
In the growth cell I need to sum the positive cells

What formula would I use?

Thanks
EE.xlsx
0
Question by:Seamus2626
• 5
• 4
• 3
• +1

LVL 31

Expert Comment

SImple SUMIF will do this for you:

=SUMIF(D5:H5,"<"&0,D5:H5)

=SUMIF(D5:H5,">"&0,D5:H5)

Thanks
Rob
0

LVL 18

Expert Comment

Use
Attrition:
=SUMIF(D4:H4,"<0")
Growth:
=SUMIF(D4:H4,">0")
0

LVL 24

Expert Comment

=SUMIF(D4:H4,"<0")

And

=SUMIF(D4:H4,">0")
0

Author Comment

Hi guys, I cant use sumif

For the example attached - attrition must = -289 and growth = 940

Thanks
0

LVL 24

Expert Comment

How do you calculate that? And why can't you use SUMIF?
0

LVL 31

Expert Comment

So:

Attrition = 651-940=-289

Growth = MAX(D5:H5) = 940
0

LVL 24

Expert Comment

Then attrition is =h4-max(d4:h4) then?
0

LVL 31

Expert Comment

I am assuming that the headers for each column are geographical regions:

ASP - Asia Pacific
EUR - Europe
LATAM - Latin America
ME - Middle East
NA - North America

Are you comparing like with like?

If correct to do so, I assume the Highest and next highest for the 651-940 calculation could be in any of the 5 cells.
0

Author Comment

Hi guys, sorry for not being clearer here.

It is for regions

Some may be growing, some may be declining

I need the sum of the numbers that are growing
and

the sum of the numbers that are declining

So the message is - from your 5 regions, and your net growth of 651 - you are growing 940 and declining 289

Hope that makes sense!
0

LVL 24

Expert Comment

No, it doesn't.

You have figures of -20      -65      940      0      651

The total of the +ve figures is 940+651=1591
The total of the -ve figures is -20-65 = -85
0

Author Comment

I see I got my numbers mixed up when doing up a new workbook

Im looking at

ASP= -204
EUR= -20
LATAM= -65
ME = 940
NA= 0

Thanks
0

LVL 24

Accepted Solution

Phillip Burton earned 500 total points
So why can't you use SUMIF?

If you can't, then:

=MIN(D4,0)+MIN(E4,0)+MIN(F4,0)+MIN(G4,0)+MIN(H4,0)
=MAX(D4,0)+MAX(E4,0)+MAX(F4,0)+MAX(G4,0)+MAX(H4,0)

and if I haven't got it right, please tell me exactly what results you are looking for.
0

Author Closing Comment

Perfect!

Thanks Phillip
0

## Featured Post

Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…