I need to do an OFFSET(???, 3,2)
The ??? would be the cell that a VLOOKUP found the Lookup_Value in the
Table_Array.
or
The Vlookup found what it was looking for, but what cell was in in?
Any ideas how I can do this?
I was told to..
How do I get the result from a VLOOKUP into the function?
You could use application.match()
Dim res as variant 'could be an error
dim somevalue as string 'or what???
dim somerange as range
set somerange = worksheets("somesheet").range("a:a")
res = application.match(somevalue, somerange,0)
if iserror(res) then
msgbox "no match"
else
msgbox somerange(res).offset(0,1).value
end if
Ron Luzius wrote:
> I need to do an OFFSET(???, 3,2)
>
> The ??? would be the cell that a VLOOKUP found the Lookup_Value in the
> Table_Array.
>
> or
>
> The Vlookup found what it was looking for, but what cell was in in?
>
> Any ideas how I can do this?

Signature
Dave Peterson
Wondering - 29 Sep 2007 21:33 GMT
Try this:
=OFFSET(INDIRECT(ADDRESS(ROW(Table_array)+MATCH(Lookup_value,Table_array,0)-1,COLUMN(Table_array))),3,2)
Dave
>I need to do an OFFSET(???, 3,2)
>
[quoted text clipped - 38 lines]
>>
>> Any ideas how I can do this?
Wondering - 29 Sep 2007 21:44 GMT
You may have to change the MATCH function match_type (third argument) which
is 0 (exact match) in the example. See help.
> Try this:
>
> =OFFSET(INDIRECT(ADDRESS(ROW(Table_array)+MATCH(Lookup_value,Table_array,0)-1,COLUMN(Table_array))),3,2)
>
> Dave
T. Valko - 29 Sep 2007 22:40 GMT
Try something like this:
=INDEX(B2:D10,MATCH(lookup_value,A2:A10,0)+3,2)

Signature
Biff
Microsoft Excel MVP
>I need to do an OFFSET(???, 3,2)
>
[quoted text clipped - 38 lines]
>>
>> Any ideas how I can do this?
daddylonglegs - 30 Sep 2007 01:09 GMT
Hello Biff,
If 1st occurence of lookup_value is in A8 for example you'd get a #REF!
error. Perhaps
=INDEX(OFFSET(A2:A10,3,2),MATCH(lookup_value,A2:A10,0))
> Try something like this:
>
[quoted text clipped - 42 lines]
> >>
> >> Any ideas how I can do this?
T. Valko - 30 Sep 2007 02:57 GMT
>If 1st occurence of lookup_value is in A8 for
>example you'd get a #REF! error.
Based on the post I'm "guessing" the table looks something like this (with
additional columns):
x.....1
.......2
.......3
.......4
y.....1
.......2
.......3
.......4
So, my formula is referencing the entire range of data including the empty
cells in the first column.

Signature
Biff
Microsoft Excel MVP
> Hello Biff,
>
[quoted text clipped - 49 lines]
>> >>
>> >> Any ideas how I can do this?