Hi Dennis, That works brilliantly! Thanks a lot! All the best, A -- View this message in context: http://r.789695.n4.nabble.com/averaging-rows-based-on-string-tp3687689p3690145.html Sent from the R help mailing list archive at Nabble.com.