LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,059
Default Calculate if 2 times differ by 24 hours?

Errata....

On Dec 28, 2:33*pm, joeu2004 wrote:
=IF(B1+B2-A1-A21,"24 hr","<=24 hr")
=IF(ROUND((B1+B2-A1-A2)*86400,0)86400,"24 hr","<=24 hr")

[....]
__Both__ formulas should do that. *I was recommending the second
formula to avoid anomalies ("errors") that arise a result of computer
binary arithmetic.

Although you might [not] uncover any such anomalies in your testing,
they might arise eventually. *They are a common problem.


On second thought, the second formula (with ROUND) should not be
necessary __if__ the times in A1 and B1 are __constants__, not
computed by formulas, which seems to be true in your case.

I have helped so many people whose formulas behave unexpectedly due to
infinitesimal anomalies arising from computer binary arithmetic that,
arguably, I have become unduly sensitive to the problem, and I over-
reacted.

Just to be sure, I did run through all 86400 seconds in a day,
comparing with 24hr + 1sec, and I confirmed that the two formulas
always agree.

That should not be surprising considering how large 1 second,
represented as a fraction of a day, is compared to the precision of
time with a current date. But when date/time is computed, computer
arithmetic anomalies can still arise, I believe, in part because the
precision of time with a current date is less than the precision of
time alone.

If that's too confusing, simply disregard it. I am merely trying to
justify my concern, which seems misplaced when time is a
__constant__.

Much ado about nothing.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I calculate total pay from pay rate times hours and minutes Rufus Excel Discussion (Misc queries) 5 May 1st 23 07:45 PM
Calculate total for rate times hours in Excel? whitjl143 Excel Discussion (Misc queries) 3 September 22nd 09 07:17 PM
Calculate hours between to separate dates and times Dave08 New Users to Excel 7 October 13th 08 10:36 AM
How do I calculate dates and times, w/answer of days & hours Debby_Jo Excel Worksheet Functions 4 April 27th 07 04:05 AM
Calculate the number of hours between two dates and times [email protected] Excel Programming 1 October 19th 06 09:14 AM


All times are GMT +1. The time now is 05:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"