Calculating median in grouped data using ArcMap

6258
53
Jump to solution
01-31-2020 10:46 AM
RafaelMichael
Occasional Contributor

I got stuck when calculating the median age in grouped data (age ranges) for each feature (each feature is a single administrative unit). I have about 18,000 features.

Field names indicate age ranges: 0-14, 15-64, 65-100. In the "median" field I would like to calculate the median age for each feature. I found a website https://atozmath.com/StatsG.aspx?q=1 where you can calculate such a median for a single feature, for example the first feature from the attribute table above.

The page easily calculated the median for the first feature in the image, and the page also wrote how it calculated it, but I don't know how to write a universal script for a "median" field to calculate the median for each feature.

0 Kudos
53 Replies
DavidPike
MVP Frequent Contributor

I've edited it again to attempt to go into the attribute tasble

RafaelMichael
Occasional Contributor

everything works, you are the king, thank you very much

0 Kudos
DavidPike
MVP Frequent Contributor

Glad to hear. Can you send me a screenshot of the table? 

RafaelMichael
Occasional Contributor