Re: Subrange

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Range A is changing regulary, that's why I'm looking how to work with "range
A without first row". Of course I can define new dinamic range but I try to
avoid having to many ranges.

Oscar.

"T. Valko" wrote:

Try these:

Negative total:

=SUMPRODUCT(--(A3:A5<A2:A4),A3:A5-A2:A4)

Positive total:

=SUMPRODUCT(--(A2:A4<A3:A5),A3:A5-A2:A4)

--
Biff
Microsoft Excel MVP


"Oscar" <Oscar@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:55593754-8EDF-4F61-85AC-90976F640F03@xxxxxxxxxxxxxxxx
range A = A2:A5
A2=6; (A2 - A1 = 6; change from A1 to A2 is out of range A)
A3=3; (A3 - A2 = -3; OK)
A4=13; (A4 - A3 = 10; OK)
A5=5; (A5 - A4 = -8; OK)

sum of negative increments:
SUMPRODUCT(--(a-OFFSET(a,-1,0)<0),a-OFFSET(a,-1,0)) = -3 (OK) - 8 (OK)
= -11
sum of positive increments:
SUMPRODUCT(--(a-OFFSET(a,-1,0)>0),a-OFFSET(a,-1,0)) = 6 (not wanted) + 10
(OK) = 16 -> I expect 10 so that: -11 (sum of negative increments) + 10
(sum
of positive increments) = -1 = 5 (first value in range A) - 6 (last value
in
range A).

Oscar.

"T. Valko" wrote:

Can you post an example and what result you expect?

--
Biff
Microsoft Excel MVP


"Oscar" <Oscar@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:3BCD3EB7-16D5-4AB5-B536-A2714FBE417B@xxxxxxxxxxxxxxxx
In range a (part of the column) I have series of values. I want to
calculate
sum of positive and negative increments. Formula
SUMPRODUCT(--(a-OFFSET(a,-1,0)<0),a-OFFSET(a,-1,0)) works O.K. apart
from
the
fact that I should skip first row. Instead of a I should calculate with
subrange of a - range a without a first row.

If anybody can help...

Thanks, Oscar.






.



Relevant Pages

  • Re: Subrange
    ... Microsoft Excel MVP ... A without first row". ... sum of negative increments: ... sum of positive and negative increments. ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Subrange
    ... sum of negative increments: ... sum of positive increments: ... sum of positive and negative increments. ... subrange of a - range a without a first row. ...
    (microsoft.public.excel.worksheet.functions)
  • Re: sum a column within a name definition
    ... Microsoft Excel MVP ... Will sum column F within the range D, ... to start on the first row of the range D, 3 says we want to start 3 columns ... to sum up column C's values without have to explicitly type C2:C13. ...
    (microsoft.public.excel.misc)
  • Re: Subrange
    ... Microsoft Excel MVP ... sum of positive and negative increments. ... subrange of a - range a without a first row. ...
    (microsoft.public.excel.worksheet.functions)
  • Subrange
    ... sum of positive and negative increments. ... subrange of a - range a without a first row. ...
    (microsoft.public.excel.worksheet.functions)