Lookup nth entry

F

Faraz A. Qureshi

Any formula or UDF to use VLOOKUP so as to return the nth (for example 6th
entry) feedback when there are more than one matching entries in the lookup
array?
 
J

Jacob Skaria

Hi Faraz

Try the below array formula

Lookup value in C1
Lookup array A1:B1000
The last entry denotes the nth entry (in this example it is 2)

=INDEX($B1:$B1000,SMALL(IF($A$1:$A$1000<>$C1,"",($A$1:$A$1000=$C1)*ROW($A$1:$A$1000)),2))

If this post helps click Yes
 
L

Lars-Åke Aspelin

Any formula or UDF to use VLOOKUP so as to return the nth (for example 6th
entry) feedback when there are more than one matching entries in the lookup
array?



Try the following formula

=INDEX(B1:B50,SMALL(IF(A1:A50=C1,ROW(A1:A50)),C2))

Note: This is an array formula that has to be confirmed with
CTRL+SHIFT+ENTER rather than just ENTER.

A1:A50 is the leftmost column of your table array.
B1:B50 is where you results are
C1 is where your lookup value is
C2 is where your n, e.g. 6, is

Change these parameters to adapt to your worksheet.

Hope this helps / Lars-Åke.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top