I've been hunting around ArcGIS 9.3 and having no success at finding a tool/function that can give me the median (not the mean/avg) tabular value of a spatial database. For example, if I have a data layer of mountain peaks, I would like to be able to determine the elevation of #35 of 70 mountain peaks that exist within a county.

Conceptually it should be pretty easy. Count the total records, sort by elevation ascending, get the value from the elevation field for record # (count/2). Would I need to script this out in Python, or am I missing something obvious that would allow me get this more quickly? I find it hard to believe no one else has had a need for this function and created a solution.

To add some complexity to the matter, what if I wanted the median elev value for peaks in every county within the state in a single table? Basically the same output format as Frequency or Summary Statistics tools when using the Case Field option.

That's a great start, thanks. It doesn't quite have all the functions I am looking for (write to a standalone table, Case Field, etc) but the Python code to generate the median is what I really need, and should be able to code around that to make it fit my needs. I will repost the code and solution once I get it complete.
–
RyanDaltonJan 21 '11 at 17:25