# Time Format

#### S.H.A.D.O.

##### Well-known Member
Hi everyone,

I would like to be able to enter a start time for example as 6.15 ( with a dot as opposed to a : ) and a finish time as 14.45. I would then like to calculate the total number of hours worked please ( the previous would equate to 8.50 hours ).

Any help will be greatly appreciated.
All the Best.

### Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
If start time is in A1 and end time in B1 try

=MOD(SUBSTITUTE(B1,".",":")-SUBSTITUTE(A1,".",":"),1)*24

format as number

Hi,

8:50
or
8:30 ?

kind regards,
Erik

Barry,

The only thing is that if I input the start time as 5.00 and the finish time as 11.00, the formula returns a zero hours worked.

Erik,

The 8.50 equates to 8 and a half hours worked.

Thank you both for the replies.
All the Best.

Barry,
The only thing is that if I input the start time as 5.00 and the finish time as 11.00, the formula returns a zero hours worked.

OK then try

=MOD(SUBSTITUTE(TEXT(B1,"0.00"),".",":")-SUBSTITUTE(TEXT(A1,"0.00"),".",":"),1)*24

Hi,

I cannot get Barries trick to work, will try again.

This works for me, but the longer looking at it, the more I wouldn't advise such a counterintuitive layout.
A     B     C
1 start stop  elapsed
2 6,15  14,45 8,5
3 5     11    6
4 9     21,3  12,5

Calculation

[Table-It] version 05 by Erik Van Geit
Code:
``````RANGE FORMULA (1st cell)
C2:C4 =TRUNC(B2)-TRUNC(A2)+ROUND((B2-TRUNC(B2)-A2+TRUNC(A2))*100,0)/60

[Table-It] version 05 by Erik Van Geit``````

not talking of the problems when starting at 23.00 and ending at 4.00
kind regards,
Erik

Another way would be

=MOD(DOLLARDE(B1,60)-DOLLARDE(A1,60),24)

.....although DOLLARRDE requires Analysis ToolPak

not talking of the problems when starting at 23.00 and ending at 4.00

The formulas I posted will all take care of shifts which pass from one day to the next

not talking of the problems when starting at 23.00 and ending at 4.00
quickly fixed that one
Code:
``````RANGE FORMULA (1st cell)
C2:C4 =TRUNC(B2)-TRUNC(A2)+ROUND((B2-TRUNC(B2)-A2+TRUNC(A2))*100,0)/60+(A2>B2)*24

[Table-It] version 05 by Erik Van Geit``````
(perhaps missing some obvious change to make it shorter)

Hi Barry,

OK then try :-

=MOD(SUBSTITUTE(TEXT(B1,"0.00"),".",":")-SUBSTITUTE(TEXT(A1,"0.00"),".",":"),1)*24
works Perfectly, thank you. It is exactly what I was after.

Thank you Barry & Erik for your time & effort on this.
Have a good evening.

All the Best.

Replies
1
Views
184
Replies
31
Views
1K
Replies
2
Views
176
Replies
3
Views
306
Replies
2
Views
161

1,217,500
Messages
6,137,004
Members
450,038
Latest member

### 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