1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Excel: Looking up dates using VLOOKUP

Discussion in 'Business Applications' started by mathias1979, Jun 16, 2008.

Thread Status:
Not open for further replies.
Advertisement
  1. mathias1979

    mathias1979 Thread Starter

    Joined:
    Jun 16, 2006
    Messages:
    20
    I'm attempting to use the VLOOKUP function to look up dates, which I've successfully done before. This time around, VLOOKUP does not seem to be finding the dates I'm looking for, even though they exist and are an exact match. So here's a sample.

    So my dates look like this:

    Date/Time
    9/1/2007 13:00
    9/1/2007 13:27
    9/1/2007 13:58
    9/1/2007 14:00
    9/1/2007 14:35
    9/1/2007 15:07
    9/1/2007 15:48
    9/1/2007 16:00

    Now I only want the values that have been reported on the hour, so my lookup values look like this:

    9/1/2007 13:00
    9/1/2007 14:00
    9/1/2007 15:00
    9/1/2007 16:00

    My function looks like this:
    VLOOKUP(B2,Sheet1!$B$1:$F$12422,3,FALSE)

    Excel seems to be finding some dates successfully, but other dates it returns a #N/A. I have used an if statement to test some of the dates that are not being successfully found. So I use the function IF(A1=B1,"YES","NO"), where A1 is the date in the date in the table, and B1 is the matching date I am trying to find...and when I do this, I receive "YES", which to me suggests the dates are exactly the same, formatting and all, so Excel should have no trouble finding the exact match. I have also tried converting the dates to the serial number (i.e. 12/13/2006 20:00 = 39064.83333), and although the numbers match exactly, that has not solved the problem either.


    Can anyone help me out?
     
  2. jimr381

    jimr381

    Joined:
    Jul 20, 2007
    Messages:
    4,189
    First Name:
    Jim
    Can you post some of the offending data?
     
  3. mathias1979

    mathias1979 Thread Starter

    Joined:
    Jun 16, 2006
    Messages:
    20
    Here's a small sample of where the problem is occurring.
     

    Attached Files:

    • tmp.xls
      File size:
      13.5 KB
      Views:
      71
  4. mathias1979

    mathias1979 Thread Starter

    Joined:
    Jun 16, 2006
    Messages:
    20
    Found the solution elsewhere. Problem was with autofilling of the dates I was looking up. I truncated the dates to 6 decimal places, and that solved the problem.
     
  5. jimr381

    jimr381

    Joined:
    Jul 20, 2007
    Messages:
    4,189
    First Name:
    Jim
    Good to know. ;) I will try to remember that for the future.
     
  6. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/721833

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice