Get 100 first records by criterium formula

JBlack

New Member
Joined
Sep 13, 2014
Messages
1
Hello!


I'm struggling with the following problem.
I have a long list of data like this:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Name[/TD]
[TD]City[/TD]
[TD]Telephone[/TD]
[TD]No. Customers[/TD]
[TD]Sales[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Emily[/TD]
[TD]City[/TD]
[TD]1234567890[/TD]
[TD]778[/TD]
[TD]12,123[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Andrew[/TD]
[TD]City[/TD]
[TD]1234567889[/TD]
[TD]6[/TD]
[TD]678[/TD]
[/TR]
</tbody>[/TABLE]



What I want to do is to get 100 people (Name, City, Telephone), whose ration of Sales to Customers is the biggest.
In this case it would be Andrew.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
The easiest way would be to create another two columns, one in which you store the ratio(call it e.g. ratio) and the other one for ranking (e.g. rank).
Then follow these steps:
1. In the column ratio calculate the ratio. Apply it to all rows.
2. In the column rank paste this formula:
(Suppose your ratio is in the 7th column and starts from the second row)
Code:
=RANK(G2,$G$2:$G$[last_row_number])+COUNTIF($G$2:G2,G2)-1
Apply to all your rows.
3. Now, in the place, where you want to have the results the following and drag it for 100 rows.

  • In the name column paste this:
Code:
=INDEX($B$2:$B$[last_row_number],MATCH(ROW(1:1),$G$2:$G$[last_row_number],0))

  • In the city column paste this:
Code:
=INDEX($C$2:$C$[last_row_number],MATCH(ROW(1:1),$G$2:$G$[last_row_number],0))

  • And in the telephone column this:
Code:
=INDEX($D$2:$D$[last_row_number],MATCH(ROW(1:1),$G$2:$G$[last_row_number],0))


Hope that helps! :biggrin:
 
Upvote 0

Forum statistics

Threads
1,222,405
Messages
6,165,867
Members
451,989
Latest member
DannyBoy1977

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