View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Robert Crandal[_2_] Robert Crandal[_2_] is offline
external usenet poster
 
Posts: 158
Default Calculate if 2 times differ by 24 hours?

Great, the first formula works great for checking if the
time and date in B1 and B2 are GREATER than the
time and date in A1 and A2 by 24 hours.

Now I have another question.....

If the time and date in B1 and B2 are GREATER than
the time and date in A1 and A2 by 24 hours, I would
like to tell the user exactly what is the difference between
the times and dates. I want to display a message box
that outputs something like:

"There is a difference of 2 days, 5 hours, 20 mins and 10 seconds"

etc. etc... or something like that.

How would I do that?

Thank you!



"joeu2004" wrote in message
...
On Dec 27, 11:41 pm, joeu2004 wrote:
=IF(ABS(A1+A2-B1-B2)1,"24 hr","<=24 hr")

[....]
=IF(ROUND(ABS(A1+A2-B1-B2)*86400,0)86400,"24 hr","<=24 hr")


I'm sorry. I read your subject ("differ by 24 hours") and overlooked
what you wrote in your posting ("B1 and B2 are greater [...] by more
than 24 hours").

For the latter, the formulas should be:

=IF(B1+B2-A1-A21,"24 hr","<=24 hr")

=IF(ROUND((B1+B2-A1-A2)*86400,0)86400,"24 hr","<=24 hr")