Clock In & Clock Out

Vanda_a

Well-known Member
Joined
Oct 29, 2012
Messages
923
Dear All. Please kindly advise what formula is used with my situation?

My company start working on 08:30 to 12:00. And start work again on 13:00 to 17:30.

Alex is over 1 min and Jonh is 5 min. I would like to have a formula at column F.
A
B
C
D
E
F
1
Clock In
Clock Out
Clock In
Clock Out
2
Alex
8:31
12:01
12:59
17:31
1
3
Jonh
8:29
11:55
12:50
17:30
5
4

<tbody>
</tbody>
Many many thanks
 

Some videos you may like

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

exceldevs

Active Member
Joined
Aug 4, 2013
Messages
255
Hi Vanda_a,

Try this.


ABCDEF
1Clock InClock OutClock InClock Out
2Alex8:3112:0112:5917:310:01
3Jonh8:2911:5512:5017:300:05

<tbody>
</tbody>

Spreadsheet Formulas
CellFormula
F2=IF($B2>TIME(8,30,0),$B2-TIME(8,30,0))+IF($C2<time<font color="#008000">(12,0,0),TIME(12,0,0)-$C2)+IF($D2>TIME(13,0,0),$D2-TIME(13,0,0))+IF($E2<time<font color="#008000">(17,30,0),TIME(17,30,0)-$E2)</time</time

<tbody>
</tbody>

<tbody>
</tbody>
 

Vanda_a

Well-known Member
Joined
Oct 29, 2012
Messages
923
Hi Vanda_a, Try this.
ABCDEF
1Clock InClock OutClock InClock Out
2Alex8:3112:0112:5917:310:01
3Jonh8:2911:5512:5017:300:05

<tbody>
</tbody>
Spreadsheet Formulas
CellFormula
F2=IF($B2>TIME(8,30,0),$B2-TIME(8,30,0))+IF($C2<time<font color="#008000">(12,0,0),TIME(12,0,0)-$C2)+IF($D2>TIME(13,0,0),$D2-TIME(13,0,0))+IF($E2<time<font color="#008000">(17,30,0),TIME(17,30,0)-$E2)</time</time

<tbody>
</tbody>

<tbody>
</tbody>

Many many thanks. May i revise my column please? I would like to use only B1 and C1. Two rows for a day.

Ex:

ABCD
1Clock InClock Out
2Alex8:2911:591
3Alex13:0117:301
4John8:3111:592
5John13:0016:591

<tbody>
</tbody>
Many many thanks
 

exceldevs

Active Member
Joined
Aug 4, 2013
Messages
255
See if this is what you're looking for?
ABCD
1Clock InClock Out
2Alex8:2911:590:01
3Alex13:0117:300:01
4John8:3111:590:02
5John13:0016:590:31

<tbody>
</tbody>

Spreadsheet Formulas
CellFormula
D2=IF(ISEVEN(ROW()),IF($B2>TIME(8,30,0),$B2-TIME(8,30,0))+IF<font color="#008000">($C2<time<font color="#0000FF">(12,0,0)</time,TIME(12,0,0)-$C2),IF($B2>TIME(13,0,0),$B2-TIME(13,0,0))+IF<font color="#008000">($C2<time<font color="#0000FF">(17,30,0)</time,TIME(17,30,0)-$C2))

<tbody>
</tbody>

<tbody>
</tbody>
 

Vanda_a

Well-known Member
Joined
Oct 29, 2012
Messages
923

ADVERTISEMENT

See if this is what you're looking for?
ABCD
1Clock InClock Out
2Alex8:2911:590:01
3Alex13:0117:300:01
4John8:3111:590:02
5John13:0016:590:31

<tbody>
</tbody>

Spreadsheet Formulas
CellFormula
D2=IF(ISEVEN(ROW()),IF($B2>TIME(8,30,0),$B2-TIME(8,30,0))+IF<font color="#008000">($C2<time<font color="#0000FF">(12,0,0)(12,0,0)</time-$C2),IF($B2>TIME(13,0,0),$B2-TIME(13,0,0))+IF<font color="#008000">($C2<time<font color="#0000FF">(17,30,0)(17,30,0)</time-$C2))

<tbody>
</tbody>

<tbody>
</tbody>

I have problem with this (12,0,0)"-$C2)". The formula you typed contain error

Many thanks
 

Vanda_a

Well-known Member
Joined
Oct 29, 2012
Messages
923
this one?<time(12,0,0),time(12,0,0)-$c3),if($b3><time(17,30,0),time(17,30,0)-$c3))< html="">

Code:
=IF(ISEVEN(ROW()),IF($B3>TIME(8,30,0)
,$B3-TIME(8,30,0))+IF($C3<time(12,0,0)
,TIME(12,0,0)-$C3),IF($B3>TIME(13,0,0),
$B3-TIME(13,0,0))+IF($C3<time(17,30,0)
,TIME(17,30,0)-$C3))<time(12,0,0),time(12,0,0)-$c3),if($b3><time(17,30,0),time(17,30,0)-$c3))[ code]
</time(17,30,0),time(17,30,0)-$c3))[></time(12,0,0),time(12,0,0)-$c3),if($b3></time(17,30,0)
</time(12,0,0)
</time(17,30,0),time(17,30,0)-$c3))<></time(12,0,0),time(12,0,0)-$c3),if($b3>
 
Last edited:

exceldevs

Active Member
Joined
Aug 4, 2013
Messages
255

ADVERTISEMENT

Hi Vanda_a,

You're right, for some reason some characters get trimmed off after I save the post. Try this.
Code:
=IF(ISEVEN(ROW()),IF($B2 > TIME(8,30,0),$B2-TIME(8,30,0))+IF($C2 < TIME(12,0,0),TIME(12,0,0)-$C2),IF($B2 > TIME(13,0,0),$B2-TIME(13,0,0))+IF($C2 < TIME(17,30,0),TIME(17,30,0)-$C2))
 

Vanda_a

Well-known Member
Joined
Oct 29, 2012
Messages
923
Hi Vanda_a,

You're right, for some reason some characters get trimmed off after I save the post. Try this.
Code:
=IF(ISEVEN(ROW()),IF($B2 > TIME(8,30,0),$B2-TIME(8,30,0))+IF($C2 < TIME(12,0,0),TIME(12,0,0)-$C2),IF($B2 > TIME(13,0,0),$B2-TIME(13,0,0))+IF($C2 < TIME(17,30,0),TIME(17,30,0)-$C2))

Yeah. It works great. many many thanks
 

Vanda_a

Well-known Member
Joined
Oct 29, 2012
Messages
923
You're welcome, thanks for the feedback.

Hello. I just got an other problem. some values return this "##############". however I extend the column, still no use.
I can't find the reason why. Please help

Many thanks
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,122,569
Messages
5,596,913
Members
414,110
Latest member
docops

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
Top