I am trying to create an automated timesheet in Excel. Basically, an employee should be able to enter his/her time in and time out, and Excel will calculate the total hours the employee works, how much leave time they have (anything over 7 hrs is leave time), it will know that a person is not scheduled to work on Saturdays and Sundays, and it makes sure that everyone works 7 hrs, even if the person must put in leave time. The problem that I am having is calculating the total hrs worked for the day. If someone works from 10am-6pm, I know how to make Excel show 8 hrs. But, what if they come in at 10:15am and leave at 6pm; what if they come in at 1:00pm and leave at 6pm; what if they come in at 4pm and leave at 12:00 midnight; what if they come in at 12 in the afternoon and leave at 6 pm; what if they come in at 12 in the afternoon and leave at 2:00 am; what if they come in at 3:00pm and leave at 2:00am??? I am having trouble creating if statements that consider all these cases. If anyone can help me, I would greatly appreciate it.