# 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

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

#### 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
343
Replies
10
Views
755
Replies
1
Views
929
Replies
6
Views
714
Replies
0
Views
868

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,163,598
Messages
5,832,646
Members
430,151
Latest member
Kacbear

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back