Results 1 to 2 of 2

Exact Date and Time compare within a range of exact date and times Lookup and Flag

Threaded View

john2001 Exact Date and Time compare... 08-08-2015, 05:55 PM
alansidman Re: Exact Date and Time... 08-08-2015, 06:01 PM
  1. #1
    Registered User
    Join Date
    08-08-2015
    Location
    USA California
    MS-Off Ver
    07
    Posts
    1

    Exact Date and Time compare within a range of exact date and times Lookup and Flag

    I have a list (List A) of exact moment of an occurrence (Date an Time) exel format. I have another list with Beginning dates and End Dates of a time lapse (List B). I want to know, flag those events in list A that happened within any of the ranges of List B (and put their position or identifier). Ive tried using date and datevalues to compare , defining as long, double as date but it seems to fail, and im stuck. pls help cannu spot the mistake?
    this is te code i wrote:
    Dim i As Integer
    Dim j As Integer
    Dim TrDATE As Date ' Travel Date variable
    Dim BegDate As Date ' Begining Date variable
    Dim EndDate As Date ' Ending Date variable
    Dim nRides As Integer ' Number of Rides
    Dim nMDX As Integer 'n number of Tolls from MDX
    Dim nFDOT As Integer 'n number of Tolls from FDOT
    
    nRides = 1910
    nMDX = 315
    nFDOT = 191
    
    i = 2
    Sheets("mdx").Select
    While i < nMDX
        j = 2
        Sheets("mdx").Select
        TrDATE = Cells(i, "D")
        While j < nRides
                Sheets("uber").Select
                BegDate = Cells(j, "R")
                EndDate = Cells(j, "S")
                If (BegDate < TrDATE) And (TrDATE < EndDate) Then
                            Sheets("mdx").Select
                            Cells(i, "S") = 1
                            Cells(i, "R") = i
                            Cells(i, "Q") = j
                            j = 2000
                Else
                            Sheets("mdx").Select
                            Cells(i, "S") = 0
                            Cells(i, "R") = i
                            Cells(i, "Q") = j
                            j = j + 1
                End If
        Wend
        i = i + 1
    Wend
    Last edited by alansidman; 08-08-2015 at 06:01 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Find the Exact date, Nearest old and new date for the given input Letter) and date
    By thilag in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-17-2015, 05:13 AM
  2. Replies: 1
    Last Post: 06-05-2015, 06:57 AM
  3. Replies: 4
    Last Post: 01-06-2015, 09:15 PM
  4. Sum ifs - Based on Matching Date (exact date not range)
    By alyssakhan in forum Excel General
    Replies: 11
    Last Post: 06-03-2014, 03:35 PM
  5. LOOKUP Having one Exact matching criteria and one between 2 date ranges.
    By Grahame Hamilton in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-24-2012, 06:28 AM
  6. [SOLVED] How to match the exact value from the date range?
    By PRADEEPB270 in forum Excel General
    Replies: 2
    Last Post: 12-13-2011, 11:52 AM
  7. Searching for exact term with date range
    By 97hills in forum Excel General
    Replies: 9
    Last Post: 02-06-2011, 10:00 AM

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