+ Reply to Thread
Results 1 to 6 of 6

Sum by week Formula

  1. #1
    Registered User
    Join Date
    10-11-2017
    Location
    UK
    MS-Off Ver
    2016
    Posts
    58

    Sum by week Formula

    Hi,

    I have been tasked with adding KPI's to my companies attendance tracker.
    Currently working on the Pass Outs that have been issued

    I currently have the below formula working, it counts the number of days leave which meet certain criteria.
    Please Login or Register  to view this content.
    The criteria for tbl_Leave[Start Date] & tbl_Leave[End Date] are set at present to use the DATE function with me manually setting the day criteria i.e. 1-7(Week 1), 8-15(Week 2) etc etc.
    I can see this becoming an issue in the future when the year changes as the dates will change per week.

    I would like to know if there is a way the formula can look at the Start & End date columns on the leave table and determine if the dates meet the week numbers above the yellow boxes on the pass out sheet.

    Capture.PNG

    I have attached a sample file, some of the pages are locked out but i can unlock additional pages if absolutely neccasary.

    Thanks Mark
    Attached Files Attached Files

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Sum by week Formula

    So your week is Mon to Sun.

    But do you use ISO Week numbering or standard Excel week number?

    For 2018, Jan 1st fell on Monday so there isn't difference, but for 2017.
    =ISOWEEKNUM(Date(2017,1,1))
    =WEEKNUM(Date(2017,1,1),2)

    Will return different result. For ISOWeeknum = 52, WEEKNUM = 1

    That would dictate how you should calculate your date range.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Registered User
    Join Date
    10-11-2017
    Location
    UK
    MS-Off Ver
    2016
    Posts
    58

    Re: Sum by week Formula

    Yes Mon to Sun is working week

    =WEEKNUM would be the way to go

    Thanks

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Sum by week Formula

    Assuming you have some cell holding year value (I used c13)

    For week start.
    =MAX(DATE(C13,1,1),DATE(C13,1,1)-WEEKDAY(DATE(C13,1,1),2)+(D13-1)*7+1)

    For week end.
    =MIN(DATE(C13+1,1,0),DATE(C13,1,1)-WEEKDAY(DATE(C13,1,1),2)+D13*7)

    See attached.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-11-2017
    Location
    UK
    MS-Off Ver
    2016
    Posts
    58

    Re: Sum by week Formula

    CK76 that works a treat

    I have updated the year value to reference mt calendar year from the settings page and works perfectly.

    Many Thanks

  6. #6
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Sum by week Formula

    You are welcome and thanks for the rep

+ 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: 5
    Last Post: 04-11-2017, 09:23 AM
  2. Replies: 10
    Last Post: 03-15-2016, 05:16 PM
  3. Replies: 4
    Last Post: 11-14-2015, 12:13 PM
  4. [SOLVED] Need help auto-updating a formula for week over week change
    By yanger87 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-14-2015, 12:45 PM
  5. [SOLVED] Week-wise sum formula on customized week (Mon-Sun)
    By nagesh.tvsr in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-30-2014, 05:03 AM
  6. Replies: 4
    Last Post: 04-25-2014, 12:30 PM
  7. Replies: 11
    Last Post: 04-06-2011, 02:33 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