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

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
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.
 
Upvote 0
Solution
Thank you, I had to fight it so long. Too bad it always changes time behind the scenes.
 
Upvote 0

Forum statistics

Threads
1,214,913
Messages
6,122,207
Members
449,074
Latest member
cancansova

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