My spreadsheet currently has these three columns: CompanyID, FactorScore, StockReturn.
I need to create a second sheet that will calculate the median StockReturn for each decile of FactorScores. In other words, sort the factor scores and form into 10 equally-sized groups. Then calculate the median stock return within each decile group.
The stock returns are live, so I'm looking for a solution that is continually recalculating.