+ Reply to Thread
Results 1 to 15 of 15

Cumulative sum of different cells on different sheets

  1. #1
    Registered User
    Join Date
    06-11-2009
    Location
    asd
    MS-Off Ver
    Excel 2003
    Posts
    27

    Cumulative sum of different cells on different sheets

    I currently have various data in several columns of cells which are categorised by month, eg:

    Jan xxxx 1111
    Feb yyyy 2222
    Mar zzzz 3333...

    I need to sum up these amounts on a different worksheet cumulatively, ie. Jan, Feb (Jan + Feb), Mar (Jan + Feb + Mar), etc..

    Is there any formula i can use to do this, which can be dragged out on the 2nd worksheet to speed things up? I am currently clicking indiv cells to sum them up and it is taking a REALLY long time (I have 5 years of data I need to do!)

    Please help!

  2. #2
    Valued Forum Contributor
    Join Date
    11-11-2008
    Location
    Euro
    MS-Off Ver
    2007, 2010
    Posts
    470

    Re: Cumulative sum of different cells on different sheets

    you can use SUMIF funtion

    for exampe
    Feb --> =SUMIF(MONTH(data!$A$2:$A$100),"<=2",data!$C$2:$C$100)
    Mar --> =SUMIF(MONTH(data!$A$2:$A$100),"<=3",data!$C$2:$C$100)
    ...
    and so on..

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Cumulative sum of different cells on different sheets

    tigertiger, I'm afraid you can't do that, ie you can't manipulate data within a COUNTIF/SUMIF (this is why people generally adopt SUMPRODUCT whenever data manipulation is required).

    That said you can still use SUMIF just use the date value as the criteria:

    =SUMIF(data!$A$2:$A$100,"<="&datevalue,data!$C$2:$C$100)

    The above is assuming you want to differentiate on a calendar basis ... ie Jan 2009 will be sum of all data up to end Jan 31 2009 not the sum of all Jan data (ie Jan 2008 + Jan 2009)

  4. #4
    Registered User
    Join Date
    06-11-2009
    Location
    asd
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: Cumulative sum of different cells on different sheets

    Hi, thanks for the quick response. Unfortunately, =sumif won't work for a different worksheet right?

    I'll try to clarify, the months (Jan 08, Feb 08, etc) are merely text cells, and in the column NEXT to it (ie not part of the same cell), there are various data I require to be summed up.

    Eg: (|:stands for column break)

    Toyota Ford VW
    Jan 08 | 109,966 | 1,223,864 | 345,966
    Feb 08 | 555,163 | 553,313 | 557,111

    On a different in a different workbook, I need to compile the data as such:

    Jan 08 Feb 08 (jan+feb 08) Mar 08 (jan+feb+mar)
    Toyota | 109,966 | 109,966 + 555,163 |
    Ford | etc
    VW |
    ________________________________________________________________

    Hope this was clearer.

    In addition, could I find out how I can fix values that are linked to another worksheet? E.g. If the 109,966 above is derived from the addition of other figures in another worksheet, is there any way I can save the worksheet i'm working with as is to 'fix' the numerical values onto that so i don't need to depend on the other worksheet?

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Cumulative sum of different cells on different sheets

    A sample file would help (dummy data in confidential), you should find you can still use a SUMIF (pending format of date column) but we need to see a representative sample and your desired results.

  6. #6
    Registered User
    Join Date
    06-11-2009
    Location
    asd
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: Cumulative sum of different cells on different sheets

    Have uploaded an example. Really, REALLY appreciate help on this!
    Attached Files Attached Files

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Cumulative sum of different cells on different sheets

    Your sample file says different workbook - this is key - different workbook or different worksheet within the same workbook ?

  8. #8
    Registered User
    Join Date
    06-11-2009
    Location
    asd
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: Cumulative sum of different cells on different sheets

    It is, in fact, a different workbook.

    Therefore, daily data is compiled to give monthly data ("Raw Data" in my .xls example), which is in the same workbook. In a different workbook, I need to collate a cumulative sum (across months) of all the data by Products, as seen in the lower half of my example

  9. #9
    Registered User
    Join Date
    06-11-2009
    Location
    asd
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: Cumulative sum of different cells on different sheets

    btw, I managed to solve the problem of breaking the link between the 'raw data' and the final pdt. after making the links, I copied the original worksheet and transferred it to the workbook with the compiled data. Then, I Ctrl + R and replaced the original sheet name from "'YTD''08 JGH''s HQ " to 'YTD''08 JGH''s HQ (2)'. All my links seem to be working fine in the new workbook, so will appreciate any comments on this method of 'breaking' the links as well

  10. #10
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Cumulative sum of different cells on different sheets

    OK... so SUMIF is as you said earlier out the door if it's possible that the source file (raw data) is closed at the time of using the cumulative file as it won't work with closed files (and also your dates in A5:A16 are not date values which would make SUMIF more complex)

    So perhaps as a proof of concept of an alternative method:

    Please Login or Register  to view this content.
    There is also the possibility of using SUMPRODUCT if needed.
    Last edited by DonkeyOte; 06-15-2009 at 06:05 AM. Reason: added ISNA test re: headers in A24 onwards (to return Null)

  11. #11
    Registered User
    Join Date
    06-11-2009
    Location
    asd
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: Cumulative sum of different cells on different sheets

    hmm would you happen to know how I could break the links from a worksheet in one workbook to another? i just need the raw data (numerical values), which is in Worksheet A in Workbook 1, but the info is linked to multiple worksheets in Workbook 2. Any suggestions?

  12. #12
    Registered User
    Join Date
    06-11-2009
    Location
    asd
    MS-Off Ver
    Excel 2003
    Posts
    27

    Unhappy Re: Cumulative sum of different cells on different sheets

    Hi,

    I have created another example of what I'm talking about, with worksheets more similar to what I really need. Any help appreciated!

    (Yes, i DO have to fill up the whole sheet, hence my seeking help because as you can see from the row I have included, I am manually adding cells to get the cumulative total)
    Attached Files Attached Files

  13. #13
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Cumulative sum of different cells on different sheets

    Using this current layout (raw data) you need to analyse NAmerica & SAmerica separately on final report... if you want to combine regions whilst using a common formula across the matrix things could get quite complex... another alternative would be to use a VBA UDF but this will be slower than using native formulae and pending exposure to VBA it would obviously be more difficult for end user to adapt going forward.

    So how do you want to play it?

    Re: links - your only straightforward option is to paste the results as values in this file thereby removing formulae links ... thereafter of course the values will cease to update should the original source file be updated at a later point.

  14. #14
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Cumulative sum of different cells on different sheets

    Ignoring the issue of links re: FY09 here is a basic demo for 2008... I split N/S America as outlined and adjusted the narrative's in some cells in A (in pinkish colour) where they did not match the narrative in raw data.

    I added two helper columns (AF:AG) to reduce the number of calcs being performed (ie avoiding repetitive calcs in the results matrix)

    I was then able to apply a consistent formula across the matrix C7:N165

    Re: totals (rows 168 and below) - run a standard SUMIF against the results matrix to populate.
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    06-11-2009
    Location
    asd
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: Cumulative sum of different cells on different sheets

    Unfortunately I am completely unfamiliar with VBA. Wrt doing it seperately by regions, how would I go about doing it? As you can tell, the main 2 things I need to do is:

    convert data in column form to row form, and accumulate this data 'to date' (Feb = Jan + Feb), and so on.

    links- thanks! I actually managed to find Edit > Links > Break links for the whole document. This will work without affecting anything right?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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