Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Another Excel index/match or vlookup problem 1

Status
Not open for further replies.

sdiverdan

Technical User
Sep 23, 2003
28
0
0
CA
I'm stuck again and this time it's turing my hair gray! I have two sheets (call it Sheet1 & sheet2).

Sheet1 is:
Name Team Position
Bob 2 1
Dan 5 3
George 1 2
Mac 1 1
Ted 2 2

this sheet is sorted by name.

Sheet2 is a report that looks like:
Team 1
PlayerA team 1 position 1
PlayerB team 1 position 2
etc..

Team 2
PlayerC team 2 position 1
PlayerD team 2 position 2
etc..

I'm looking for a formula that lookups the team # and position # for the report and returns the player's name. So in this simple example. PlayerA is a index/match or whatever finding the player of team 1 position 1 which would be Sheet1!A5 or 'Mac'.

Dazed again!


Dan
 
oh... one more thing if the team/position is not there I want to return "Vacant" versus a player's name.

Dan
 
Once you have type the following formula, use CTRl-SHIFT-ENTER to enter it as an array formula

=INDEX(Sheet1!$A$2:$A$5,MATCH(B2,IF(Sheet1!$C$2:$C$5=C2,Sheet1!$B$2:$B$5),0))


and if you want to add "Vacant" to it then it becomes

=IF(ISERROR(=INDEX(Sheet1!$A$2:$A$5,MATCH(B2,IF(Sheet1!$C$2:$C$5=C2,Sheet1!$B$2:$B$5),0)),"Vacant",=INDEX(Sheet1!$A$2:$A$5,MATCH(B2,IF(Sheet1!$C$2:$C$5=C2,Sheet1!$B$2:$B$5),0)))


 
This proves I am trigger happy. Too quick to hit submit. the equal signs in front of index in both instances in the second formula have to go.

 
thanks xlhelp! I had to also put in an extra ')' before the "Vacant" and viola it works beautifully!
[2thumbsup]

Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top