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

anitaturnbull

New Member
Joined
Feb 3, 2016
Messages
4
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?
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Forum statistics

Threads
1,215,248
Messages
6,123,877
Members
449,130
Latest member
lolasmith

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top