AVGMODE: Mode average of a series of numbers

syntax: AVGMODE(n, x1, x2, x3, ...) or
AVGMODE(<filename>)

Returns the mode (frequency) average of a series of numbers. Input consists of a series of numbers with the first argument specifying the number of elements in the series or a single argument specifying the name of the plain text file containing the series of numbers with each element in the file seperated by spaces or starting at a new line. Note: no attempt is made to return more than one element even though more than one element in the series can have the same highest occurence frequency.