#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default vlookup using date

I have data that looks like:
date value1 value2
1/1/01 200 222
1/2/01 340 444
1/3/01 450 532

and i want to look up value1 and value2 based on dates. when i use vlookup
it always produces #NA. i have tried different formatting and it does work
when i convert the date to datevalue and base the lookup on the corresponding
datevalue. why is this? is date not an allowed lookup value for the vlookup
function?

i have lots of data sets with date in different formats that are
periodically added to, and need to find some system for looking up values
without going thru a cumbersome process of finding the datevalues for the
dates i am looking for then inserting that value in the vlookup formula
rather than the actual date.

thank you!

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default vlookup using date

Please post the formula you are using.


Gord Dibben MS Excel MVP

On Sat, 29 Jul 2006 14:56:01 -0700, little bear
wrote:

I have data that looks like:
date value1 value2
1/1/01 200 222
1/2/01 340 444
1/3/01 450 532

and i want to look up value1 and value2 based on dates. when i use vlookup
it always produces #NA. i have tried different formatting and it does work
when i convert the date to datevalue and base the lookup on the corresponding
datevalue. why is this? is date not an allowed lookup value for the vlookup
function?

i have lots of data sets with date in different formats that are
periodically added to, and need to find some system for looking up values
without going thru a cumbersome process of finding the datevalues for the
dates i am looking for then inserting that value in the vlookup formula
rather than the actual date.

thank you!


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 247
Default vlookup using date

=VLOOKUP(E9,A1:B3,2,FALSE)
worked for me,you must ensure your lookup values are the same as the values
in your table,and you have the tables sorted correctly if you arent using
false as the 4th argument.Check that your lookup values are the same by
comaring the values directly,ie in a cell type a date that ilooks the same as
one in your table ie =a1=b1.If the result is false even tho the dates look
the same thats where your problem is
--
paul

remove nospam for email addy!



"little bear" wrote:

I have data that looks like:
date value1 value2
1/1/01 200 222
1/2/01 340 444
1/3/01 450 532

and i want to look up value1 and value2 based on dates. when i use vlookup
it always produces #NA. i have tried different formatting and it does work
when i convert the date to datevalue and base the lookup on the corresponding
datevalue. why is this? is date not an allowed lookup value for the vlookup
function?

i have lots of data sets with date in different formats that are
periodically added to, and need to find some system for looking up values
without going thru a cumbersome process of finding the datevalues for the
dates i am looking for then inserting that value in the vlookup formula
rather than the actual date.

thank you!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default vlookup using date

the formula is am using is:
=VLOOKUP(1/1/2001,A1:C4,3)

when i use the cell reference A1 instead of 1/1/2001 in the formula, it
works, which is what led me to the idea of using the datevalue. It isn't
possible to easily find a cell with the right date in it, though, as it might
be thousands of rows down. thank you!

"Gord Dibben" wrote:

Please post the formula you are using.


Gord Dibben MS Excel MVP

On Sat, 29 Jul 2006 14:56:01 -0700, little bear
wrote:

I have data that looks like:
date value1 value2
1/1/01 200 222
1/2/01 340 444
1/3/01 450 532

and i want to look up value1 and value2 based on dates. when i use vlookup
it always produces #NA. i have tried different formatting and it does work
when i convert the date to datevalue and base the lookup on the corresponding
datevalue. why is this? is date not an allowed lookup value for the vlookup
function?

i have lots of data sets with date in different formats that are
periodically added to, and need to find some system for looking up values
without going thru a cumbersome process of finding the datevalues for the
dates i am looking for then inserting that value in the vlookup formula
rather than the actual date.

thank you!



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default vlookup using date


In this formula

=VLOOKUP(1/1/2001,A1:C4,3)

1/1/2001 is not interpreted as a date but as 1 divided by 1 divided by
2001. TRy either

=VLOOKUP(DATE(2001,1,1),A1:C4,3)

or

=VLOOKUP("1/1/2001"+0,A1:C4,3)


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=566336



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default vlookup using date

=VLOOKUP(DATEVALUE("1/1/2001"),A1:C4,3,FALSE)


Gord

On Sat, 29 Jul 2006 15:45:01 -0700, little bear
wrote:

the formula is am using is:
=VLOOKUP(1/1/2001,A1:C4,3)

when i use the cell reference A1 instead of 1/1/2001 in the formula, it
works, which is what led me to the idea of using the datevalue. It isn't
possible to easily find a cell with the right date in it, though, as it might
be thousands of rows down. thank you!

"Gord Dibben" wrote:

Please post the formula you are using.


Gord Dibben MS Excel MVP

On Sat, 29 Jul 2006 14:56:01 -0700, little bear
wrote:

I have data that looks like:
date value1 value2
1/1/01 200 222
1/2/01 340 444
1/3/01 450 532

and i want to look up value1 and value2 based on dates. when i use vlookup
it always produces #NA. i have tried different formatting and it does work
when i convert the date to datevalue and base the lookup on the corresponding
datevalue. why is this? is date not an allowed lookup value for the vlookup
function?

i have lots of data sets with date in different formats that are
periodically added to, and need to find some system for looking up values
without going thru a cumbersome process of finding the datevalues for the
dates i am looking for then inserting that value in the vlookup formula
rather than the actual date.

thank you!




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
insert date Larry Excel Worksheet Functions 28 July 15th 06 02:41 AM
Date Comparison with VLookup techiemom60 Excel Worksheet Functions 1 March 26th 06 10:00 PM
Confusing VLOOKUP with Indirect reference Brian Excel Worksheet Functions 1 November 11th 05 12:03 AM
vlookup on date to text RC Excel Discussion (Misc queries) 1 November 1st 05 06:11 PM
NETWORKDAYS - Multiple Date Selection Annabelle Excel Discussion (Misc queries) 3 October 4th 05 07:04 PM


All times are GMT +1. The time now is 09:43 PM.

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

About Us

"It's about Microsoft Excel"