问题
I found a partial answer to this question under How do you calculate the Quintile for every row in Excel?. I would like to derive the same quintile data for each row but I need the quintiles to be based on groups that are determined by a value in another column.
回答1:
Use this formula:
=MAX(1,ROUNDUP(10*PERCENTRANK($C:$C,$C2,4),0))
Change the value 10 to split into whatever number of groups you need - currently it's making decile groups. Change $C:$C to column with target range of values, and change $C2 to the cell in the first row with target value and autofill down.
Your output will be a split of groups based on the value of 1 being lowest and anything greater higher value in terms of numerical value.
If you mean just row numbers as your ranking criteria, you could insert a new column in A and autofill down numbers that correspond to your row references.
来源:https://stackoverflow.com/questions/38310395/how-do-you-calculate-the-quintile-for-groups-of-rows-in-excel