Second Most Common text value

DGBedard

New Member
Joined
Aug 3, 2007
Messages
16
Hello,
I have a spreadsheet where person's names appear in columns A and B and columns C through AF contain alternating attendance (Y or X) indicators and Participation grades (a,b,c)

Example row 3:
John,Doe,Y, a, Y, a, X, b, Y, a, Y, b, Y, c, Y, etc.

In column AG, I would like a formula that tells me the second most common text value (second because "Y" is the most common). for the row above the second most common value would be "a".

Here is what I tried but I get a #NUM error

=INDEX(C3:AF3,MATCH(LARGE(COUNTIF(INDEX(C3:AF3,0),C3:AF3),LARGE(COUNTIF(INDEX(C3:AF3,0),C3:AF3),1)+1),INDEX(COUNTIF(INDEX(C3:AF3,0),C3:AF3),0,),))

Any help would be apprciated
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
How about:

=INDEX({"a","b","c"},MATCH(MAX(COUNTIF(C3:AF3,{"a","b","c"})),COUNTIF(C3:AF3,{"a","b","c"}),0))
 
Upvote 0
Another approach, assuming all cells in the range C3:AF3 will be populated

=INDEX(C3:AF3,MODE(IF(C3:AF3<>"Y",MATCH(C3:AF3,C3:AF3,0))))

confirm with CTRL+SHIFT+ENTER

If any cells in the range may be blank you can use this version

=INDEX(C3:AF3,MODE(IF(C3:AF3<>"Y",IF(C3:AF3<>"",MATCH(C3:AF3,C3:AF3,0)))))
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,254
Members
452,624
Latest member
gregg777

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