second vlookup

C

choice

i have A1:E1000
A= first names (not unique)

how do would i go about doing a vlookup to get the first,second,third, etc
vlookup(F1,a1:e1000,3,0,*Return second instance*)

thanks in advance
 
M

Max

One way

Your table is in A1:E1000, and the
corresponding value to be returned is in col C

Use an empty col to the right, say col K

Put in K1: =IF(A1="","",COUNTIF($A1:A$1,A1))

Copy K1 down to K1000

Col K will number / assign the instances for the items
(i.e. the first names) in col A

Let's earmark:

F1 for input of the first names
G1 for input of the required instance, i.e.: 1, 2, 3, etc

Put in H1:

=IF(ISNA(MATCH(TRIM(F1&G1),TRIM($A$1:$A$1000&$K$1:$K$1000),0)),"",INDEX($C$1
:$C$1000,MATCH(TRIM(F1&G1),TRIM($A$1:$A$1000&$K$1:$K$1000),0)))

Array-enter the formula in H1 with CTRL+SHIFT+ENTER,
instead of just pressing ENTER

H1 will return the desired value from col C
for the inputs in F1 and G1

Any unmatched cases will return blanks: ""
 

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