Looking for VLOOKUP Trick

shdawson

Active Member
Joined
Jan 6, 2007
Messages
381
Hi,

Love VLOOKUP. Has met a lot of needs I have had over the years.

Question:
What do you do when the lookup value is to the RIGHT of the lookup range? In the past, I have referenced the row via =B2, say in column Z. It works, but it can get messy.

Is there another trick out there to overcome this problem?


Thanks,
S
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
I notice that you have omitted the last part of MATCH in your formula, which denotes the match-type to be used (1 is the default if omitted).

If you want an exact match (which most of the time is what is required), use 0 as the match_type, like:

=INDEX('Tasks Report'!L$2:L$10000,MATCH(A2,'Tasks Report'!X$2:X$10000,0))

But I suspect this may not fix your problem. Have you run it through the formula evaluator to assess where it's failing?

Matty
 
Upvote 0
Your code works better.

Now, I take it...if nothing is found, the cell gets populated with a 2 (though not clear what this is)? Please advise.


Thanks,
S
 
Upvote 0
=VLOOKUP(A2,CHOOSE({1,2},'Tasks Report'!X$2:X$10000,'Tasks Report'!L$2:L$10000),2,0)
That's neat.

DonkeyOte - do you have a link to the Thread where Mr Houdini originally used this magic, please?

Thanks,

Matty
 
Upvote 0
Matty said:
DonkeyOte - do you have a link to the Thread where Mr Houdini originally used this magic, please?

It was on a different forum so I'd have to check with him first that he's ok with that... essentially it was demo'd as part of a general discussion regards the merits/uses of CHOOSE.

shdawson said:
Now, I take it...if nothing is found, the cell gets populated with a 2 (though not clear what this is)? Please advise

If you're referring to the VLOOKUP alternative - it works just the same as any normal VLOOKUP - ie will return #N/A if criteria not found.
 
Upvote 0
It was on a different forum so I'd have to check with him first that he's ok with that... essentially it was demo'd as part of a general discussion regards the merits/uses of CHOOSE.

OK, no worries.

Cheers,

Matty
 
Upvote 0
Thanks for posting the link, DonkeyOte. And thanks to Barry Houdini for sharing this clever trick.

Matty
 
Upvote 0

Forum statistics

Threads
1,215,530
Messages
6,125,350
Members
449,220
Latest member
Edwin_SVRZ

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