how to specify "not equal to"? in Excel General Questions  
 |  Edit my Profile  |  Help
 
     
  
 
 
 
Melissa 8/14/2007 8:35 PM PST
  Question
  To give a simple example, I would like to sum a range of cells only if the
values are not 0. So the sum should include both positive and negative
numbers. What would the formula look like?
Thank you very much.
 
  Was this post helpful to you?  
 
 
  Reply | Print post   TopTop  
 
 
 
 
JMB  8/14/2007 9:47 PM PST
  Answer
  If I may, let's change the example to summing numbers in A1:A7 that are not
equal to 2. Obviously, it makes no sense to exclude 0 from a sum
calculation.

=SUMIF(A1:A7,"<>2")
or if B1 = 2
=SUMIF(A1:A7,"<>"&B1)

However, the idea is the same for 0 if that's truly what you want. If it is
not helpful, please post back w/some more details about what you are actually
trying to do. If you have multiple conditions or more complex conditions,
you may need to use a different function (such as sumproduct).

http://xldynamic.com/source/xld.SUMPRODUCT.html



"Melissa" wrote:

> To give a simple example, I would like to sum a range of cells only if the
> values are not 0. So the sum should include both positive and negative
> numbers. What would the formula look like?
> Thank you very much.
 
  Was this post helpful to you?  
 
 
  Reply | Print post   TopTop  
 
 
 
 
Melissa 8/14/2007 11:41 PM PST
   
  Yes you are right, it makes no sense whatsoever to sum up a range and exclude
0 from it :o)
I just wanted to know what the "not equal to" sign was which you've provided
as "<>". Thanks very much!

"JMB" wrote:

> If I may, let's change the example to summing numbers in A1:A7 that are not
> equal to 2. Obviously, it makes no sense to exclude 0 from a sum
> calculation.
>
> =SUMIF(A1:A7,"<>2")
> or if B1 = 2
> =SUMIF(A1:A7,"<>"&B1)
>
> However, the idea is the same for 0 if that's truly what you want. If it is
> not helpful, please post back w/some more details about what you are actually
> trying to do. If you have multiple conditions or more complex conditions,
> you may need to use a different function (such as sumproduct).
>
> http://xldynamic.com/source/xld.SUMPRODUCT.html
>
>
>
> "Melissa" wrote:
>
> > To give a simple example, I would like to sum a range of cells only if the
> > values are not 0. So the sum should include both positive and negative
> > numbers. What would the formula look like?
> > Thank you very much.
 
  Was this post helpful to you?  
 
 
  Reply | Print post   TopTop  
 
 
 
 
JMB  8/15/2007 4:50 PM PST
   
  Glad to help. Thanks for the feedback.

"Melissa" wrote:

> Yes you are right, it makes no sense whatsoever to sum up a range and exclude
> 0 from it :o)
> I just wanted to know what the "not equal to" sign was which you've provided
> as "<>". Thanks very much!
>
> "JMB" wrote:
>
> > If I may, let's change the example to summing numbers in A1:A7 that are not
> > equal to 2. Obviously, it makes no sense to exclude 0 from a sum
> > calculation.
> >
> > =SUMIF(A1:A7,"<>2")
> > or if B1 = 2
> > =SUMIF(A1:A7,"<>"&B1)
> >
> > However, the idea is the same for 0 if that's truly what you want. If it is
> > not helpful, please post back w/some more details about what you are actually
> > trying to do. If you have multiple conditions or more complex conditions,
> > you may need to use a different function (such as sumproduct).
> >
> > http://xldynamic.com/source/xld.SUMPRODUCT.html
> >
> >
> >
> > "Melissa" wrote:
> >
> > > To give a simple example, I would like to sum a range of cells only if the
> > > values are not 0. So the sum should include both positive and negative
> > > numbers. What would the formula look like?
> > > Thank you very much.
 
  Was this post helpful to you?  
 
 
  Reply | Print post   TopTop  
 
 
 
 
