# If statement with reference to 2 matching fields in the same row

#### 8BallGuy

##### New Member
Hi all

Having issues figuring out how to draw data from a specific field for a player on a certain team. The problem is that players can be on multiple teams and each player on a team needs a minimum number of games player on that said team. So I need to reference the team ID and the player ID and if they match in the same row then I need to display the number of games played on the score sheet.

Sooo... Looking to do something like this

If A and B match in one row on Roster sheet print field C from the same row from Roster sheet in D on Scoresheet.
Currently I am using this
=IFERROR(VLOOKUP(\$C15,Player!\$B\$1:\$O\$846,2,0),"")

The Player sheet unfortunately is the players league wide stats so wouldn't help.

Last edited:

### Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a \$25,000 loan, 5% annual interest, 60 month loan.

#### 8BallGuy

##### New Member
Going to try to be a little clearer with my question.

If A and B Match in one row on sheet 2 print C from same row in F on Sheet 1

I have a Rosters sheet and a score sheet. I need the games played by a player on a specific team on the score sheet. I started drawing the overall games played on another sheet but that wrong. I used this to draw the wrong data

Code:
``<code><code>=IFERROR(VLOOKUP(\$C15,Player!\$B\$1:\$O\$846,2,0),"")</code></code>``

The player sheet is the players league wide total so no good for this and the formula doesn't help without the if matches stuff.
</pre>

Actual fields
In F15
If C13 (Scoresheet) matches B (Rosters) and C15 (Scoresheet) matches E (Rosters) of the same row print F (Rosters)

Trying to wrap my head around it but could use some help if possible. How can I do this?

This one of the Scoresheet sheet tables. Top Format is setup for print and the second is just to make it easier visually to answer my question.

Team ID
33017 The Pirates
Player ID GP HC
10101 5 3 Webster, Max
10202 4 4 Bundy, Bud

 Team ID Team Name Player ID Games Played Handicap Player name 33000 Team A 10101 ? 3 Webster, Max 33000 Team A 10202 ? 4 Bundy, Bud 44000 Team B 10101 ? 3 Webster, Max 55000 Team C 10202 ? 4 Bundy, Bud

This is Part of the Rosters Sheet

 Team Name Team ID Handicap Player Player ID Games Pooloholics 33000 3 Webster, Max 10101 5 Pooloholics 33000 4 Bundy, Bud 10202 4 Team B 44000 3 Webster, Max 10101 5 Team C 55000 4 Bundy, Bud 10202 4

Replies
1
Views
53
Replies
7
Views
156
Replies
3
Views
77
Replies
2
Views
417
Replies
0
Views
63