Thanks Pham I am developing a small project for my office to maintain attendance record with some rules and i am stuck in 14 hrs rule and 8hr gap. if anyone can help will be much appropriated. ITs a Sunday to Monday roster. Rules for excel: A Person cannot work more than 14 hrs a day not 8 days in a row 8 hours gap in between the shifts