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:
IDNameCityTelephoneNo. CustomersSales
1EmilyCity123456789077812,123
2AndrewCity12345678896678

<tbody>
</tbody>



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

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
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,214,940
Messages
6,122,356
Members
449,080
Latest member
Armadillos

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