Dear useRs, I have the data of following format. I have only pasted some part of the data. The data starts from 1961 and ends up in december 1987. dat <- read.table(text="Date A B C D1-Jan-61 0.00 1.27 8.128 0.252-Jan-61 6.10 9.144 94.742 15.493-Jan-61 0.00 0.508 1.27 0.004-Jan-61 0.00 0 NA 0.005-Jan-61 0.00 0 0 0.006-Jan-61 0.00 NA 0 0.007-Jan-61 0.00 0 0 0.008-Jan-61 0.00 NA 0 0.009-Jan-61 0.00 NA 0 NA10-Jan-61 0.00 4.064 4.826 0.76",sep="",header=TRUE,stringsAsFactors=FALSE) I need to calculate the sum of each months of A,B,C and D. There are NA's in each column so whenever there is NA it should be ignored. In the end we should have a table with 12 values for each year or all the for columns having dimension (12*number of years rows and 4 columns). Thankyou very much in advance Eliza [[alternative HTML version deleted]]