Forum

Notifications
Clear all

Formula to calculate sick days from hire date based on current date

17 Posts
4 Users
0 Reactions
544 Views
 CJ18
(@cj18)
Posts: 7
Active Member
Topic starter
 

I need to create a formula that calculates the number of sick days an employee gets from hire date (1 day at 6 mos, 2 days at 1 yr, 3 days at 2 yrs, 4 days at 3+ yrs) based upon the current date at any given time [i.e. TODAY()].  I have attached a file and indicated the column where the formula is needed.  Every thing I try seems to ignore the first 6 mos from hire date. Can you please help me? Thank you!!! 

 
Posted : 31/08/2016 5:23 pm
(@adrianutas)
Posts: 16
Active Member
 

Hello CJ18,

I had a look and I cannot see a problem with the formula. If I go down to line 195 and change the date for Employee # 16ZAH so that they started in the last 3 months - their calculation for days to add at next anniversary shows 0.
If I amend that start date to show as 7 months ago, it changes to 1.

Is that not what the formula is supposed to do? Or are you wanting it to have the 1 in place prior to the anniversary date passing? (in which case all the "0" values in the formulas at the end would need to change to 1).

I also noted that the 'A type" employees after line 196 have a slightly different formula in the K column, such that all values are 4. Perhaps this is causing an issue?

Other than that, I was a little unclear on what the group of 3 columns was trying to achieve, and whether it was actually column M where you wanted the formula.

Cheers,
Adrian

 
Posted : 31/08/2016 10:08 pm
(@fravis)
Posts: 337
Reputable Member
 

Same conclusions and questions as Adrian has. It seems to work as intended. Maybe you can tell us which line doesn't give the 'right' number and what you expect there, so we understand what you think is going wrong?

Only thing I see is that D3 is formatted as date and the dates in columns D:H as 'special', but I don't think that's something that's bothering here.

And I'm not sure what you want with columns L and M? Is there where the problem is? 

 
Posted : 01/09/2016 3:21 am
 CJ18
(@cj18)
Posts: 7
Active Member
Topic starter
 

I marked at the top of the spreadsheet, Column M is the column where the formula is needed, but that was before I deleted the names.  It should be Column L that needs the formula, my apologies.  The 'A Type' employees are salaried and do have a different formula, so I am not concerned about them so much.  Column K indicates the number of days the employee is to receive at their anniversary, but not until they reach their anniversary date. Column L is supposed to reflect what is available based upon the current date (i.e. D3).  So, the difficulty I'm having is that when I get it to recognize what the employee should receive, then I can't seem to figure out how to get it to recognize that 'TODAY' may be before their anniversary date, so it should show 0.  Thank you for your input and suggestions!

 
Posted : 01/09/2016 10:42 am
(@sunnykow)
Posts: 1417
Noble Member
 

Is column M as per your file your expected answer?

 
Posted : 01/09/2016 10:50 am
(@sunnykow)
Posts: 1417
Noble Member
 

Try this in column L

=IF(OR(E7>$D$3,I7>=$D$3),0,K7)

 
Posted : 01/09/2016 11:21 am
(@sunnykow)
Posts: 1417
Noble Member
 

Sorry change to

=IF(OR(E7>$D$3,I7>$D$3),0,K7)

 
Posted : 01/09/2016 11:24 am
 CJ18
(@cj18)
Posts: 7
Active Member
Topic starter
 

Thanks SunnyKow, but I'm still not getting a 1 for the employees who have reached their 6 mos.  That continues to be my issue.  I did take the suggestion of Frans Visser and change the columns to dates from custom. 

 
Posted : 01/09/2016 11:29 am
(@sunnykow)
Posts: 1417
Noble Member
 

Hi

Just let us know which cells are not correct and what are the expected results. It is very difficult for us to make a guess.

 
Posted : 01/09/2016 11:46 am
 CJ18
(@cj18)
Posts: 7
Active Member
Topic starter
 

Hi,

For instance, when I insert the suggested formula of: =IF(OR(E7>$D$3,I7>$D$3),0,K7) into Column L, the following employees [02JWC, 02RR, 02SNS, 03CML] are showing "0" and I need them to show "1."  

 
Posted : 01/09/2016 11:52 am
(@sunnykow)
Posts: 1417
Noble Member
 

Neither of them have reached the anniversary date yet so they show 0 as what you have requested below.

"So, the difficulty I'm having is that when I get it to recognize what the employee should receive, then I can't seem to figure out how to get it to recognize that 'TODAY' may be before their anniversary date, so it should show 0."

 
Posted : 01/09/2016 11:57 am
 CJ18
(@cj18)
Posts: 7
Active Member
Topic starter
 

But they have reached their 6 mos anniv and therefore should have 1 day.  That is what is making this so difficult.  It is only difficult for the new employees, as the company wants to give them something before they reach their actual 1 yr anniv.

 
Posted : 01/09/2016 12:15 pm
(@sunnykow)
Posts: 1417
Noble Member
 

Not pretty but should work

=IF(AND(E7>=D3,K7=1),1,IF(OR(E7>$D$3,I7>$D$3),0,K7))

 
Posted : 01/09/2016 12:33 pm
 CJ18
(@cj18)
Posts: 7
Active Member
Topic starter
 

Are you getting it to work, because I am still getting "0" for the employees with 6 mos?

 
Posted : 01/09/2016 1:03 pm
(@fravis)
Posts: 337
Reputable Member
 

I think I understand the problem now. I'll come back later today after trying solving it, OK?

 
Posted : 01/09/2016 1:11 pm
Page 1 / 2
Share: