I'm trying to calculate the nth mode of an array. Here is the formula:
I can get this formula to work when I create a random list of numbers in A1:A23 (for example) in a blank excel sheet, but when I try to run the above formula for a column in an exported table, I keep getting a #REF error...Help?
The Formula:
=MATCH(MATCH(LARGE(FREQUENCY(Q8:Q338,ROW(INDIRECT(MIN(Q8:Q338)&":"&MAX(Q8:Q338)))),2),FREQUENCY(Q8:Q338,ROW(INDIRECT(MIN(Q8:Q338)&":"&MAX(Q8:Q338)))),0),ROW(INDIRECT(MIN(Q8:Q338)&":"&MAX(Q8:Q338))),0)
The "2" in the middle of the first line denotes the 2nd most frequent number. You may substitute any other number or a cell reference containing the number n for the nth most frequent.
This is an array formula and, after you type or paste it into the cell, hold down <ctrl><shift> while hitting <enter> in order to *array-enter*. XL will place braces {...} around the formula.
Sheet 1 is where the formula works.
Sheet 2 is the relevant part of what I've pulled, and where it isn't working.
Bookmarks