VLOOKUP error

Chris Davison

MrExcel MVP
Joined
Feb 15, 2002
Messages
1,790
Mornign All,

I'm getting an error on the following :

=VLOOKUP(2,{1,"Chris";2,now()},2,0)

am I right in thinking I'm not allowed to use ANY volatile functions in arrays ?

thanks
Chris
:)
 
On 2002-04-13 16:48, Yogi Anand wrote:
On 2002-04-13 16:35, Chris Davison wrote:
Mornign All,

I'm getting an error on the following :

=VLOOKUP(2,{1,"Chris";2,now()},2,0)

am I right in thinking I'm not allowed to use ANY volatile functions in arrays ?

thanks
Chris
:)

Hi Chris:
As I mentioned in my post above I believe you can not use any FUNCTION, or even a CELL REFERENCE in an array. One can however, like in your instance use the INDIRECT FUNCTION ...

=INDIRECT(VLOOKUP(2,{1,"Chris";2,"E19"},2,0))

where E19 houses =NOW()

and I did get the result as 4/13/02 7:43 PM

Keep up the good work buddy!

Yogi,

This is quite wrong.
Change the lookup-value from 2 to 1. You'll see.

Regards,

Aladin
 
Upvote 0

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
On 2002-04-13 16:47, Chris Davison wrote:
Daleyman.... wow we're all up late !!

I'm still farting around with an earlier thread about lottery numbers generated from a single formula

if you're curious : http://www.mrexcel.com/board/viewtopic.php?topic=3658&forum=2 but it's a bit boring now LOL

I have that thing still in my mind. If it is acceptable to return once in a while, I got something for you.
 
Upvote 0
Hi Chris:
As I mentioned in my post above I believe you can not use any FUNCTION, or even a CELL REFERENCE in an array. One can however, like in your instance use the INDIRECT FUNCTION ...

=INDIRECT(VLOOKUP(2,{1,"Chris";2,"E19"},2,0))

where E19 houses =NOW()

and I did get the result as 4/13/02 7:43 PM

Keep up the good work buddy!

Yogi,

This is quite wrong.
Change the lookup-value from 2 to 1. You'll see.

Regards,

Aladin

Hi Aladin:
Thanks for your message! ... I did put the lookup value as 1, and as you did mention instead of getting Chris, I got #REF
I did want to acknoqledge that first before I went looking into what is really happening -- what do you figure, 1) why did I get the right result for Lookup value of 2, and not with 1?

Regards!
 
Upvote 0
On 2002-04-13 17:56, Yogi Anand wrote:
Hi Chris:
As I mentioned in my post above I believe you can not use any FUNCTION, or even a CELL REFERENCE in an array. One can however, like in your instance use the INDIRECT FUNCTION ...

=INDIRECT(VLOOKUP(2,{1,"Chris";2,"E19"},2,0))

where E19 houses =NOW()

and I did get the result as 4/13/02 7:43 PM

Keep up the good work buddy!

Yogi,

This is quite wrong.
Change the lookup-value from 2 to 1. You'll see.

Regards,

Aladin

Hi Aladin:
Thanks for your message! ... I did put the lookup value as 1, and as you did mention instead of getting Chris, I got #REF
I did want to acknoqledge that first before I went looking into what is really happening -- what do you figure, 1) why did I get the right result for Lookup value of 2, and not with 1?

Regards!

Yogi,

VLOOKUP fetches the constant E19 and hands it over to INDIRECT which deferences that constant. But other values in the constant array cannot be deferenced because they do not refer to anything but to themselves.

Regards,

Aladin
 
Upvote 0

Forum statistics

Threads
1,213,487
Messages
6,113,938
Members
448,534
Latest member
benefuexx

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top