+ Reply to Thread
Results 1 to 16 of 16

Sum 7 days of information based on week ending date

  1. #1
    Registered User
    Join Date
    03-14-2013
    Location
    Perth, Singapore
    MS-Off Ver
    Excel 2010
    Posts
    13

    Sum 7 days of information based on week ending date

    Hi all,

    I'm making a register to track energy savings since installing skylights in some buildings and need to summarise the data (in a table and then graphically represent). The light usage for each building is tracked daily, and I need to sum 7 days of information based on the week ending date. Eg. If the date of the week ending is the 7th June 2013, I need to sum the 1st-7th June for each house.

    I can manage the formula manually, but I need a formula that I can drag down to go on for several years if required (as I will not be managing this forever).

    I have attached the workbook, and the 'Light Usage' tab is the same data as the House 1 and 2 (just in a different format). I had trouble with the formulas due to the format in the 'Light Usage' tab, but this would be the preferred tab to keep if possible (rather than having 2 or more).

    Any help is much appreciated!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Sum 7 days of information based on week ending date

    The set up of the sheets of the 2 (houses) is the same.

    You mind using VBA to consolidate the data?

    You're familiar with pivot tables?

    If so I could make an solution for you.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Valued Forum Contributor
    Join Date
    07-17-2005
    Location
    Abergavenny, Wales, UK
    MS-Off Ver
    XL2003, XL2007, XL2010, XL2013, XL2016
    Posts
    608

    Re: Sum 7 days of information based on week ending date

    Hi

    You can Summarize the data very easily with a Pivot Table.
    I created Tables from your data on sheets House 1 and House 2, which I called t_house1 and t_house2 respectively
    For convenience, I added an extra field called Year to each table with the formula =YEAR([@Date])

    Then each table was summarised with a Pivot Table, with a Grouping on Date into 7 day periods. Year was taken to the Report Filter area, so that you can limit your view to a single year or any aggregate of years.

    If you wanted, you could copy all the data from each table to a new table, with the insertion of a field for House number, and then base the PT on the new combined data.
    Unfortunately, you list yourself as having XL2007, so you won't have Power Pivot available.
    If you had XL2010 or later, then with Power Pivot you could take data from each table into a combined Pivot Table.

    Please note, I saved the file in .xlsb format in order to reduce the file size below the limit for uploading to this formum.
    Attached Files Attached Files
    --
    Regards
    Roger Govier
    Microsoft Excel MVP

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Sum 7 days of information based on week ending date

    I used the macro below to consolidate the data on 1 sheet (consolidated).

    After that I add the UDF WeeknumberISO (in the table).

    After that I made an pivot table of it.

    See the attached file.

    Your file was to big to post, so I deleted the summuray sheet.

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-14-2013
    Location
    Perth, Singapore
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Sum 7 days of information based on week ending date

    Hi guys,

    Thanks for the quick replies!

    The pivot tables/consolidated date are a great idea, but unfortunately it makes the data entry section difficult to interpret and this register will be used by those that are not very good with computers. The data will pretty much need to stay as is so that the average person can still look at it and understand what the numbers mean.

    I was thinking something along the lines of a SUMIF with the data calculated between two dates (based on the date in the Summary sheet).

  6. #6
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Sum 7 days of information based on week ending date

    Please Login or Register  to view this content.
    an average person can still look at it and understand what the numbers mean (using an sumif formula)?

  7. #7
    Registered User
    Join Date
    03-14-2013
    Location
    Perth, Singapore
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Sum 7 days of information based on week ending date

    Yer because something like that won't be affecting the source data like consolidating it using a pivot table.

  8. #8
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Sum 7 days of information based on week ending date

    But using sumif you also have an differant sheet (or range) where you have to put your formula.

    I think it's not an better solution.

    Why not trying to learn the other people to work with an pivot table.

    It is an extreme powerful tool, which MS expands on every version of excel.

    My suggestion would therefor be learn and use pivottables.

    It also reduces the changes on faillures (in the formula).

  9. #9
    Registered User
    Join Date
    03-14-2013
    Location
    Perth, Singapore
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Sum 7 days of information based on week ending date

    oeldere,

    I 100% agree with you. Pivot tables are fantastic and I use them in the registers that I manage (as I know how to use them), however, I am not in a position to make a large group of people with almost no computer skills learn to use them.

    The formula does not need to be a SUMIF, that was only a suggestion/theory.

  10. #10
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Sum 7 days of information based on week ending date

    Then split the job.

    Other people do the input.

    You summurize the data an makes the (pivot table) reports (and graphs).

  11. #11
    Registered User
    Join Date
    03-14-2013
    Location
    Perth, Singapore
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Sum 7 days of information based on week ending date

    Quote Originally Posted by oeldere View Post
    Then split the job.

    Other people do the input.

    You summurize the data an makes the (pivot table) reports (and graphs).
    That is not a solution to my problem. If that were a sustainable solution then I would continue to do weekly reports (as I currently do). However, it is not my job and it was only ever done as a favour.

    I'm sorry, but as good as your solution is it is not really suitable for my needs.

  12. #12
    Registered User
    Join Date
    03-14-2013
    Location
    Perth, Singapore
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Sum 7 days of information based on week ending date

    Quote Originally Posted by oeldere View Post
    Then split the job.

    Other people do the input.

    You summurize the data an makes the (pivot table) reports (and graphs).
    That is not a solution to my problem. If that were a sustainable solution then I would continue to do weekly reports (as I currently do). However, it is not my job and it was only ever done as a favour.

    I'm sorry, but as good as your solution is it is not really suitable for my needs.

  13. #13
    Valued Forum Contributor
    Join Date
    07-17-2005
    Location
    Abergavenny, Wales, UK
    MS-Off Ver
    XL2003, XL2007, XL2010, XL2013, XL2016
    Posts
    608

    Re: Sum 7 days of information based on week ending date

    Hi

    I don't see what the users have to learn about Pivot Tables?
    If you have set up the PT, then all they do is input exactly as present.
    providing you can accept some VBA inclusion, then the PT can be made to automatically refresh when the sheet is activated.


    On sheet New Summary insert

    Please Login or Register  to view this content.
    Alternatively, you could hide my New Summary sheet altogether, and consolidtae the PT's into your Summary sheet by inserting the formula
    =GETPIVOTDATA(""&C$2,'New Summary'!$A$5,"Week Ending",$B3)+GETPIVOTDATA(""&C$2,'New Summary'!$J$5,"Week Ending",$B3)
    into cell C3 and copying across and down

    You just need to ensure that the headings in C2:G2 of your Summary sheet are identical to those used in cells B5:F5 of sheet New Summary

    In which case insert the following event code on Sheet Summary

    Please Login or Register  to view this content.
    I see little point in writing formulae with SUMIF, SUMPRODUCT or anything else, when you can use the PT to do all the "heavy lifting" for you, and then simply use GetPivotData to pull the results across to your Summary.

    The GetPivotData formula can be simplified to
    =GETPIVOTDATA(""&C$2,House1,$B$2,$B3)+GETPIVOTDATA(""&C$2,House2,$B$2,$B3)

    if you Name House1 = $A$5 and House2 = $J$5 on sheet New Summary
    Then if you had more Houses and more PT's, it is easy to extend the formula by adding everything from the "+" onward, and just changing the House number.
    Attached Files Attached Files

  14. #14
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Sum 7 days of information based on week ending date

    @Roger Govier

    Reading your solution , I think this could work for you and me.

    But if even an sumif or sumproduct formula is to difficult for the people who have to work with the file, your solution also will not be suitable for OP needs.

  15. #15
    Registered User
    Join Date
    03-14-2013
    Location
    Perth, Singapore
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Sum 7 days of information based on week ending date

    oeldere, I do not see how a formula will be confusing when all it will do is spit out the numbers. The users will have no need to touch the formulae if one is ever obtained (which is looking unlikely).

    Roger Govier, thanks. I'll give it a go.

  16. #16
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Sum 7 days of information based on week ending date

    @tayanamarie

    And what if the formula is deleted or changed by the people?

    If they have that less experiance with excel that would be an problem too.



    You can only solve this problem by learning people (how to work with excel).


    Other solution would be making an button on the sheet, which will run the macro to consolidate the sheets.

    A pivot table is just drag and drop (it's very easy to learn).

+ 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. Sheets for every week + start and ending date of the week
    By wimexcel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-30-2012, 01:48 PM
  2. [SOLVED] Calculating a week of dates/days based on the beginning date entered...
    By tiffany04530 in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 11-27-2012, 09:55 AM
  3. [SOLVED] Pull information based on week date falls under
    By mjhopler in forum Excel General
    Replies: 1
    Last Post: 06-19-2012, 11:54 AM
  4. Week ending date help
    By PRodgers4284 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-12-2009, 05:07 AM
  5. week ending date?
    By SRussell in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-11-2008, 06:42 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