Excel - Getting the Top 5 data of a column and the

2020-02-16 02:57发布

I am developing a web application made using PHP (withh CodeIgniter as the framework) that should produce an excel file report as as summary of data.

I am using PHPSpreadsheet as a library to generate the .xlsx file and everything is successful.

Raw Data

I was able to display in a certain range of cell the top 5 values of a column ie. Top 5 Publications that has the most number of Articles.

With the use of the code =LARGE(ColumnOfTheDataRange , NumeralValue) -- I was able to get the top 5 of what I wanted

Top 5
Then, on the left side of these top 5 data, I need to display the matching Publication Names / Publications. I was able to do it with the function =INDEX(PublicationNamesCellRange, MATCH(CellOfTheMatchingData, ColumnOfTheDataCellRange, 0))

Publication Names

Now, kindly notice that there are multiple article counts 54 in the top 5 data column (right), which should belong to 2 different Publications. The problem is, what code or technique should I use to produce the unique Publication Name so that it won't repeat the Publication Name E because in the original excel file, the Publication Name E is the first one that has the matching data of 54?

1条回答
我只想做你的唯一
2楼-- · 2020-02-16 03:07

This is what I ended up using, edit to your situation.

enter image description here

查看更多
登录 后发表回答