# 4th most common text value

#### sparkd

##### New Member
I currently have the following formula to capture the 3rd most common text value from a range.
I cant seem to change this in order to capture the 4th most common text value

=INDEX(S19:S52,MODE(IF(((S19:S52<>"")*(S19:S52<>INDEX(S19:S52,MODE(IF(S19:S52<>"",MATCH(S19:S52,S19,S52,0)))))*(S19:S52<>INDEX(S19:S52,MODE(IF((S19:S52<>"")*(S19:S52<>INDEX(S19:S52,MODE(IF(S19:S52<>"",MATCH(S19:S52,S19:S52,0))))),MATCH(S19:S52,S19:S52,0)))))),MATCH(S19:S52,S19:S52,0))))

#### Eric W

##### MrExcel MVP
First, you have a typo in your formula. In the first MATCH, you have S19,S52 when it should be S19:S52. Next, changing it to capture the 4th most common would be somewhat painful. Using the same logic, you'd have to add another set of INDEX/MODE/MATCH/MATCH functions. I'd suggest something like the formula in T19 where you just drag it down to get the most common values in order.

<b>Note: Do not try and enter the {} manually yourself</b></td></tr></table><br />

Let us know if this works for you.

#### Eric W

##### MrExcel MVP
After a little thought, I came up with this array formula that will return the nth most common value without needing the previous values:

=IFERROR(INDEX(\$S:\$S,MOD(LARGE(IF(\$S\$19:\$S\$52<>"",IF(MATCH(\$S\$19:\$S\$52,\$S\$19:\$S\$52,0)=ROW(\$S\$19:\$S\$52)-ROW(\$S\$19)+1,COUNTIF(\$S\$19:\$S\$52,\$S\$19:\$S\$52)+ROW(\$S\$19:\$S\$52)/1000)),4),1)*1000),"")

Confirm with Control+Shift+Enter. Change the red 4 to the value you want. In case of ties, this lists the bottommost first, whereas my previous formula lists the topmost first.

1,082,318
Messages
5,364,518
Members
400,804
Latest member
davileal

### This Week's Hot Topics

• populate from drop list with multiple tables
Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
• Find list of words from sheet2 in sheet1 before a comma and extract text vba
Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
• Dynamic Formula entry - VBA code sought
Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...