+ Reply to Thread
Results 1 to 3 of 3

Comparing two times

  1. #1
    Registered User
    Join Date
    06-14-2006
    Posts
    72

    Comparing two times

    when comparing two different times why is 00:30 minutes giving me a number like .02083333333333333333 and 0:30 minutes from a vlookup table is giving me a number like .0208333333284827

    whats up with that that is why my conditional formatting is a problem

    ed

  2. #2
    Bob Phillips
    Guest

    Re: Comparing two times

    This is caused by the floating point arithmetic engine within Excel, it is
    limited in its precision (as are most other applications).

    The solution is to take one from the other and check that it is not greater
    than a small number, such as

    =ABS(A26-A27)<0.000001

    --
    HTH

    Bob Phillips

    (replace somewhere in email address with gmail if mailing direct)

    "changetires" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > when comparing two different times why is 00:30 minutes giving me a
    > number like .02083333333333333333 and 0:30 minutes from a vlookup table
    > is giving me a number like .0208333333284827
    >
    > whats up with that that is why my conditional formatting is a problem
    >
    > ed
    >
    >
    > --
    > changetires
    > ------------------------------------------------------------------------
    > changetires's Profile:

    http://www.excelforum.com/member.php...o&userid=35414
    > View this thread: http://www.excelforum.com/showthread...hreadid=565366
    >




  3. #3
    Tom Hutchins
    Guest

    RE: Comparing two times

    Why not just use the ROUND function on the two times in your conditional
    formatting formula, to force them to the same number of decimal places? From
    your example data, they are identical out to 10 decimal places. Do you need
    more precision than that?

    Hope this helps,

    Hutch

    "changetires" wrote:

    >
    > when comparing two different times why is 00:30 minutes giving me a
    > number like .02083333333333333333 and 0:30 minutes from a vlookup table
    > is giving me a number like .0208333333284827
    >
    > whats up with that that is why my conditional formatting is a problem
    >
    > ed
    >
    >
    > --
    > changetires
    > ------------------------------------------------------------------------
    > changetires's Profile: http://www.excelforum.com/member.php...o&userid=35414
    > View this thread: http://www.excelforum.com/showthread...hreadid=565366
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1