🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac.apps
Article #1619

Excel bug? in MEDIAN function

#1619
From: Michael C. Tanner
Date: Mon, 13 Apr 1992 10:31
54 lines
2215 bytes
I have been keeping my grade book in an Excel spreadsheet, and noticed while
entering scores last night that something funny happened.  At one point, in
the position where I'm keeping a median of the column I was entering, it
changed from a number to #NUM!, then changed to a number when I entered the
next score.  So I started playing around to see what was going on.

Here's the scores at the point the error occurred (sorted):

100
96
92
92
92
92
92
88
88
84
84
84
76
72
0
0

The median is 88, but I've tried this on three different machines (a IIsi with
system 6.0.7, a IIfx with 6.0.7, and a IIci with system 7), and all produced
the #NUM! error at this point.  The next score I entered (76) caused the
median of 88 to appear.

I tried several things.  I tried re-entering the values in a new spreadsheet.
Same problem.  If the scores above are in cells A1:A16, then MEDIAN(A1:A16)
produces and error. But MEDIAN(A1:A16,MIN(A1:A16),MAX(A1:A16)) works, but
mathematically they should be the same (this looks like a potential
workaround, to me).

I tried the scores in different orders.  Same problem

I tried the same set of scores divided by 4, and it worked correctly for a
median of 22.

For the next value to enter, I tried everything from 0 to 100, and found that
all work ok except 77, which produces the #NUM! error.

I tried changing one of the 0s to all values between 0 and 100 and found that
all work ok except 96, which produces the same error.

Hypothesis: for any sequence of values for which MEDIAN produces a correct
result, there exists a next value that will cause MEDIAN to generate an error.

Can anybody else reproduce this problem?  Is it a known bug?  Does anybody
know enough about how MEDIAN works to check my hypothesis?  

-- mike
Technical Details
Message-ID: <MTANNER.92Apr13103106@gmuvax2.gmu.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!haven.umd.edu!news.umbc.edu!gmuvax2!gmuvax2.gmu.edu!mtanner

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.mac.apps
Path: arc1-ca.pugleaf.net!sparky!uunet!haven.umd.edu!news.umbc.edu!gmuvax2!gmuvax2.gmu.edu!mtanner
From: mtanner@gmuvax2.gmu.edu (Michael C. Tanner)
Subject: Excel bug? in MEDIAN function
Message-ID: <MTANNER.92Apr13103106@gmuvax2.gmu.edu>
Sender: mtanner@gmuvax2.gmu.edu (Michael C. Tanner)
Organization: George Mason University, Fairfax Va.
Date: 13 Apr 92 10:31:06
Lines: 54