Declared and impelemented summation of column or row function