Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default VLOOKUP question

It's Monday so I suspect this is a personal quirk rather than one in
Excel, but for the life of me it looks like a programmatic quirk.

So I'm looking through a list of timestamps (ws = LOOKUPDATA) for
matching date/times, then taking the associated reading (from the
range REFDATA!A2:B3457); out of a test range of 50 values, nine return
"#N/A" which means the formula couldn't find a match. However, I see
those matches when I do my own Find.

Here's the formula:
=VLOOKUP(LOOKUPDATA!D2, REFDATA!A2:B3457,2, FALSE)

The data referenced in
5/22/09 10:00 <--VLOOKUP finds a match fine
5/22/09 11:00 <--VLOOKUP finds no match

5/22/09 11:00 pasted as string is:
39955.4583333333

The other erring dates, when pasted as string, also end in the "3-bar"
pattern; weird. However, using the Excel "Find" I can find the cells
fine.

Is Excel not matching two date/time columns even though they're
formatted identically?

More importantly -- fix suggestions?

Regards,
Jeff
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default VLOOKUP question

I think dates should be dates, not strings, and that's why you're
encountering a rounding issues, right. Try something like this:
=DATE(YEAR(A1),MONTH(A1),DAY(A1))

Also, you may want to look in the Help area. I just found this the
If range_lookup is TRUE, the values in the first column of table_array must
be placed in ascending order: ..., -2, -1, 0, 1, 2, ..., A-Z, FALSE, TRUE;
otherwise VLOOKUP may not give the correct value. If range_lookup is FALSE,
table_array does not need to be sorted.

Finally, you may consider an Index/Match function:
http://www.contextures.com/xlFunctions03.html

I prefer that to Vlookup.

HTH,
Ryan---

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Jeff Norville" wrote:

It's Monday so I suspect this is a personal quirk rather than one in
Excel, but for the life of me it looks like a programmatic quirk.

So I'm looking through a list of timestamps (ws = LOOKUPDATA) for
matching date/times, then taking the associated reading (from the
range REFDATA!A2:B3457); out of a test range of 50 values, nine return
"#N/A" which means the formula couldn't find a match. However, I see
those matches when I do my own Find.

Here's the formula:
=VLOOKUP(LOOKUPDATA!D2, REFDATA!A2:B3457,2, FALSE)

The data referenced in
5/22/09 10:00 <--VLOOKUP finds a match fine
5/22/09 11:00 <--VLOOKUP finds no match

5/22/09 11:00 pasted as string is:
39955.4583333333

The other erring dates, when pasted as string, also end in the "3-bar"
pattern; weird. However, using the Excel "Find" I can find the cells
fine.

Is Excel not matching two date/time columns even though they're
formatted identically?

More importantly -- fix suggestions?

Regards,
Jeff

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
VLookup question dvonj Excel Discussion (Misc queries) 3 March 31st 09 02:17 AM
VBA question - vlookup Nick Excel Programming 2 October 12th 07 12:45 PM
=vlookup question scott Excel Discussion (Misc queries) 0 June 8th 06 06:14 PM
vlookup vba question. Nigel Excel Discussion (Misc queries) 8 November 25th 05 02:00 PM
vlookup question JR Winder Excel Programming 10 March 9th 05 02:28 PM


All times are GMT +1. The time now is 08:15 PM.

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"