Hello,

I hope someone can help me with this.

The goal is to calculate the fee an employee gets based on registered start date/time and end date/time. With two conditions:

the time a person worked between 0:00 and 18:00 earns him €1
The time a person worked between 18:00 and 0:00 earns him €5

I am registering the start date and time and end date and time.
startdate and time 22-02-2013 at 16:00
Enddate and time 23-02-2013 at 02:00

So from 16:00 till 18:00 he wil earn 2 times €1
And from 18:00 till 02:00 he wil earn 8 times €5
Total earnings are €42


Is there a formula i can use, or perhaps develop one using VBA?

Thank you in advance for your time!