Turning time sum into decimal if over an hour

handysmurf

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

joeu2004

Well-known Member
Joined
Mar 2, 2014
Messages
2,583
Office Version
2010
Platform
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
63
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.
 

Forum statistics

Threads
1,082,323
Messages
5,364,586
Members
400,809
Latest member
formulasataglance

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top