+ Reply to Thread
Results 1 to 9 of 9

How to get the total number of days of each person per week?

  1. #1
    Registered User
    Join Date
    04-30-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    6

    Unhappy How to get the total number of days of each person per week?

    I want to get the sum of days per person for every week.

    I used a SUMPRODUCT formula here that gets the total number of days per week. But in my case, I need to sum up the total days of each resource per week. But it's not working.

    =IF(NAME=D3,SUMPRODUCT(--(INT((DATE-(DATE(YEAR(DATE),1,1)-WEEKDAY(DATE(YEAR(DATE),1,1)-1)))/7)+1=RIGHT(G1,2)+0),$C$2:$C$1048576),0)

    Please help. Thanks.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    11-26-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    159

    Re: How to get the total number of days of each person per week?

    Hi

    find the attachment
    It may help you
    I have created pivot table.
    Attached Files Attached Files

  3. #3
    Forum Contributor bonny24tycoon's Avatar
    Join Date
    04-02-2012
    Location
    Hell
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    405

    Re: How to get the total number of days of each person per week?

    Hi kairab,

    I did not try a formula. But Pivot works great too sometimes

    I just added a week formula and dragged all columns to fit them into a pivot.

    Try this and let me know if you are getting the expected result. Book2.xlsx


    Thanks,

    Bonny Tycoon



    **If I was able to help please click the small star icon at the bottom left of my post **

  4. #4
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: How to get the total number of days of each person per week?

    First, rename your range DATE to DATES (DATE is a function, and you are using it), then try

    =SUMPRODUCT(--(NAME=$E2),--(INT((DATES-(DATE(YEAR(DATES),1,1)-WEEKDAY(DATE(YEAR(DATES),1,1)-1)))/7)+1=--RIGHT(F$1,LEN(F$1)-FIND(" ",F$1))),DAYS)

  5. #5
    Registered User
    Join Date
    03-13-2012
    Location
    Stafford, England
    MS-Off Ver
    Excel 2007
    Posts
    87

    Re: How to get the total number of days of each person per week?

    Hiya mate,

    I do it this way and just hide the column and row in yellow.

    kariab.xlsx

  6. #6
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: How to get the total number of days of each person per week?

    My alternative:
    Put start reference date in cell E1 (I used Jan 1, 2012) and change the heading in F1 to Week 1 (instead of Week 2) and go up from there across next columns
    In cell F2: =SUMIFS($C:$C,$A:$A,$E2,$B:$B,"<="&$E$1+COLUMNS($E:E)*7)
    In cell G2 (and dragged across): =SUMIFS($C:$C,$A:$A,$E2,$B:$B,"<="&$E$1+COLUMNS($E:F)*7)-SUM($F2:F2)

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: How to get the total number of days of each person per week?

    Hi,

    Rather than SUMPRODUCT (which was generally the favoured approach before Excel 2007 came along) you should be using the more efficient SUMIFS() function.

    And rather than just putting week 2, week3 etc. as your column headers you should be using proper week ending dates so that the SUMIFS() function can use them.

    So with the date 2/1/2012 in F1, 9/1/2012 in G1 etc. (or 1/2/2012 & 1/9/2012 if you use the US format for dates) in F2 copied down and across

    =SUMIFS(C1:C61,A1:A61,A2,B1:B61,">="&F$1,B1:B61,"<"&F$1+7)
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  8. #8
    Forum Contributor
    Join Date
    01-24-2011
    Location
    Sheppey
    MS-Off Ver
    Excel 2010
    Posts
    239

    Re: How to get the total number of days of each person per week?

    See attached sheet for possible answer using a week number in a Sumproduct formula.
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    02-22-2011
    Location
    Rhône Alpes, France
    MS-Off Ver
    Excel 2007
    Posts
    201

    Re: How to get the total number of days of each person per week?

    Hi,
    See attached a variant with pivot table
    Put the data in a table : automaticaly update when inserting or deleting data
    The weeks are obtain with the group function
    Don't forget to refresh the PT when input new data
    Hope this helps
    Best regards
    Attached Files Attached Files

+ 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