Using RIGHT function in a VLOOKUP

R

rudy

I have been trying to use the RIGHT function in a VLOOKUP and can not
get it to work. For example if my VLOOKUP is

=VLOOKUP(A16,A8:E8,5,FALSE)

In the range I am looking at I only want to look at the right 2
characters in column A.

If cell A8 is M200612 I only want to look for the 12.

Does anyone know how to do this???

Thanks.
 
B

Bob Phillips

Try it as you said it

=VLOOKUP(RIGHT(A16,2),A8:E8,5,FALSE)


--
HTH

Bob Phillips

(replace somewhere in email address with googlemail if mailing direct)
 
R

rudy

I actually need to apply the RIGHT,2 condition to the range I am look
at, not the value I am looking for.

Thanks.
 
D

Dave Peterson

I'm confused why you're only looking at one row--but maybe that's a typo in the
newsgroup post.

=INDEX(E8:E15,MATCH(A16,RIGHT(A8:A15,2),0))

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Adjust the range to match--but you can't use the whole column.
 
B

Bob Phillips

Sorry, it's a number, so try

=VLOOKUP(--RIGHT(A16,2),A16,2),A8:E8,5,FALSE)

--
HTH

Bob Phillips

(replace somewhere in email address with googlemail if mailing direct)
 
Top