Return two values based on another

gfaulds

New Member
Joined
Jan 15, 2014
Messages
14
Office Version
  1. 365
Platform
  1. Windows
Hello,

I'm trying to be able to return data from two columns based on a value on the third. The list below shows a DM name, the employee ID number and their score. What I want to produce is a list where for each DM, I return the employee name and score based on the highest score. So in the data below for John, it should return employee 1777 and score 48.96%.

Thank you for any help!

DMEmployeeScoreDMEmployeeScore
Anton5232-John
Kyle1503-Adam
Steve1249-CJ
Monica221751.57%Lisa
Morgan839450.74%Sarah
John177748.96%Amy
Leo428147.01%Kyle
Kimberly125147.00%Leo
Bill177946.57%Morgan
Gilbert58446.19%Anton
John113046.12%Steve
Jane162745.58%Kimberly
Amy125245.16%Monica
Anton160344.49%Cindy
Jane35144.29%Jane
Leo272543.52%Eddie
Steve58243.23%Robert
Eddie92842.99%Gilbert
Sarah173942.93%Matt
Steve174942.62%Bill
<colgroup><col width="64" style="width: 48pt;" span="7"> <tbody> </tbody>
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Heres a way with those tables copied and pasted into A1:

in F2: =IF(COUNTIFS($A$2:$A$21,E2),MAX(INDEX(($A$2:$A$21=E2)*$B$2:$B$21,0)),"-")
in G2: =IF(ISNUMBER(F2),INDEX($C$2:$C$21,MATCH(1,INDEX(($A$2:$A$21=E2)*($B$2:$B$21=F2),0),0)),"-")
 
Upvote 0
Thanks for the help. It looks like its returning the highest value in B (employee ID) instead of C (score). The goal is tor return the highest score and corresponding Employee ID for each DM. I think we are close.

really appreciate it so far.
 
Upvote 0
=IF(ISNUMBER(G2),INDEX($B$2:$B$21,MATCH(1,INDEX(($A$2:$A$21=E2)*($C$2:$C$21=G2),0),0)),"-")

Then this which requires CTRL-SHIFT-ENTER:

=IF(COUNTIFS($A$2:$A$21,E2,$C$2:$C$21,"<>-"),MAX(IF($A$2:$A$21=E2,IF(ISNUMBER($C$2:$C$21),$C$2:$C$21))),"-")
 
Upvote 0
Not all the time. I'm just trying to automate having to look them all up myself. The table is actually much larger, I just reduced it down as an example.

Thanks for the follow-up.
 
Upvote 0
Hi!

Try the Array Formulas below too.

In G2 and copy down - use Ctrl+Shift+Enter to enter the formula

=IFERROR(LARGE(IF(E2=A$2:A$21,C$2:C$21),1),"")

In F2 and copy down - use Ctrl+Shift+Enter to enter the formula

=IF(G2="","",INDEX(B$2:B$21,MATCH(E2&G2,A$2:A$21&C$2:C$21,0)))<strike>
</strike>


ABCDEFGH
1DMEmployeeScoreDMEmployeeScore
2Anton5232-John177748,96%
3Kyle1503-Adam
4Steve1249-CJ
5Monica221751,57%Lisa
6Morgan839450,74%Sarah173942,93%
7John177748,96%Amy125245,16%
8Leo428147,01%Kyle
9Kimberly125147,00%Leo428147,01%
10Bill177946,57%Morgan839450,74%
11Gilbert58446,19%Anton160344,49%
12John113046,12%Steve58243,23%
13Jane162745,58%Kimberly125147,00%
14Amy125245,16%Monica221751,57%
15Anton160344,49%Cindy
16Jane35144,29%Jane162745,58%
17Leo272543,52%Eddie92842,99%
18Steve58243,23%Robert
19Eddie92842,99%Gilbert58446,19%
20Sarah173942,93%Matt
21Steve174942,62%Bill177946,57%
22
**********************************************************

<tbody>
</tbody>


Markmzz
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,523
Messages
6,120,033
Members
448,940
Latest member
mdusw

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top