Return column names of three highest values (with ties!)

btucker

New Member
Joined
Aug 10, 2015
Messages
1
I'm working on matching ~2000 survey participants with 1 of 15 election candidates based on (amongst other criteria) their rating of how important different issues are to them.

There are 10 issues (A-J), but to keep it simple I want to match based on the top 3 issues (i.e. get best fit(s) for the survey participant based on the candidate that has the most issues in common in their top 3). To do this I need to gather the top three issues for each participant.

The issue is that there are many ties in the data (participants were asked to rank issues from 1-4) - is there a way to return the top three valued issues accounting for ties? (e.g. for row 2 it would return B,C,D,E,F and for row 4 it would return B,C,D?)

(fyi: I have tried to adapt the answer kindly posted here by Aladin (http://www.mrexcel.com/forum/excel-questions/469306-return-column-header;-max-value.html) but have found it returns the same column repeatedly if there is more than one answer of the highest value)

If what I'm asking about is not possible, how would I instead use INDEX & MATCH (or other formulas) to return all of the column names with the rating four?


ABCDEFGHIJ
3444442111
1122444331
1433222111

<tbody>
</tbody>

Thank you very much for your time!
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Probably have to use something like:
Code:
Dim fn As Range, fAdr As String
If Application.CountIf(Rows(1), Application.Max(Rows(1))) > 3 Then 'Check how many columns contain the Max number
    Sec fn = Rows(1).Find(Application.Max(Rows(1)), , xlValues) 'Use Find/Find Next to get the column numbers
        If Not fn Is Nothing Then
            fAdr = fn.Address
            Do
                MsgBox fn.Column 'you can list these somewhere or add code to do something with them.
                Set fn = Rows(1).FindNext(fn)
            Loop While fn.Address <> fAdr
        End If
End If
 
Upvote 0

Forum statistics

Threads
1,218,219
Messages
6,141,225
Members
450,344
Latest member
renslaw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top