Mean Points

I have a large number of 3D points some of which are of duplicated locations but different names. I would like to mean any points that are within a set distance of each other. There may be a number of points or just one point at a location it varies. All I want to end up with is an array of the mean points along with any single points that happened to be in the selection.
Does anyone have something that could help, if so it would be greatly appreciated.