View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
vsoler vsoler is offline
external usenet poster
 
Posts: 79
Default Find a second value in a table with VLOOKUP

On 21 mayo, 09:32, "T. Valko" wrote:
Does that mean the team code appears twice?

A1:A20 = team codes
B1:B20 = team members

D1 = team code to lookup

First team member:

=VLOOKUP(D1,A1:B20,2,0)

Second team member:

=LOOKUP(2,1/(A1:A20=D1),B1:B20)

Biff

"vsoler" wrote in message

ups.com...





My table (range) contains, among other information, the code for a
team and the name of the person. Each team is made of 2 people.


I need to find the second person belonging to a team, which will not
be necessarily just below the first person.


Is there a way to find this second person. I do not mind using VLOOKUP
or any other function.


Thank you- Ocultar texto de la cita -


- Mostrar texto de la cita -


T. Valko,

Your formula is great, really excellent, I like it.

However, I have tested it in another worksheet that solves another
problem, and it has a peculiar behaviour.

1. No matter what the first argument of the LOOKUP function is, it
always returns the last appearance of the searched value.

2. If I use 3 instead of 2, it also works in the example given to you,
even though the team is made of only 2 people.

I wish I could understand a little more how your formula works.

Thank you very much indeed.