View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
vandenberg p
 
Posts: n/a
Default Excel "mode" function returns different results based on sort orde

Hello:

Apparently if the the number of values are equal (bi-modal) then mode
returns the value for the first value in the array. So if the first
is 1 then it will return one, if the first is 2 it will return 2.
In fact if you try it with a tri-modal it will do the same. Try
1,1,1,2,2,2,3,3,3 In this order it will return 1, if invert the
order it will return 3. If you 2,2,2,1,1,1,3,3,3 it will return
2. If you try 4,1,1,1,2,2,2,3,3,3 it will still return 1, first
modal value is 1. It does not appear to matter whether it is
a column array or a row array.

It appears there should at least be warning in the help file
that multi-modal arrays behave this way.

Pieter Vandenberg

Mark Neuffer <Mark wrote:
: I am using "mode" in Excel to return the most common numeric value in a
: questionnaire field. One domain contains two equally-represented values ("1"
: and "2")."Mode" returns a value of "1" if the list is sorted in ascending
: order, and returns "2" if the list is unsorted. I can find no detail from
: our cretinous friends at Microsoft as to why this might be so. Any insights
: would be appreciated.