# Calculate Shift Hours (Date/Time difference in an interval)

#### seanpark22

##### New Member
Hi,

We have a situation where we need to find "number of hours" spent by each employee on "a particular date" but in between "a fixed interval".

Fixed Interval - Daily from 7:30 AM to 4:30 PM
We have list of employees and dates for the data.
Shifts can spillover several days, so solution should let us know that employee's hours on each date in fixed interval (below line 1)
An employee can have several shifts in a day i.e. 4 shifts for 2 hours each (below line 3 and 4).

 Employee Start Date/Time End Date/Time X1 7/1/2020 6:00:01 AM 7/4/2020 2:00:00 AM X2 6/6/2020 8:35:09 AM 6/6/2020 3:35:09 PM X3 5/3/2020 6:30:00 AM 5/3/2020 7:50:00 AM X3 5/3/2020 8:30:00 AM 5/3/2020 2:30:00 PM

### Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Replies
2
Views
205
Replies
3
Views
226
Replies
7
Views
212
Replies
6
Views
494
Replies
2
Views
109

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,163,625
Messages
5,832,750
Members
430,163
Latest member
YesImAk

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back