+ Reply to Thread
Results 1 to 7 of 7

Use cumulative sum in Excel, ( linked in loops) , need help .

  1. #1
    Registered User
    Join Date
    12-02-2016
    Location
    Jordan
    MS-Off Ver
    office 2013
    Posts
    3

    Use cumulative sum in Excel, ( linked in loops) , need help .

    Dear all I need some support in a complicated excel function , which I was trying hard since a week .

    its simply a function to calculate electricity power consumption, including generated power from solar systems I will try to explain it in her and will be happy if someone can help me knocking it out. (prefer in excel not VB) .

    So
    column A ..Is Value " B" = monthly Net power consumption
    column B ..Is Value "MC" = Monthly power consumption from Grid ( consumed from the Grid)
    column C ..Is Value " MI" = monthly power feed into the Grid ( generated from the solar system)
    column D ..Is Value "R" = total power reserve ( cumulated from extra generated power month by month)

    SO simply

    B = MC - MI + R
    in words ( Net power consumption = monthly power consumed - generated power + reserve which was generated and not used from previous months)

    if B is positive then its need to be paid
    if B if negative (which means we generate more than consumed) , then the new R = old R + the new B

    it looks simple , but the problem that if I use if statement I will have a loop , where I can cumulate the R and use it again in the next month.

    how can I get this don !!!

    thanks all
    Last edited by abedoo; 12-02-2016 at 05:32 AM.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,718

    Re: Need Help in Excel, Formula Problem, Code Problem, and Need Advice

    If we have 1st month's data in row 2 in columns A:D

    B MC MI R
    -20 100 130 10
    40 160 110 -10
    x x x 30


    in D3 and copy down

    =D2+A2

    This gives R for next month to be entered in row 3

    In example above we have entered months 1 and 2

    and R for month 3 is 30.

    "x" indicates data to entered for month 3
    Last edited by JohnTopley; 12-02-2016 at 05:45 AM.

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,028

    Re: Need Help in Excel, Formula Problem, Code Problem, and Need Advice

    Quote Originally Posted by abedoo View Post
    Dear Friends

    Shull I start a separate dissection regarding the title ?
    where someone (like johny) help me to solved the main topic instead of getting confused.

    Thanks

    Glenn .. don't worry .. I never take things personal .. I speak 5 langues .. so I am fine if its not perfect as mother Tung people ..its just to communicate and understand each other. )
    No, it would break another rule
    It's fine now, and I can delete discussion.

    It's about being more descriptive so other people that will search for simillar problem, can also get benefits from the answers.


    Also I forgot to answer JohnTopley

    Quote Originally Posted by JohnTopley View Post
    If the OP does not know which formula to use, what is he/she supposed to say?
    As rule say: describe a problem, not anticipated solution.
    Sometimes users use some function while other is better to his solution. So formula he use is irrelevant.
    It's a problem that we put focus on.
    And "excel function help" doesn't give ANY information about a problem.
    Last edited by zbor; 12-02-2016 at 05:47 AM.
    Never use Merged Cells in Excel

  4. #4
    Registered User
    Join Date
    12-02-2016
    Location
    Jordan
    MS-Off Ver
    office 2013
    Posts
    3

    Re: Need Help in Excel, Formula Problem, Code Problem, and Need Advice

    Hallo John , thanks for support.

    maybe need to clear few things
    B is always positive . cant be negative .. as in real life if you generate more power than you consume .. then it will be saved for you as credit ( R ) for the next month ..

    if B is positive then it must be paid
    if b is negative , need to be add to next month Bill (*** negative) .. and if the total is still negative , will be added as new R

    this what make it complicated

    thanks

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,718

    Re: Use cumulative sum in Excel, ( linked in loops) , need help .

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  6. #6
    Registered User
    Join Date
    12-02-2016
    Location
    Jordan
    MS-Off Ver
    office 2013
    Posts
    3

    Re: Use cumulative sum in Excel, ( linked in loops) , need help .

    problem is solved .. thanks all

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,718

    Re: Use cumulative sum in Excel, ( linked in loops) , need help .

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. Replies: 4
    Last Post: 04-24-2014, 11:56 AM
  2. Replies: 13
    Last Post: 04-08-2014, 05:46 AM
  3. Replies: 1
    Last Post: 03-21-2012, 11:22 AM
  4. Replies: 2
    Last Post: 03-30-2009, 04:04 AM
  5. New Function in Excel 2007 - IFERROR Function
    By ExcelTip in forum Tips and Tutorials
    Replies: 0
    Last Post: 11-15-2007, 05:09 AM
  6. Javascript function converting to Excel function
    By kamila in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-31-2007, 07:06 AM
  7. [SOLVED] Excel - User Defined Function Error: This function takes no argume
    By BruceInCalgary in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-18-2006, 04:05 PM

Tags for this Thread

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