R, Excel, Function, Pivot Tables.
clarity. This job is not easy in Excel as VBA is required. But in R, it is done in two lines with the help of pipe operations (%>%). require(ggplot2) require(dplyr) diamonds %>% group_by(cut,color) %>% summarize(mean.value=mean(price)) %>% spread(cut,mean.value) The mean function can be replaced