Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 180
Default 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
creating a "date selector box" or "pull down box" in a cell GaryK Excel Worksheet Functions 2 September 30th 09 01:45 AM
How can I use the ROUNDOWN and ROUNDUP functions in an "IF" functi EXCEL IN NEED Excel Worksheet Functions 3 June 6th 09 04:58 AM
which record is deleted when I use the "remove duplicates" functi. amcellhinney Excel Worksheet Functions 1 November 10th 08 01:03 AM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Multiple "lookup_value" Noel Excel Worksheet Functions 18 July 29th 07 10:26 PM


All times are GMT +1. The time now is 06:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"