Turning time sum into decimal if over an hour

handysmurf

Board Regular
Joined
Jan 17, 2015
Messages
65
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

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

joeu2004

Well-known Member
Joined
Mar 2, 2014
Messages
3,053
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
65
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,132,671
Messages
5,654,664
Members
418,147
Latest member
dorkas

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