Using IF with elapsed time

ETGREENE

New Member
Joined
Nov 3, 2021
Messages
2
Office Version
  1. 365
Platform
  1. MacOS
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
Joined
Jul 14, 2011
Messages
477
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.
 
Solution

ETGREENE

New Member
Joined
Nov 3, 2021
Messages
2
Office Version
  1. 365
Platform
  1. MacOS
Thank you, I had to fight it so long. Too bad it always changes time behind the scenes.
 
Master Excel Bundle

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.

Forum statistics

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

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