Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
tom tom is offline
external usenet poster
 
Posts: 570
Default Interval accumulation and resets

WinXP Pro SP2
Excel 2003 SP3

I am trying to create an Excel formula that totals the interval values as
they decrease or as they increase. Upon a change of direction (SIGN(),
probably) I want to reset/restart the accumulation.
Here's my current attempt but it's probably not too close.
=IF(SIGN($D33)=SIGN($D32),$D33-$D32,0)
Column D is the change of the value of an average (mean) measurement for
column C.
Here's a sample
Row Col C Col D
1 361193
2 360566 -627
3 350680 -9886
4 327803 -22877
5 317173 -10630
As Col D continues to decrease then I need to accumulate the 'negative'
values. Once Col D gets a positive value, which indicates a change of
direction, then I need to start accumulating the values so that I start with
the first value. I don't want to have a SUM() of the accumulation for all
the Col D values. I just want the sum of the values as long as the sign of
Col D is the same.
So, as long as Col C decreases, I need to accumulate during the entire
'series'. Once Col D changes to increasing, I need to accumulate during the
entire 'series' and then reset/restart when Col D changes to
negative/decreases.
TIA!
Tom

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,180
Default Interval accumulation and resets

Assume your List looks like this:
List Accu SignC
-12 0 0
-5 7 1
24 36 1
35 47 1
-48 0 0
-46 2 0
-40 8 1
-34 14 1
-29 19 1
-46 0 0
40 86 0
50 96 1
18 0 0
-18 -36 1
18 0 0
24 6 1
37 19 1
40 22 1
Add two columns, named Accu and SignC
Into cell 1, 2 of SignC, enter 0, 1 respectively
into cell 3 of SignC enter this formula and copy down
=--(SIGN(List R-List R[-1])=SIGN(List R[-1]-List R[-2]))
Into cell 1 of Accu, enter 0
Into cell 2 of Accu enter and copy down
=IF(SignC,List R-List R[-1]+Accu R[-1],
IF(Accu R[-1]=0,List R-List R[-1]+Accu R[-1],0))
Formulas written in
Tools Options General R1C1
for intuitive readability.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sick time accumulation Clueless Excel Worksheet Functions 3 January 9th 07 07:18 AM
How to do one cell accumulation VR Excel Worksheet Functions 3 September 28th 06 08:05 PM
subtraction in a list of numbers that resets with a label. gtslabs Excel Worksheet Functions 5 October 27th 05 02:20 PM
How do I calculate yield for multiple coupon resets? analyst Excel Discussion (Misc queries) 0 October 17th 05 03:20 PM
Accumulation Paul Excel Worksheet Functions 1 April 22nd 05 11:32 PM


All times are GMT +1. The time now is 01:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"