Turning time sum into decimal if over an hour

handysmurf

Board Regular
Joined
Jan 17, 2015
Messages
77
Office Version
  1. 365
Platform
  1. Windows
OK I am figuring the difference in times and the result is a decimal. But if the result is over an hour I loose that time, I only end up with the minutes and loose however many hours. So ... I need to fix that.

Here is the existing formula...

=IF(OR($M11569="D",$M11569="P",$M11569="w"),VALUE(MID(TEXT($AE11569-$AD11569,"hh:mm:ss"),4,2))+VALUE(RIGHT(TEXT($AE11569-$AD11569,"hh:mm:ss"),2)/60),"")

TIA
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

joeu2004

Banned user
Joined
Mar 2, 2014
Messages
3,080
Office Version
  1. 2010
Platform
  1. Windows
Perhaps:

=IF(OR($M11569="D",$M11569="P",$M11569="w"),($AE11569-$AD11569)*1440,"")

That returns decimal minutes. For example, if the difference is 1h 2m 30s, the result will be about 62.5.

I say "about" because an infinitestimal difference could arise due to the binary arithmetic. If that matters, you might want to round to the second first.

=IF(OR($M11569="D",$M11569="P",$M11569="w"),ROUND(($AE11569-$AD11569)*86400,0)/60,"")

-----

PS.... Unrelated to the solution to your problem, for future reference, replace your text manipulations with MINUTE($AE11569-$AD11569) and SECOND($AE11569-$AD11569) in order to extract the minutes and seconds of the time difference (excluding the hours and days). For example, if the time difference is 12:34:56, MINUTE() returns 34 and SECOND() returns 56.
 
Last edited:

handysmurf

Board Regular
Joined
Jan 17, 2015
Messages
77
Office Version
  1. 365
Platform
  1. Windows
thanks ... will let you know if it works.

I have no idea about your post script comments .... I didn't write the original formula. While I would prefer to learn the formulas instead of just asking for them here not many have time to elaborate.
 
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,167,532
Messages
5,854,288
Members
431,636
Latest member
shabbas313

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