+ Reply to Thread
Results 1 to 15 of 15

Calculating number of sick days in a rolling year

  1. #1
    Registered User
    Join Date
    09-10-2013
    Location
    Basingstoke, England
    MS-Off Ver
    Excel 2007
    Posts
    6

    Smile Calculating number of sick days in a rolling year

    Hi I would welcome any guidance you could give me about calculating the number of days in a rolling year.

    The items below are my column headings

    First Day of Absence/Last Day of Absence/number of days off/number of sick days within a 12 month period/number of sick periods in 12 month period

    Example data

    Column A First day = 13/08/2013
    Column B Last Day = 20/08/2013
    Column C Number of days off - I have used =NETWORKDAYS(a2,c2)

    Column D No of sick days within 12 months - This is where I need help I need a formula that will look at the Date in column B and then calculate how many days have been taken in the previous 12 months

    Column E No Sick periods - Again how do I calculate the amount of times opposed to days that someone has been off.

    Any help would be greatly appreciated

    Thank you

  2. #2
    Forum Contributor
    Join Date
    08-14-2013
    Location
    Here and there
    MS-Off Ver
    Excel 2010
    Posts
    376

    Re: Calculating number of sick days in a rolling year

    Hi, have a look at the simple example attached.

    SICK DAYS.xlsx

  3. #3
    Registered User
    Join Date
    09-10-2013
    Location
    Basingstoke, England
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Calculating number of sick days in a rolling year

    Thank you for your help, but as soon as I enter a date which would be excluded within the 12 month period it still adds the days on rather than excluding days outside of the 12 month range. Not sure what to do next

  4. #4
    Forum Contributor
    Join Date
    08-14-2013
    Location
    Here and there
    MS-Off Ver
    Excel 2010
    Posts
    376

    Re: Calculating number of sick days in a rolling year

    OK I've been working on another that excludes days older than 360 days - not perfect but getting closer

    SICK DAYS.xlsx

  5. #5
    Forum Guru Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Calculating number of sick days in a rolling year

    Try this: Sick Days.xlsx

  6. #6
    Forum Contributor
    Join Date
    08-14-2013
    Location
    Here and there
    MS-Off Ver
    Excel 2010
    Posts
    376

    Re: Calculating number of sick days in a rolling year

    @OllyXLS - very cool, however the formula in col D "Number of sick days in the past 12 months" doesn't work ... sorry. In A2 in put 3/07/2012 and in B2 6/07/2012 and it still counted these days within the "last 12 months", so let's keep working on this but I do like your spreadsheet.

  7. #7
    Forum Guru Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Calculating number of sick days in a rolling year

    Quote Originally Posted by Ursul View Post
    @OllyXLS - very cool, however the formula in col D "Number of sick days in the past 12 months" doesn't work ... sorry. In A2 in put 3/07/2012 and in B2 6/07/2012 and it still counted these days within the "last 12 months", so let's keep working on this but I do like your spreadsheet.
    I should have explained my interpretation of the requirement: for each row, my worksheet calculates the number of sick days / sick periods in the 12 months preceding the end date of this row's sick period. It also relies on keeping the sick periods sorted in ascending date order.

    If you simply want to calculate these for the 12 months preceding today, then simple sumif / countif functions will work, assuming columns A:C remain as defined:

    Number of sick days; =SUMIF($B:$B,">="&TODAY()-365,$C:$C)
    Number of sick periods: =COUNTIF($B:$B,">="&TODAY()-365)

  8. #8
    Forum Contributor
    Join Date
    08-14-2013
    Location
    Here and there
    MS-Off Ver
    Excel 2010
    Posts
    376

    Re: Calculating number of sick days in a rolling year

    I have made some adjustments to your spreadsheet and now it seems to work and not count anything older than 1 year.

    SICK DAYS01.xlsx

  9. #9
    Registered User
    Join Date
    09-10-2013
    Location
    Basingstoke, England
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Calculating number of sick days in a rolling year

    Wow - thank you so much, this forum is great!

    Looking at how the formula works, I have now decided to only have the rolling information in one place above the table and it will make the collating of data from each sheet far easier.

    I have then used =COUNTIF(B13:B99,">"&C7-365) to calculate the number of sick episodes in one year.

    Sheet is very scruffy but have attached so you can see
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    08-14-2013
    Location
    Here and there
    MS-Off Ver
    Excel 2010
    Posts
    376

    Re: Calculating number of sick days in a rolling year

    Well done Nikkie - if you are happy please mark the Thread as Solved - go to your first post top-right click on Thread Tools and mark Solved. If I have helped please click on "Add Reputation" (bottom-left) of my post.

    Cheers

  11. #11
    Registered User
    Join Date
    01-20-2015
    Location
    Michigan, USA
    MS-Off Ver
    2010
    Posts
    1

    Re: Calculating number of sick days in a rolling year

    Can you help me figure out hw to modify your file "Book1.xlsx" to calculate sick days in rolling 6 month time frame?

  12. #12
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    11,981

    Re: Calculating number of sick days in a rolling year

    CassConnors,
    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.


    Want to get your question answered quickly?
    1. Ensure your question is not too vague. Don't assume anyone is familiar with your problem. While you can upload small attachments, describe your problem in the body of the post. We are fortunate to have several Excel gurus, but few mind-readers.
    2. On the other hand, skip irrelevant details. Be descriptive and concise. Short, direct, and to-the-point questions with apt thread titles are almost always answered promptly.
    3. Keep the scope reasonably narrow. Questions like, "How do I set up an accounting system in Excel?" might be a long time waiting.
    4. Explain what you've already tried. ("Calculation is set to automatic, but formulas still don't compute") so helpers don't waste your time or theirs.
    5. Post a WORKBOOK. Nobody wants to type data from a picture or paste text from your post into a spreadsheet as a prelude to helping. To attach a file, push the button with the paperclip (or scroll down to the Manage Attachments button), browse to the required file, and then push the Upload button.
    6. If your question has not been answered within a day, consider adding another post with any additional information you believe is relevant. If you think your post is good as is, just reply to your own thread with the words "Bump no response", which will bring it to the top of the forum.
    Ben Van Johnson

  13. #13
    Registered User
    Join Date
    09-16-2016
    Location
    UK
    MS-Off Ver
    2010
    Posts
    2

    Re: Calculating number of sick days in a rolling year

    Hi,

    A very interesting thread, and thanks to nikkie456 for starting it and all the answers. I think there's still a problem with these and I wonder if someone can help correcting this, or me if I've misunderstood.

    I'm not using the NETWORKDAYS because I'm interested in overall days, so I'm replacing that with =B2-A2 (EndDate-StartDate), but I think the problem is the same. Here are two scenarios where I think the calculation isn't coming out correctly.

    Start ]End Count Count365 Expected365
    01/08/2015 10/10/2015 70 70 70
    01/09/2016 01/10/2016 30 100 69
    The problem in the example above is that the entire period of the earlier date is counted, not just the part of that period that's within 365 days of the end of the second period.


    Start End Count Count365 Expected365
    01/0/2015 30/09/2015 29 29 29
    10/09/2016 01/10/2016 21 21 50
    The problem with this example is that none of the first period is counted, but only the first nine days should be omitted.

    Can anyone help with correcting these issues - I'm sure it will affect the working week version in the same way.

    Thanks

  14. #14
    Forum Guru Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Calculating number of sick days in a rolling year

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  15. #15
    Registered User
    Join Date
    09-16-2016
    Location
    UK
    MS-Off Ver
    2010
    Posts
    2

    Re: Calculating number of sick days in a rolling year

    Oh? Sorry, I thought this was a continuation of the original question - the answer isn't complete. My question is the same as the original question, it's not a new question?

+ 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. Sick pay rolling year conundrum
    By y_not in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-21-2013, 06:06 PM
  2. Calculating number of days in leap year
    By raw_geek in forum Excel General
    Replies: 9
    Last Post: 03-16-2012, 11:39 AM
  3. Calculating accrual of sick days
    By wbcsc in forum Excel General
    Replies: 6
    Last Post: 04-13-2010, 02:57 PM
  4. Calculating Sick Days
    By Poppachuck in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-10-2009, 06:58 PM
  5. Adding sick occurances in a rolling year
    By jarontea in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-13-2008, 05:14 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