+ Reply to Thread
Results 1 to 2 of 2

How do I use a date in a cell for "lookup_value" in HLOOKUP functi

  1. #1
    joker
    Guest

    How do I use a date in a cell for "lookup_value" in HLOOKUP functi

    I am using the HLOOKUP function to grab a date in an adjacent cell as the
    "lookup_value" (the first argument in the syntax for the function). The date
    is in the format of "Sunday, January 1, 2006". I use the function to go to
    another worksheet, look across a row, find the date, then return back the
    contents of a cell below the referenced date. The problem I am having is
    that the HLOOKUP function sees the date as a date in sequential serial number
    form. When it tries to look for the date in the other worksheet, it does not
    find it and returns "#N/A".

  2. #2
    bpeltzer
    Guest

    RE: How do I use a date in a cell for "lookup_value" in HLOOKUP functi

    If I'm understanding correctly, the lookup value you have is numeric (though
    formatted as a date) and the first row in the table array has dates entered
    as text. (If they're both numeric or both text, the lookup should work.) If
    so, then your challenge is to convert the lookup value to a text string that
    matches the table. Instead of hlookup(a1, ....), you can use
    hlookup(text(a1,"Dddd, Mmmm dd, yyyy"), ....), embedding that conversion
    within the lookup.
    If it's an option, however, I'd change the table to use real dates (that is,
    numbers) formatted to read as you like. There are just more things that can
    differ among nearly identical strings (extra spaces, missing commas, etc).
    --Bruce

    "joker" wrote:

    > I am using the HLOOKUP function to grab a date in an adjacent cell as the
    > "lookup_value" (the first argument in the syntax for the function). The date
    > is in the format of "Sunday, January 1, 2006". I use the function to go to
    > another worksheet, look across a row, find the date, then return back the
    > contents of a cell below the referenced date. The problem I am having is
    > that the HLOOKUP function sees the date as a date in sequential serial number
    > form. When it tries to look for the date in the other worksheet, it does not
    > find it and returns "#N/A".


+ 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