Multi conditional UDF

K

keysol100

Hi,

How would I go about writing a User Defined Function that would allo
me to calculate night shift premiums for the following?

I have a list made up of 3 groups of employees:
GroupA, GroupB and GroupC.

Employees in GroupA and GroupB work a variety of shifts:
Days 6 hours,
Days 8 hours,
Days 12 hours
Evenings 8 hours
Nights 8 hours,
Nights 12 hours
Group C always works Days 8 hours.

Night shift premiums are paid only to groupA and GroupB as follows:

GroupA – Days 12 hours .90 cents per shift worked
Nights 12 hours - $6.45 per shift worked

GroupB- Nights 12 hours – $6.49 per shift worked
Nights 8 hours - $4.28 per shift worked

GroupC – no premiums are paid

Any help much appreciated

Ger
 
J

Jonathan Rynd

How would I go about writing a User Defined Function that would allow
me to calculate night shift premiums for the following?

First of all you need to define what the inputs to the function are. One
input is obviously going to be which group the employee is in. Probably a
second input should be whether the shift was day or night, and a third
input should be the number of hours in the shift. Does this sound right to
you?
 
Top