Calculate the number of day between two only dates during the past rolling year??


New Member
Feb 3, 2016
I am trying to create a sick leave counter that counts leave days during the past rolling 12 months. I have the cell set up to count today as the end date if there is not an end date avaialable. Here is my set up.

Cell A2 is the start date (2/1/15)
Cell B2 is the return date (2/3/16)
Cell C2 is =IF(S2="","",(IF(B2>0,B2-A2,TODAY()-A2)))

If I use 2/1/15 as the start date in A2 and assume todays date 2/3/16 in B2, it returns an answer of 367. However, I don't want it to count it if it is more than 1 year old. Any ideas how I could accomplish this?

Forum statistics

Latest member

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...