Highlight top values based on text in specific column

smide

Board Regular
Joined
Dec 20, 2015
Messages
164
Office Version
  1. 2016
Platform
  1. Windows
Hello.




In column B (B3:B600) of my Workbook I have a list of different towns (about 25 towns) and in column C (C3:C600) customer names.


In column F (F3:F600) there are buying prices for each customer.


I need to highlight (color red) cells with top FIVE customer names (column C) based on buying price value and town name for each town.


example.

[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]F[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD][/TD]
[TD]Town1[/TD]
[TD]Name1[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]15[/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD][/TD]
[TD]Town1[/TD]
[TD]Name2[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]2[/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD][/TD]
[TD]Town1[/TD]
[TD]Name3[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]10[/TD]
[/TR]
[TR]
[TD="align: center"]6[/TD]
[TD][/TD]
[TD]Town1[/TD]
[TD]Name4[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]0[/TD]
[/TR]
[TR]
[TD="align: center"]7[/TD]
[TD][/TD]
[TD]Town1[/TD]
[TD]Name5[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]6[/TD]
[/TR]
[TR]
[TD="align: center"]8[/TD]
[TD][/TD]
[TD]Town1[/TD]
[TD]Name6[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"] 24[/TD]
[/TR]
[TR]
[TD="align: center"]9[/TD]
[TD][/TD]
[TD]Town1[/TD]
[TD]Name7[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]9[/TD]
[/TR]
[TR]
[TD="align: center"]10[/TD]
[TD][/TD]
[TD]Town2 (new town)[/TD]
[TD]Name8[/TD]
[TD][/TD]
[TD][/TD]
[TD] 7[/TD]
[/TR]
[TR]
[TD="align: center"]11[/TD]
[TD][/TD]
[TD]....[/TD]
[TD]...[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]....[/TD]
[/TR]
</tbody>[/TABLE]


highlighted top FIVE customer names for Town1 (based on values in column F): C3, C5, C7, C8 and C9
 
Last edited:

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Try using conditional formatting with a formula like

=SUMPRODUCT(--($B$2:$B$101=$B2),--($F$2:$F$101>$F2))<5

The sumproduct counts how many rows with the matching town name have a bigger value in column F.
 
Upvote 0

Forum statistics

Threads
1,223,240
Messages
6,170,951
Members
452,368
Latest member
jayp2104

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