+ Reply to Thread
Results 1 to 4 of 4

Two equal date/times not equating to equal

  1. #1
    Registered User
    Join Date
    10-15-2013
    Location
    Hawaii
    MS-Off Ver
    Excel 2007
    Posts
    63

    Two equal date/times not equating to equal

    I have a loop that is to execute while one date/time is less than another. The module is huge and probably too confusing to post so I will attempt to explain the scenario in hopes someone may be able to identify the issue. So this is how the first date variable is populated:
    Please Login or Register  to view this content.
    The second date variable is populated by the following:
    Please Login or Register  to view this content.
    A loop is entered with the following condition:
    Please Login or Register  to view this content.
    At the end of the loop, the first date variable is incremented by the following:
    Please Login or Register  to view this content.
    The loop is executing 1 too many times when:
    Please Login or Register  to view this content.
    Below is the watch window at the last iteration showing the dates are not equal, why?

    SWSC-Error - Watch Window.png

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Two equal date/times not equating to equal

    You're working with floating-point numbers; expect small errors and program accordingly.

    Please Login or Register  to view this content.
    Last edited by shg; 09-19-2017 at 06:35 PM.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    10-15-2013
    Location
    Hawaii
    MS-Off Ver
    Excel 2007
    Posts
    63

    Re: Two equal date/times not equating to equal

    That worked, thank you.
    Last edited by cebalaw; 09-19-2017 at 05:21 PM.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Two equal date/times not equating to equal

    You're welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] IF date is greater than or equal to X but less than or equal to y
    By LloydGilmore in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 03-09-2019, 05:35 AM
  2. Replies: 2
    Last Post: 06-10-2017, 04:58 PM
  3. Filter column B by equal or greater than 31 but less than or equal to 60
    By kop1ko in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-18-2015, 04:11 PM
  4. [SOLVED] Populate count & sum based on equal to & not equal to factors
    By jscalem in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-20-2015, 01:20 PM
  5. [SOLVED] COUNTIFS function w/greater than or equal to, and less than or equal to time values
    By AliciaRenee in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-27-2014, 03:57 PM
  6. Scoresheet with Equal Ranks - need to identify equal placings separately
    By Caroleh in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-12-2014, 02:59 AM
  7. lower and upper case equal on spreadsheet but not equal in VB
    By don in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-12-2005, 09:06 PM

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