Need a lookup formula

User avatar
StuartR
Administrator
Posts: 12604
Joined: 16 Jan 2010, 15:49
Location: London, Europe

Need a lookup formula

Post by StuartR »

I have a list that I use for Data Validation. Next to each entry in the list I have a numeric value

Assume that it looks like this (in cells P3:Q5)
AAA 123
BBB 45.2
CCC 100.78

In cell N3 I have a drop down box that selects one entry from the list.

In another cell I need to return the value ABOVE the one that corresponds to the drop down box. So if the box currently shows CCC, I need the value 45.2

What's the easiest way to do this?
StuartR


User avatar
rory
5StarLounger
Posts: 817
Joined: 24 Jan 2010, 15:56

Re: Need a lookup formula

Post by rory »

=INDEX($Q$2:$Q$4,match(N3,$P$3:$P$5,0))
would be one way.
Regards,
Rory

User avatar
StuartR
Administrator
Posts: 12604
Joined: 16 Jan 2010, 15:49
Location: London, Europe

Re: Need a lookup formula

Post by StuartR »

That formula did exactly what I asked rory, but I then realised that I needed to special case the first two entries in the list, so I added an extra column in R3:R5, with a link to the previous values in Q3:Q5 (ans special cases for the first two entries), and used Vlookup.

Thanks anyway.
StuartR