# Using IF with elapsed time

#### ETGREENE

##### New Member
I hope this hasn't been asked before. I looked before posting. I am trying to build a formula similar to:
=IF(D6*24>("40:00"),D6,IF(D6*24=("40:00"),"40:00",IF(D6*24<("40:00"),"40:00")))

Where cell six lets say is 32:57. Excel is fighting me on what the [h]:mm:ss actually means.

It's converting it to a decimal value behind the scenes.
My creation is to express if the total of a persons hours worked is equal to or more than 40 then the 40 hours would be displayed, and if they worked less than 40 hours then it would display the actual hours and minutes worked.

Any help would be greatly appreciated.

### Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

#### bebo021999

##### Active Member
When D6 multifly to 24, it should change "40:00" to 40.
BTW, the formula should be:

=MIN(D6,40/24)

Assum D6 is in proper time format.

#### ETGREENE

##### New Member
Thank you, I had to fight it so long. Too bad it always changes time behind the scenes.

Replies
2
Views
229
Replies
0
Views
242
Replies
4
Views
79
Replies
1
Views
488
Replies
2
Views
420

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,152,480
Messages
5,770,337
Members
425,612
Latest member
martinijr

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

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