Can you help me know your working hours and absences here?

ezzat

New Member
Joined
Dec 26, 2024
Messages
11
Office Version
  1. 2016
Platform
  1. Windows
Date/Timeact h,m
26-Nov-24 8:06:51 AM
26-Nov-24 4:10:08 PM
27-Nov-24 8:05:32 AM
27-Nov-24 4:35:28 PM
28-Nov-24 7:02:54 AM
28-Nov-24 3:22:11 PM
30-Nov-24 2:55:01 PM
30-Nov-24 2:55:06 PM
01-Dec-24 7:06:19 AM
01-Dec-24 2:56:48 PM
02-Dec-24 2:59:50 PM
04-Dec-24 7:06:43 AM
04-Dec-24 2:57:57 PM
05-Dec-24 7:06:51 AM
05-Dec-24 2:49:09 PM
07-Dec-24 7:02:55 AM
07-Dec-24 2:57:15 PM
08-Dec-24 7:02:51 AM
08-Dec-24 3:04:49 PM
09-Dec-24 7:03:54 AM
09-Dec-24 3:08:36 PM
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
We need more detail.
Please tell us your expected output from your example, and explain the logic in determining it.
 
Upvote 0
Output is the number of hours worked during the day
رمز تم التحقق منها بواسطة المنتدى
 
Upvote 0
Is the first time of each day the start time and the second time the end time?
 
Upvote 0
Assuming that is what you want to do, I see one potential issue with your data.
For 12/1/2024, you only have one record for that date, when I think you need two.

I assumed that every date will either have two entries (time-in/time-out) or no entries.
Under those assumptions, here is what I came up with:
1737557910836.png


So, in column D I listed all the days I want to return hours for. I entered my first date in cell D2, and then simply added one to each day under it, i.e. in D3:
Excel Formula:
=D2+1
and copied down for all rows.

Then, I entered this formula in cell E2 and copy down for all rows:
Excel Formula:
=IF(COUNTIFS(A$2:A$22,">="&D2,A$2:A$22,"<"&D2+1)<2,0,MAX(INDEX(A$2:A$22+(A$2:A$22>D2+1)*-1E+99, , ))-MIN(INDEX(A$2:A$22+(A$2:A$22<D2)*1E+99, , )))
I have to admit, I did not come up with the part of the formulas that calculates the MIN and MAX times for each date. I got it from this thread here:
 
Upvote 0

Forum statistics

Threads
1,225,765
Messages
6,186,901
Members
453,384
Latest member
BigShanny

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top