Other times the customer might be better off with a different database that includes MEDIAN in its SQL so you don't have to roll your own. JR, many database developers will tell you that at one point or another, they had to roll their own function at least once. To suggest moving to a different database is beyond cost-ineffective.
Excel has a MEDIAN function - should we do all of this in Excel? :)