Display top salespeople per client

TommyTenenbaum

New Member
Joined
Jul 25, 2018
Messages
1
Dear all,
I have a file with some raw data where I have 3 columns: Client code / Salesperson / Sales (in $)
I would like to find a way to display the top 3 salesperson for each Client code in another table, with 4 Columns: Client Code / Salesperson 1 / Salesperson 2 / Salesperson 3.
I tried looking for ways to do that online, I found a sumproduct function with some double negatives that helped me to rank the salespeople but I didn't know what to do next with the ranks I got...

Please bear in mind that I don't have 3 clients but 10K+ and 7K+ Salespeople in my raw database.
You can find below a simple example to illustrate what I would like to get.
Thanks a lot for your help!!

Raw data:

[TABLE="width: 387"]
<colgroup><col><col span="2"><col></colgroup><tbody>[TR]
[TD]Client Code[/TD]
[TD]Salesperson[/TD]
[TD]Sales[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Client 1[/TD]
[TD]Jeff[/TD]
[TD]200[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Client 1[/TD]
[TD]Lisa[/TD]
[TD]600[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Client 2[/TD]
[TD]Tom[/TD]
[TD]100[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Client 2[/TD]
[TD]Albert[/TD]
[TD]350[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Client 2[/TD]
[TD]Karen[/TD]
[TD]400[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Client 3[/TD]
[TD]Karen[/TD]
[TD]200[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Client 3[/TD]
[TD]Ana[/TD]
[TD]400[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
Table where I want the names displayed:[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Client Code[/TD]
[TD]Salesperson #1[/TD]
[TD]Salesperson #2[/TD]
[TD]Salesperson #3[/TD]
[/TR]
[TR]
[TD]Client 1[/TD]
[TD] ?[/TD]
[TD] ?[/TD]
[TD] ?[/TD]
[/TR]
[TR]
[TD]Client 2[/TD]
[TD] ?[/TD]
[TD] ?[/TD]
[TD] ?[/TD]
[/TR]
[TR]
[TD]Client 3[/TD]
[TD] ?[/TD]
[TD] ?[/TD]
[TD] ?[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
I think that your best bet would be to turn your raw data into a Pivot Table. Put Client Code and Salesperson in the 'Rows' section and Sales in the 'Values' section.
 
Upvote 0
I prefer the pivot table also here. If you must see the names instead, sort by client, then sales descending, and:


Excel 2010
ABCDEFGHI
1Client CodeSalespersonSalesClient CodeSalesperson #1Salesperson #2Salesperson #3
2Client 1Lisa600Client 1LisaJeff#NUM!
3Client 1Jeff200Client 2KarenAlbertTom
4Client 2Karen400Client 3AnaKaren#NUM!
5Client 2Albert350
6Client 2Tom100
7Client 3Ana400
8Client 3Karen200
Sheet3
Cell Formulas
RangeFormula
G2{=INDEX($B$1:$B$8,SMALL(IF($A$2:$A$8=$F2,ROW($A$2:$A$8)),COLUMN(A1)))}
Press CTRL+SHIFT+ENTER to enter array formulas.


(you can delete the #NUM!s with F5(Goto)-Special-Errors)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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