Jumat, 16 September 2011

Re: [ExcelVBA] Vlookup(Date, range, 1, true)

 

There are several, several and... several... possibilities.

without seening your data and function, it's really difficult to guess.

However... because you said "it always returns the same date".

In your function, are you using all parameters?

the syntax is:
VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])

even though they SAY that [range_lookup] is optional, it's really not.
it's only optional if you're willing to accept a value that's "close" to what
you're looking for.

This value should always be "false"

secondly.. dates are funny things.
Based on the source of the data, even though you may SEE a date, it actually
contains time information.
(try changing the format of the cells and see if it shows you 12:00 as a time
for all values.
If it does, then the default time is midnight)
This is important, because these two values:
9/16/2011 10:23:14
9/16/2011 10:23:15

will each display as 9/16/2011, but in reality, they're stored as:
40802.4327972222
40802.4328125000

and if you're looking for 9/16/2011, you're really comparing the values of these
numbers to 40802.00000000

which you won't find, unless one of the values happens to be at midnight.

So... we need more info to move forward with helping you with this one.

Paul
-----------------------------------------
"Do all the good you can,
By all the means you can,
In all the ways you can,
In all the places you can,
At all the times you can,
To all the people you can,
As long as ever you can." - John Wesley
-----------------------------------------

________________________________
From: David <who1012000@yahoo.com>
To: ExcelVBA@yahoogroups.com
Sent: Fri, September 16, 2011 10:15:43 AM
Subject: [ExcelVBA] Vlookup(Date, range, 1, true)

 
Hello All,

I am doing a Vlookup on a date, but it fails. Is there something about dates
that fails? It always returns the same date, which is always incorrect.

Thanks,
David

[Non-text portions of this message have been removed]

__._,_.___
Recent Activity:
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.


A bad score is 598. A bad idea is not checking yours, at freecreditscore.com.
.

__,_._,___

Tidak ada komentar:

Posting Komentar