I am making a NodeXL spreadsheet examining partnerships between NGOs and the topic of collaboration (ex. Education, Economic Development, Medicine).

The Edge cells (Network) looks kind of like this:

Org I Org I Topic
Org A I Org B I Education
Org A I Org C I Medicine
Org A I Org D I Education
Org A I Org E I Education
Org B I Org C I Medicine
Org B I Org D I Medicine
Org B I Org D I Medicine
...

I want to know what kind of partnership (Topic) is most prevalent in each NGO's portfolio. I used this:

=INDEX(Range,MATCH(MAX(COUNTIF(Range,Range)),COUNTIF(Range,Range),0))

The problem I encountered was that if I rearranged the order of the rows using Filter, obviously, the INDEX/MATCH function won't work.

Is there anyway to fix the INDEX/MATCH function to the organizations listed in Column A? So, "Among the cells under Topics for ORG A, which Topic of partnerships occurs the most?"

Thank you for your time and help!