Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default sum positive and negative values

Hi, I am looking for a vba routine
I have a time series like this:

1995, -.05
1996, -2.1
1997, 3.6
1998, 4.3
1999, 0.7
2000, -0.08
2001, -0.1

and I would like to sum just the positive and negative value separately
in this way

1995, -2.15
1996, 8.6
1999, -0.18
i.e the sum of negative or positive values should be associated to the
last date of the previous growth or drop. I don't know in advance the
length of period of drop and growth

Thanks in advance.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default sum positive and negative values

in the column A I have the year
in the column B I have the annual (growth or decrease) rate of output

in 1995 I would have the sum of B1+B2 because it is the first data
in 1996 that is the las year of drop, I would like the sum of B3+B4+B5
in 1999 that is the las year of growth I would like the sum ob B7+B7

the length of drop or growth is unknown because in another country i
could have:

1995, -.05
1996, 3.1
1997, 4.3
1998, 1.1
1999, 0.7
2000, -1.08
2001, -2.1

and then
1995, -.05 (because I don't have previous years)
1995, 9.3 (problem)
1999,-2.18

In order to avoid confusion It is better to me to have two routines
separated for negative and positive values respectively

Don Guillett wrote:
I, for one, don't understand what you want. A better example.

--
Don Guillett
SalesAid Software

"bora" wrote in message
ps.com...
Hi, I am looking for a vba routine
I have a time series like this:

1995, -.05
1996, -2.1
1997, 3.6
1998, 4.3
1999, 0.7
2000, -0.08
2001, -0.1

and I would like to sum just the positive and negative value separately
in this way

1995, -2.15
1996, 8.6
1999, -0.18
i.e the sum of negative or positive values should be associated to the
last date of the previous growth or drop. I don't know in advance the
length of period of drop and growth

Thanks in advance.


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
Changing positive values to negative jay New Users to Excel 2 July 7th 07 01:34 AM
sum positive and negative values separately bora Excel Programming 3 December 4th 06 05:07 PM
Formula to make Negative Values Positive & Positive Values Negative? mustard Excel Discussion (Misc queries) 4 September 26th 05 10:05 PM
... Count, <<< Positive Values minus Negative Values >>> ... Dr. Darrell Excel Worksheet Functions 4 September 8th 05 01:36 PM
switching values from positive to negative lob Excel Worksheet Functions 5 February 18th 05 11:11 PM


All times are GMT +1. The time now is 05:04 AM.

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

About Us

"It's about Microsoft Excel"