ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Cumulative sum, based on previous data (https://www.excelbanter.com/excel-worksheet-functions/448820-cumulative-sum-based-previous-data.html)

downhillsheep

Cumulative sum, based on previous data
 
Ok, I'm sure this is pretty easy to figure out but this has been bugging me for a while.

If you look at the list below, I have twelve months of data of various amounts. What I would like to do is to report ZERO for Jan as the amount if less than 0.5; report ZERO for Feb as the total of Jan and Feb is still less than 0.5. However, for Mar I'd like to report 0.7 as that is the total of Jan, Feb, and Mar and is over 0.5. For Apr I would like to report 1.2 as that amount is already higher than 0.5; May ZERO and Jun 1.3 and so on and so fourth

Jan Feb Mar Apr May Jun Jul
Data 0.2 0.1 0.4 1.2 0.3 1.0 0.2

What I'd 0.0 0.0 0.7 1.2 0.0 1.3 0.0 like to
achieve

I have to do this for over 10k lines of data and would love an easier way of formulating it so I know what needs to be reported on any given month

Thank you so much for your help

Spencer101

Quote:

Originally Posted by downhillsheep (Post 1612070)
Ok, I'm sure this is pretty easy to figure out but this has been bugging me for a while.

If you look at the list below, I have twelve months of data of various amounts. What I would like to do is to report ZERO for Jan as the amount if less than 0.5; report ZERO for Feb as the total of Jan and Feb is still less than 0.5. However, for Mar I'd like to report 0.7 as that is the total of Jan, Feb, and Mar and is over 0.5. For Apr I would like to report 1.2 as that amount is already higher than 0.5; May ZERO and Jun 1.3 and so on and so fourth

Jan Feb Mar Apr May Jun Jul
Data 0.2 0.1 0.4 1.2 0.3 1.0 0.2

What I'd 0.0 0.0 0.7 1.2 0.0 1.3 0.0 like to
achieve

I have to do this for over 10k lines of data and would love an easier way of formulating it so I know what needs to be reported on any given month

Thank you so much for your help

You say "so on and so forth", but your pattern here is not really clear.
Could you explain why May would be zero?

I think a larger sample of data and expected results would be helpful here too.


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com