+ Reply to Thread
Results 1 to 16 of 16

Sum every 7 days

Hybrid View

prudential Sum every 7 days 01-12-2017, 03:51 AM
JBeaucaire Re: Sum every 7 days 01-12-2017, 04:16 AM
JohnTopley Re: Sum every 7 days 01-12-2017, 04:18 AM
prudential Re: Sum every 7 days 01-12-2017, 04:28 AM
JBeaucaire Re: Sum every 7 days 01-12-2017, 11:41 AM
prudential Re: Sum every 7 days 01-12-2017, 08:16 PM
JBeaucaire Re: Sum every 7 days 01-13-2017, 01:42 AM
prudential Re: Sum every 7 days 01-13-2017, 02:19 AM
JBeaucaire Re: Sum every 7 days 01-13-2017, 03:32 AM
prudential Re: Sum every 7 days 01-13-2017, 04:00 AM
prudential Re: Sum every 7 days 01-13-2017, 04:14 AM
JBeaucaire Re: Sum every 7 days 01-13-2017, 04:18 AM
prudential Re: Sum every 7 days 01-13-2017, 04:27 AM
JBeaucaire Re: Sum every 7 days 01-13-2017, 07:34 PM
prudential Re: Sum every 7 days 01-14-2017, 09:39 AM
JBeaucaire Re: Sum every 7 days 01-14-2017, 01:16 PM
  1. #1
    Forum Contributor
    Join Date
    10-28-2014
    Location
    Sydney
    MS-Off Ver
    Professional 2010
    Posts
    151

    Sum every 7 days

    Hi, can someone pls help. I need it to calculate the weekly sum in the C column.

    i.e. every 7 days there should be a number in the C column showing the profit/loss for that week.

    thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Sum every 7 days

    Use a PIVOT TABLE.

    1) First you need to add a column to your table to extract just the date.
    C1: Date
    C2: =INT(A2)
    Copy C2 down and format as short date.

    2) Highlight columns A:C and choose INSERT > PIVOT TABLE > Existing Worksheet (click on G1) > OK

    3) Put the DATE field in as Row Labels
    Put the Trade P/L field as Values and use the FIELD SETTINGS to change it to SUM of Trade P/L

    4) Right-Click on any date in column G of the pivot table and select GROUP> By DAYS > Number of days: 7 > OK
    You can set the starting date specifically to the date you want the "first day of first week", if you wish.


    Done. Should look like this:
    https://www.screencast.com/t/hJLqh7VKg
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    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,768

    Re: Sum every 7 days

    The dates are mm/dd/yy hh:mm? and some fields are formatted as GENERAL so Your data needs tidying up.

  4. #4
    Forum Contributor
    Join Date
    10-28-2014
    Location
    Sydney
    MS-Off Ver
    Professional 2010
    Posts
    151

    Re: Sum every 7 days

    Thanks for the assistance.

    Tried int(A2) and got mostly #VALUE! errors.

    BTW, this is a CSV download. I wouldnt create this garbage
    Last edited by prudential; 01-12-2017 at 04:30 AM.

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Sum every 7 days

    I didn't get any errors on the data you uploaded. Maybe:

    =INT(TRIM(A2))

  6. #6
    Forum Contributor
    Join Date
    10-28-2014
    Location
    Sydney
    MS-Off Ver
    Professional 2010
    Posts
    151

    Re: Sum every 7 days

    Quote Originally Posted by JBeaucaire View Post
    I didn't get any errors on the data you uploaded. Maybe:

    =INT(TRIM(A2))
    Thanks for your assistance.

    OK, that seems to work for all the cells that have "AM" to the right of the cell but not for the others. How about we try to add "AM" to all cells that dont have it. Would CONCATENATE do this?

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Sum every 7 days

    No, the AM PM in time cells are simply a display "trick". Unless your real data is not what it appears to be. You would need to show me the actual problem workbook.

  8. #8
    Forum Contributor
    Join Date
    10-28-2014
    Location
    Sydney
    MS-Off Ver
    Professional 2010
    Posts
    151

    Re: Sum every 7 days

    File added with both forumulas applied to colum c & d

    Please review.
    Attached Files Attached Files

  9. #9
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Sum every 7 days

    As noted before, the AM/PM thing isn't usually real, just a formatting trick of Excel. Both C & D look correct to my eye:
    https://www.screencast.com/t/GuGwoc8C

  10. #10
    Forum Contributor
    Join Date
    10-28-2014
    Location
    Sydney
    MS-Off Ver
    Professional 2010
    Posts
    151

    Re: Sum every 7 days

    Thanks for your assistance.

    Put simply, what do I need to do to get the same result as you? My formulas are exactly the same but its showing up different (ie. with #VALUE! errors)

  11. #11
    Forum Contributor
    Join Date
    10-28-2014
    Location
    Sydney
    MS-Off Ver
    Professional 2010
    Posts
    151

    Re: Sum every 7 days

    Clearly you're playing games because I just formatted the A column in 5 seconds using Find and Replace.

    Thanks for your help.

  12. #12
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Sum every 7 days

    No, I'm not playing games. Interesting comment that one...

    Anyway, I am glad you found a workaround for a problem you saw on my videos I was not having with your workbook. Probably some regional thing...

    So, the Pivots are working for you now?

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

  13. #13
    Forum Contributor
    Join Date
    10-28-2014
    Location
    Sydney
    MS-Off Ver
    Professional 2010
    Posts
    151

    Re: Sum every 7 days

    The group by days function isnt available. If I select one cell it says "group not available" when I select multiple cells it groups those cells but no group by days option comes up.

  14. #14
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Sum every 7 days

    ok, then something is definitely up with your system. The GROUP function works numeric cells and as you say in my video using your workbook, my system has detected your dates as actual dates which are secretly numeric in the background, but on your system I'm going to guess your system things those cells are text. It looks like dates to your eye, but in the background its not.

    I'm guessing. Usually the problems people have in their workbooks we can see, too. Hmm, what to do?

    Are you up for a quick Teamviewer session? That would let me peek over your shoulder directly on your computer, maybe I can suss it out.

    Send me a Private Message or reach out to me on Skype and can talk directly, see what we see.
    Skype: Jerry Beaucaire (devtuxx7069)

  15. #15
    Forum Contributor
    Join Date
    10-28-2014
    Location
    Sydney
    MS-Off Ver
    Professional 2010
    Posts
    151

    Re: Sum every 7 days

    Its OK, I changed my system and excel locale and got it working. Plus cleaned up the dates a bit more.

    BTW, this doesnt tell me the weekly profit, all it does is group the profit into 7 day blocks. There's weeks where there is no income but it doesnt show this.

    I'll just work out the weekly income for the period which should be good enough.

    Thanks.
    Last edited by prudential; 01-14-2017 at 09:46 AM.

  16. #16
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Sum every 7 days

    At the point of creation of the Pivot table, you can manually set the START date to insure the 7-day blocks are in the correct weekly groupings as well. The Pivot tools have so many variations...

+ 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. A number of days into weeks and days-How do you convert the decimal part of 0.571429
    By Robert Christie in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-25-2020, 09:37 PM
  2. [SOLVED] calculate total number of days between two days based on 365 days year
    By aparunkumar in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 03-14-2016, 12:51 AM
  3. Formula for vacation days earned annualy with additional days at a milestone
    By poTATEohhh in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-29-2015, 08:40 AM
  4. Replies: 0
    Last Post: 06-11-2015, 03:12 AM
  5. [SOLVED] Count 6 working days (excluding Sunday, Holidays & half days)
    By eve_star1 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-29-2015, 08:00 AM
  6. Replies: 4
    Last Post: 05-19-2014, 04:28 PM
  7. Work Schedule that calculates hours, lunches, days off and vacation days
    By tameronstarr in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-12-2014, 12:06 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