lalitmishra 9/8/2009 5:35 AM PST
   
 

"Melissa" wrote:

> To give a simple example, I would like to sum a range of cells only if the
> values are not 0. So the sum should include both positive and negative
> numbers. What would the formula look like?
> Thank you very much.plz halp mee to you than any thing question to serial answwer
 
  Was this post helpful to you?  
 
 
  Reply | Print post   TopTop  
 
 
 
 
Gord Dibben 9/8/2009 8:47 AM PST
   
  =SUMIF(A1:A11,"<>0",A1:A11)


Gord Dibben MS Excel MVP

On Tue, 8 Sep 2009 05:36:01 -0700, lalitmishra
<lalitmishra@discussions.microsoft.com> wrote:

>
>
>"Melissa" wrote:
>
>> To give a simple example, I would like to sum a range of cells only if the
>> values are not 0. So the sum should include both positive and negative
>> numbers. What would the formula look like?
>> Thank you very much.plz halp mee to you than any thing question to serial answwer

 
  Was this post helpful to you?  
 
 
  Reply | Print post   TopTop  
 
 
 
 
Gord Dibben 9/8/2009 8:51 AM PST
   
  Shorter version

=SUMIF(A1:A11,"<>0")


Gord

On Tue, 08 Sep 2009 08:44:39 -0700, Gord Dibben <gorddibbATshawDOTca> wrote:

>=SUMIF(A1:A11,"<>0",A1:A11)
>
>
>Gord Dibben MS Excel MVP
>
>On Tue, 8 Sep 2009 05:36:01 -0700, lalitmishra
><lalitmishra@discussions.microsoft.com> wrote:
>
>>
>>
>>"Melissa" wrote:
>>
>>> To give a simple example, I would like to sum a range of cells only if the
>>> values are not 0. So the sum should include both positive and negative
>>> numbers. What would the formula look like?
>>> Thank you very much.plz halp mee to you than any thing question to serial answwer

 
  Was this post helpful to you?  
 
 
  Reply | Print post   TopTop  
 
 
 
 
lalitmishra 9/8/2009 5:37 AM PST
   
 

"Melissa" wrote:

> To give a simple example, I would like to sum a range of cells only if the
> values are not 0. So the sum should include both positive and negative
> numbers. What would the formula look like?
> Thank you very much.i like nat a other formula i choose a date of formula
 
  Was this post helpful to you?  
 
 
  Reply | Print post   TopTop  
 
 
 
 
Dan DeHaven 9/8/2009 10:51 AM PST
   
  lalitmishra;480279 Wrote: > "Melissa" wrote:
>
> > To give a simple example, I would like to sum a range of cells only > if the
> > values are not 0. So the sum should include both positive and > negative
> > numbers. What would the formula look like?
> > Thank you very much.i like nat a other formula i choose a date of > formula

FYI, in formulas "not equal to" is specified as "<>"

Not sure if you're using Excel 2007 or not. 2007 give a great new function "SUMIFS" which allows form multiple "If's" as criteria in the calculation.

Say your values are in C2:C50.....Use =SUMIFS(C2:C50,C2:C50,"<>0")
The first C2:C50 in the formula is the SUM range, the second C2:C50 is the "criteria range1" which uses the "criteria1" third argument "<>0" to exclude zeros.

I'm sure there are a dozen other ways to do it as well. If this isn't meeting your needs please give a bit more info about the situation.

I can't understand why you would exclude zeros from a SUM as they are normally excluded by nature of the value, but maybe there is something I'm missing.

Dan -- Dan DeHaven ------------------------------------------------------------------------ Dan DeHaven's Profile: http://www.thecodecage.com/forumz/member.php?userid=748 View this thread: http://www.thecodecage.com/forumz/showthread.php?t=132459
 
  Was this post helpful to you?  
 
 
  Reply | Print post   TopTop  
 
 
  Return to Microsoft Communities  Notify me of replies