The K-Medoids macro allows for the creation of a clustering solution using the pam (partitionaing around medoids) function of R's cluster package. The macro allows for the use of either a dissimilarity/distance matrix or a set of raw records containing numeric fields from which to construct a distance matrix. The macro can either find a single solution, or the "best" solution among a range of possible solutions in terms of the number of clusters to use. The metric used to determine which of a range of possible solutions is best is the average silhouette width for solutions with different numbers of clusters.