Thank you so much for taking the time, I really appreciate your time and help. I never knew that a UDF even existed.
So, looking at that UDF I have no idea how to augment it to suit my workbook. When I put it in as a UDF it just came up with the
#NAME ? error
The times are all in as times and not TEXT
I have pasted in the times and first day which I set as 24th Dec below. Taking the first column, the 00:00 time(located in cell c3) is the start of the hour and the 01:00(located in cell c5) is the end of that hour. The "o" in cell c6 shows off site for that hour. This repeats itself in row 6 from c to z
Another layer of complexity is that when someone comes in on the half hour I have noted this as either 1/2x if they werent on off site call before ore after or 1/2x+o, as you can see in the hour 08:00-09:00 and again in the 17:00-18:00 cell below, if they are coming in or leaving the hospital on the half hour while on off site call.
I have added into this line a mock up of the calculations i need in the last 6 columns on far right under "On Site hours" and "Off Site Hours"
Calculating the on site hours is more important than the off site hours as these could be easily figured out
[TABLE="width: 1747"]
<colgroup><col><col><col span="24"><col><col><col><col><col span="3"><col span="3"></colgroup><tbody>[TR]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]00:00[/TD]
[TD="align: right"]01:00[/TD]
[TD="align: right"]02:00[/TD]
[TD="align: right"]03:00[/TD]
[TD="align: right"]04:00[/TD]
[TD="align: right"]05:00[/TD]
[TD="align: right"]06:00[/TD]
[TD="align: right"]07:00[/TD]
[TD="align: right"]08:00[/TD]
[TD="align: right"]09:00[/TD]
[TD="align: right"]10:00[/TD]
[TD="align: right"]11:00[/TD]
[TD="align: right"]12:00[/TD]
[TD="align: right"]13:00[/TD]
[TD="align: right"]14:00[/TD]
[TD="align: right"]15:00[/TD]
[TD="align: right"]16:00[/TD]
[TD="align: right"]17:00[/TD]
[TD="align: right"]18:00[/TD]
[TD="align: right"]19:00[/TD]
[TD="align: right"]20:00[/TD]
[TD="align: right"]21:00[/TD]
[TD="align: right"]22:00[/TD]
[TD="align: right"]23:00[/TD]
[TD]Hours Worked On Site[/TD]
[TD]Total On Site hours[/TD]
[TD]Hours On Call Off Site[/TD]
[TD]Total Off Site hours[/TD]
[TD]On Site Times[/TD]
[TD]On Site Times[/TD]
[TD]On Site Times[/TD]
[TD]Off Site Times[/TD]
[TD]Off Site Times[/TD]
[TD]Off Site Times[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD]to[/TD]
[TD]to[/TD]
[TD]to[/TD]
[TD]to[/TD]
[TD]to[/TD]
[TD]to[/TD]
[TD]to[/TD]
[TD]to[/TD]
[TD]to[/TD]
[TD]to[/TD]
[TD]to[/TD]
[TD]to[/TD]
[TD]to[/TD]
[TD]to[/TD]
[TD]to[/TD]
[TD]to[/TD]
[TD]to[/TD]
[TD]to[/TD]
[TD]to[/TD]
[TD]to[/TD]
[TD]to[/TD]
[TD]to[/TD]
[TD]to[/TD]
[TD]to[/TD]
[/TR]
[TR]
[TD]Date[/TD]
[TD]Day[/TD]
[TD="align: right"]01:00[/TD]
[TD="align: right"]02:00[/TD]
[TD="align: right"]03:00[/TD]
[TD="align: right"]04:00[/TD]
[TD="align: right"]05:00[/TD]
[TD="align: right"]06:00[/TD]
[TD="align: right"]07:00[/TD]
[TD="align: right"]08:00[/TD]
[TD="align: right"]09:00[/TD]
[TD="align: right"]10:00[/TD]
[TD="align: right"]11:00[/TD]
[TD="align: right"]12:00[/TD]
[TD="align: right"]13:00[/TD]
[TD="align: right"]14:00[/TD]
[TD="align: right"]15:00[/TD]
[TD="align: right"]16:00[/TD]
[TD="align: right"]17:00[/TD]
[TD="align: right"]18:00[/TD]
[TD="align: right"]19:00[/TD]
[TD="align: right"]20:00[/TD]
[TD="align: right"]21:00[/TD]
[TD="align: right"]22:00[/TD]
[TD="align: right"]23:00[/TD]
[TD="align: right"]00:00[/TD]
[/TR]
[TR]
[TD]24th Dec[/TD]
[TD]Mon[/TD]
[TD]o[/TD]
[TD]o[/TD]
[TD]o[/TD]
[TD]o[/TD]
[TD]o[/TD]
[TD]o[/TD]
[TD]o[/TD]
[TD]o[/TD]
[TD]1/2x+o[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]x[/TD]
[TD]1/2x+o[/TD]
[TD]o[/TD]
[TD]o[/TD]
[TD]o[/TD]
[TD]o[/TD]
[TD]o[/TD]
[TD]o[/TD]
[TD="align: right"]9[/TD]
[TD="align: right"]9[/TD]
[TD="align: right"]15[/TD]
[TD="align: right"]15[/TD]
[TD]08:30-17:30[/TD]
[TD]20:00-23:00[/TD]
[TD] [/TD]
[TD]00:00-08:30[/TD]
[TD]17:30-21:00[/TD]
[TD]23:00-00:00[/TD]
[/TR]
</tbody>[/TABLE]
Thank you so much again for your help. If I can send you the workbook, please tell me, it might make this much easier as I'm completely new to excel