View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default VLookup Returning last cell??

From XL Help ("VLOOKUP"):

Range_lookup is a logical value that specifies whether you want
VLOOKUP to find an exact match or an approximate match. If TRUE or
omitted, an approximate match is returned. In other words, if an
exact match is not found, the next largest value that is less than
lookup_value is returned. If FALSE, VLOOKUP will find an exact match.
If one is not found, the error value #N/A is returned.


and

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.


If you're not sorting your values in ascending order, you need to set
Range_lookup to FALSE.


In article .com,
wrote:

Here is the list I am using from worksheet 1 (named
"charges")...partial list...worksheet is 400 rows long
COLUMN C COLUMN D
22.942777778 18
22.993611111 19
23.054166667 20
23.149444444 21
...
13.403611111 262
13.469722222 263
13.534722222 263
13.687500000 263


Here is the list I am using from worksheet 2
COLUMN B COLUMN C
23:00 19
23:05


I'm using this formula from worksheet 2 in column C
=VLOOKUP((B28-0)*24,Charges!C6:D40,2)

Everything works fine when I use the above formula...but when I expand
the query set to D400 (because there may be up to 400 rows of data) it
always returns the last cell (263) with data.

Any idea why it returns the last row? Is there a max in the range?
Any help is very much appreciated.

-BD