I need to calculate an index that is to be derived like this:
If we have some data: 850 700 500 480 300 100 50, we first sort it from the large to small:
850
700
500
480
300
100
50
Then calculate the sum: 2980.
Then we take a given number of percents, for example, 50% and get a 50% of the sum:1490. Then we go down the data, calculating the sum for the given row plus the sum of all the rows prior:
850 850
700 1550
500 2050
480 2530
300 2830
100 2930
50 2980
Once the sum in the second row equals or exceed the 50% of the total sum = 5050 we take the corresponding number from the first row: 700. So that number is the aswer.
What is that number called? I need to know to find an appropriate excel function to calculate it.
Still no idea how it's called, but here's how I implemented the search for it in vba: