On Mon, Sep 22, 2008 at 11:02 AM, Joe Smith <[EMAIL PROTECTED]> wrote:
> Mark Knecht wrote:
>>
>> ...
>> I need to get the sum of column 1 *  column 2 but only when the value
>> in column 1 is either negative or positive.
>
> Hmm, "either negative or positive"? SUMPRODUCT(A1:A5; B1:B5) will do that,
> since your condition is true for every number I can think of.
>
> If you mean "only when the value in column 1 is not zero", you can use
> something like
>
> =SUMPRODUCT(A1:A5<>0; A1:A5; B1:B5)
>
> or "only when the value in column 1 is positive":
>
> =SUMPRODUCT(A1:A5>0; A1:A5; B1:B5)
>
> <Joe

Joe,
   The latter is what I was looking for:

=SUMPRODUCT(A1:A5>0; A1:A5; B1:B5)

Now, interestingly, while this does seem to work in Calc it doesn't
work in Excel. I've personally never seen the use of semi-colons in
Excel. Is there a form of this equation that you know of that would be
compatible with both Calc and Excel?

Thanks,
Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to