View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
DaveP DaveP is offline
external usenet poster
 
Posts: 3
Default how to calculate time in a payroll worksheet

Peek,

Assuming you are working with values within the same day, you can enter
clock in and out times as numbers (eg 800 for 8am, 830 for 8:30am etc)
and then do a subtraction on the start and finish time using the
following formula:

A1 = 800, B1 = 1200, C1 =
"=(REPLACE(B1,LEN(B1)-1,0,":")-(REPLACE(A1,LEN(A1)-1,0,":")))

Then format C1 as "HH:MM"

This would give a result of 4:00.

HTH

Dave