time values in if formulas excel 2007

D sweetman

New Member
Joined
Nov 1, 2015
Messages
11
Hi
See below a start and finish time of a shift. For John Doe I want the hours worked to read 24:00. See formulas used in the 2 hours worked for John and Peter.

StartFinishNameHours worked
14:00 Sleep over14:00John Doe00:00
16:00D/D21:00Peter Doe05:00

<tbody>
</tbody>


=IF(D3="";"";(IF((D3>B3);(D3-B3);(24-(B3-D3)))))


<tbody>
</tbody>
=IF(D4="";"";(IF((D4>B4);(D4-B4);(24-(B4-D4)))))

<tbody>
</tbody>

Thanks for any help
Regards
David
 

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
Do you mind the hours worked being decimal (rather than hours:mins)? If that's ok, just reformat the column as a number rather than as a time.
(Also the semicolons in the formula should be commas)
 
Upvote 0
Thanks
Yes ideally HH/MM and I tried commas but I got an error and no error when I used semi colons. Strange!!!
 
Upvote 0
try custom format [h]:mm that will display as 24:00
 
Upvote 0
I got
576:00
with that format?
Regards

<tbody>
</tbody>

which format

31/10/2015 16:5801/11/2015 16:5824:00

<colgroup><col span="2" width="124"><col width="72"></colgroup><tbody>
</tbody>
 
Upvote 0
Thanks
Yes ideally HH/MM and I tried commas but I got an error and no error when I used semi colons. Strange!!!

delimiters, are a reflection of your system settings
 
Upvote 0
Hi
I got 576 instead of 24:00 and I formatted the cell [H]:mm
Also how do I change the delimiter back to a comma, it used to be a comma.
Regards
David
 
Upvote 0

Forum statistics

Threads
1,214,975
Messages
6,122,538
Members
449,088
Latest member
RandomExceller01

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