Excel - Getting the Top 5 data of a column and their matching title but produces duplicates

我与影子孤独终老i 提交于 2019-12-18 09:48:48

问题


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.


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


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))


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:


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



来源:https://stackoverflow.com/questions/56014349/excel-getting-the-top-5-data-of-a-column-and-their-matching-title-but-produces

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!