+ Reply to Thread
Results 1 to 4 of 4

Resetting running counter based on conditions being satisfied

  1. #1
    Registered User
    Join Date
    03-17-2014
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    2

    Resetting running counter based on conditions being satisfied

    Hi,
    I was wondering if anyone could help with this counter problem for an energy storage project. I have 1 months worth of power outputs at 10 minute intervals, and a corresponding average for this period. The aim is produce a constant power supply at this average. Ie, anything above average can be stored and used to compensate for when the energy falls below average.

    Some example data is:


    Capture.PNG

    Time ~ Energy surplus/deficiency ~ Cumulative energy
    1 / 150 / 150
    2 / 100 / 250
    3 / 50 / 300
    4 / -50 / 250
    5 / -100 / 150
    6 / -200 / -50
    7 /-100 / -150
    8 /50 / -100
    9 / 150 / 50
    10 /100 / 150


    I have plotted the cumulative energy over time to show how much energy I have in storage during that time period. However, it is not possible to have -ve storage. Therefore, when this occurs, I would like to reset the cumulative counter to zero and base the following summations on this starting point. As I have so much data it is not practical to do this manually and I was wondering if there is a way of doing this quickly?

    Any help would be greatly appreciated.

    Thanks.
    Last edited by Stdnt; 03-17-2014 at 05:54 PM.

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Resetting running counter based on conditions being satisfied

    Assuming accumulations in column C beginning on row 2:

    =IF(SUM(C1,B2)<0,0,SUM(C1,B2)) and copy down
    Attached Files Attached Files
    Last edited by daffodil11; 03-17-2014 at 05:58 PM. Reason: Misread question; updated stuffs
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Registered User
    Join Date
    03-17-2014
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Resetting running counter based on conditions being satisfied

    You are a legend.

  4. #4
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Resetting running counter based on conditions being satisfied

    Flattery will get you everywhere. (on this message board)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Conditional Formatting by VBA, Highlight color when If conditions satisfied
    By skhari in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-09-2012, 01:01 PM
  2. Linked Lookup IF 2 conditions are satisfied
    By reghu in forum Excel General
    Replies: 0
    Last Post: 09-01-2010, 07:13 AM
  3. Running counter using time
    By cdrum84 in forum Excel General
    Replies: 1
    Last Post: 06-06-2010, 11:47 AM
  4. Running counter
    By GeorgeBob in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-13-2009, 11:20 PM
  5. Replies: 10
    Last Post: 08-28-2008, 06:45 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1