LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default Break on Calendar Year

I posted this in July under "Calculating Vacation" without a resonse. I
thought I had it working, but was tripped up when we went live. Any
assistance would be greatly appreciated.

I'm trying to calculate vacation accrual with the following specs:
- No vacation accrued for first 180 days
- After 180 days, 1.54 hours per week until calendar year break
- From first calendar year break it's incremental.

I've got the incremental down and my system works great if the employee was
hired before January 1, 2006.

Here is the code I'm using:

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
 
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
calendar year versus fiscal year mePenny Excel Discussion (Misc queries) 4 November 17th 09 06:05 PM
Help dealing with a fiscal year rather than a calendar year Tyler Excel Worksheet Functions 3 August 25th 07 11:26 AM
Calendar year change. San[_2_] Excel Programming 3 October 5th 06 09:05 AM
Sum for last calendar month & year [email protected] Excel Programming 7 September 18th 06 04:47 PM
change the year in a calendar template to different year George Excel Discussion (Misc queries) 1 July 19th 06 07:34 PM


All times are GMT +1. The time now is 09:19 PM.

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"