Formula to Determine Datetime With 3 Criteria Based on Same Name

muhammad susanto

Well-known Member
Joined
Jan 8, 2013
Messages
2,077
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
hi all..

how to solve this problem:
this criteria:
Clock in:
06.00.00 till 07.15.00
Clockout
17.00.00 till 24.00.00
with option
"ok" or "late" or "overtime"
nov 2023 (version 1).xlsb
ABC
1date-timeexpected resultname
201/11/2023 07:04:15okKiki
301/11/2023 17:19:41okKiki
402/11/2023 05:58:26lateSisca
502/11/2023 17:34:42okSisca
601/11/2023 07:07:25okDarwin
701/11/2023 16:43:44overtimeDarwin
802/11/2023 07:05:45Jack
902/11/2023 17:23:44Jack
1004/11/2023 07:06:27Milla
1104/11/2023 17:36:17Milla
Sheet1 (2)


any one help me out, greately appreciated..
my target in column B2 down

susant0
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
just need to check those time
so 6:00 till 7:15 is OK - but before 06:00 - its classed as late ??? , as shown 05:58:26 - Sisca
and then for
overtime - between 17:00 and 24:00 -

Darwin
16:43:44 - is shown as overtime - but thats before 17:00

do you treat as pairs - so 1st entry is clockin and 2nd entry clock out
what happens if they clockin on 1 day and clock out the next day - is that possible

no expected result for jack or milla - ????
 
Upvote 0
hi..
if clock in before time 06.00.00 or after 07.15.00 is shown "late"
if clock out before time 17.00.00 or after 24.00 is shown "overtime"
if they clock in on 1 day and clock out the 1 day , if the next day is not possible

for they jack & milla (clock in or clock out) are shown "ok"
 
Upvote 0
Ok, i think i understand

but how do they clock out over 24:00 , if they cannot work more than 1 day ???

so mayneed to rethink

will they always be sorted in pairs , clockin - always followed by clock out for same person

anytime before 06:00 - is late
anytime between 7:15 and 17:00 is overtime

so
=IF((A2-INT(A2))<TIMEVALUE("06:00:00"),"late",IF(AND((A2-INT(A2))>TIMEVALUE("07:15:00"),(A2-INT(A2))<TIMEVALUE("17:00:00")),"overtime","ok"))
should work

Book3
ABCD
1date-timeexpected resultname
207:04:15okKikiok
317:19:41okKikiok
405:58:26lateSiscalate
517:34:42okSiscaok
607:07:25okDarwinok
716:43:44overtimeDarwinovertime
807:05:45okJackok
917:23:44okJackok
1007:06:27okMillaok
1117:36:17okMillaok
Sheet1
Cell Formulas
RangeFormula
D2:D11D2=IF((A2-INT(A2))<TIMEVALUE("06:00:00"),"late",IF(AND((A2-INT(A2))>TIMEVALUE("07:15:00"),(A2-INT(A2))<TIMEVALUE("17:00:00")),"overtime","ok"))
 
Upvote 1
Solution
hi etaf, i think i missing about this:
sometimes person forget to clock in or clock out, so not always in pairs..
if the line/row only one row maybe clock in or clock out, the shown "late"
how to fix this problem?
 
Upvote 0
can you provide a sample
i did flag
will they always be sorted in pairs , clockin - always followed by clock out for same person
so really need a sample of all possibilities and also the expected results

I also asked if the person would only appear once in the list - or is this an ongoing list with mutliple days and people

What do you want to show , if only in once - again give FULL examples please
 
Upvote 0
hi etaf
nov 2023 dumai.xlsx
ABC
1date-timeexpected resultname
203/11/2023 07:09LateKiki
306/11/2023 07:10okSisca
406/11/2023 17:12okSisca
507/11/2023 17:36LateJack
608/11/2023 07:10LateMilla
Sheet4


red font as a singe row/line with different person. the shown is "late"
 
Upvote 0
ok, so what do you want we can use a countif - if they only ever supposed to appear twice in list
 
Upvote 0

Forum statistics

Threads
1,215,078
Messages
6,122,997
Members
449,093
Latest member
masterms

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