+ Reply to Thread
Results 1 to 8 of 8

Counting Sick Days using rolling 12 month calendar

  1. #1
    Registered User
    Join Date
    12-19-2019
    Location
    Toronto, Canada
    MS-Off Ver
    2016
    Posts
    3

    Counting Sick Days using rolling 12 month calendar

    Hi Everyone,

    I am creating an attendance tracker that needs to be able to count all sick occurrences ('SO' in the spreadsheet) during a rolling year, starting today and going back 1 year. (Ex. I need to count Person 'A's sick occurrences from last Jan 13 2019 to Jan 13 2020.) It would need to adjust the range each day.

    I have been able to figure out how to create a range that counts backwards from a certain cell using OFFSET, but I cannot make it adjust each day. Any help would be greatly appreciated!

    Column 'I' is my attempt at the formula.

    Thanks,

    Mike

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Counting Sick Days using rolling 12 month calendar

    no sure how are you working how what "today" is on the spreadsheet?

    as have not specified in your example i have added to cell C1 formula =Today()
    you can replace with something manual if you do want to "fix" what today is

    your sample spreadsheet doesn't really show enough of spreadsheet to do rolling 12 months
    so i will show rolling 12 days instead for concept sake

    put large comment to explain the formula used

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    OFFSET(K3,0,MATCH($C$1,$K$1:$AN$1,0),,-13)

    K3,0,18,0,-13

    K3 is starting point
    0 rows from starting point
    column right from starting point is determined by what value in C1 is

    13th Jan = 17
    14th Jan = 18
    15th Jan = 19
    etc

    -13 just counts back 12 cells/days to the left
    For 12 months you would need to count back 366...
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Counting Sick Days using rolling 12 month calendar

    I put TODAY's date in C1 as well.

    Then this in I3 and filled down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Dave

  4. #4
    Registered User
    Join Date
    12-19-2019
    Location
    Toronto, Canada
    MS-Off Ver
    2016
    Posts
    3

    Re: Counting Sick Days using rolling 12 month calendar

    That is exactly what I needed! Thanks for the help!

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Counting Sick Days using rolling 12 month calendar

    Glad you found solution, and thank you for marking your thread Solved. Just out of curiosity what did you use?

  6. #6
    Registered User
    Join Date
    12-19-2019
    Location
    Toronto, Canada
    MS-Off Ver
    2016
    Posts
    3

    Re: Counting Sick Days using rolling 12 month calendar

    I actually did not see your post until after I marked this as solved. So I'm using humdingaling's solution.
    Out of curiosity, I tested both solutions and both worked. Any idea which formula requires less computing power?

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Counting Sick Days using rolling 12 month calendar

    No I don't.

    Too often the answers begin with ... "it depends".

    Of note though. The OFFSET function is volatile. This usually isn't an issue, but when it becomes one it can be frustrating and maybe confusing if you are not aware volatility, its effects, what to look for and how to remedy it. That said you might find this article helpful.

  8. #8
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Counting Sick Days using rolling 12 month calendar

    i used offset because that's the method you had started out with and it seemed that you understood the principles behind the formula

    Depending on your actual spreadsheet size (in terms of data) you may or may not actually see the difference

    The sumproduct solution "should" use computing power for the reasons pointed out by Dave
    if you are working with large data set and you understand sumproduct works (to me, understanding offset was easier than sumproduct)
    than i would suggest using his solution, its far more robust and easier to "fix" should it be required

+ 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. Calculating number of sick days in a rolling year
    By nikkie456 in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 09-18-2016, 05:53 PM
  2. Excel SumProduct and Countif Rolling Sick Days
    By Antony1979 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-04-2016, 04:05 AM
  3. Calculating Number Of Sick Days In A Rolling Year - Exc
    By sansan88 in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 08-24-2015, 02:59 PM
  4. Replies: 0
    Last Post: 06-11-2015, 03:12 AM
  5. Calculate sick absence by days per month.
    By Pegs in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-10-2013, 06:57 AM
  6. [SOLVED] Counting number of days sick per condition
    By burnsie in forum Excel General
    Replies: 3
    Last Post: 03-08-2013, 05:42 AM
  7. Counting Vacation or Sick Days within a Specified Time Period
    By Rhonda Hewett in forum Tips and Tutorials
    Replies: 1
    Last Post: 08-23-2005, 12:37 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