Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default calculating vacation

This is killing me. I'm developing a vacation-tracking system, and I need to
calculate vacation based on anniversary date. Everything over 1 year is easy
(Select Case). But less than a year it gets tricky.

If they've been here less than six months, they accrue no vacation.

They start accruing at a rate of 1.54 hours per pay period beginning at 180
days, and can use vacation in advance - so we need to know the amount of
vacation available through the end of the year.
(Day(Now)-Day(HireDate)/7*1.54?)

But if their 6-month-anniversary was before January 1, then they accrue at
the normal rate.

And vacation does not carry over from year to year.

Thanks in advance.
--
Adios,
Clay Harryman
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default calculating vacation

OK - I'm still building the code so I can test this, but here's what I've got
so far:

Select Case anniv
Case Is < 2
LAccrualRate = 1.54
' Calculate day of last day of hire year
DtEndOfYear = CDate("12/31/" & CStr(Year(hiredate)))
LCountDays = Day(DtEndOfYear) - Day(hiredate)
' Check to see if 180 days elapsed between hiredate and end of hire year
If LCountDays 180 Then
' if so, was employee hired last year?
If Year(hiredate) < Year(Now) Then
' if so, hours accrued = 80
LHoursRemain = 80
Else
' if not, hours accrued = weeks * 1.54
LWeeksWorked = LCountDays / 7
LHoursRemain = LWeeksWorked * 1.54
End If
Else
' if 180 days not elapsed, hours accrued=0
LHoursRemain = 0
End If
Case 2 To 4
LHoursRemain = 80
LAccrualRate = 1.54
Case 5 To 14
LHoursRemain = 120
LAccrualRate = 2.31
Case Is 14
LHoursRemain = 160
LAccrualRate = 3.08
End Select
--
Adios,
Clay Harryman


"Clayman" wrote:

This is killing me. I'm developing a vacation-tracking system, and I need to
calculate vacation based on anniversary date. Everything over 1 year is easy
(Select Case). But less than a year it gets tricky.

If they've been here less than six months, they accrue no vacation.

They start accruing at a rate of 1.54 hours per pay period beginning at 180
days, and can use vacation in advance - so we need to know the amount of
vacation available through the end of the year.
(Day(Now)-Day(HireDate)/7*1.54?)

But if their 6-month-anniversary was before January 1, then they accrue at
the normal rate.

And vacation does not carry over from year to year.

Thanks in advance.
--
Adios,
Clay Harryman

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
vacation ganga Excel Discussion (Misc queries) 1 December 7th 09 06:07 PM
fx for vacation Ray Excel Worksheet Functions 2 February 24th 09 05:49 AM
Need Formula for Calculating Accrued Vacation Time jd_dps[_2_] Excel Worksheet Functions 2 December 26th 08 08:28 PM
Calculating Vacation Time by Month Steve Excel Discussion (Misc queries) 0 July 5th 07 03:30 PM
Vacation jopla Excel Worksheet Functions 1 December 10th 04 08:07 PM


All times are GMT +1. The time now is 05:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"