I am trying some data analysis on an Excel worksheet using Maple. I have the following procedure but I don't know how to make it work for a specific subset of cells (this is a psychological studiy, so I want to have all my scores for each subject, located on the rows, and variable, located on a subset of columns). Example: I want to get an array of all the average scores in a rectangle of cells which goes *horizontally*from A to AB, and *vertically* from row 1 to 15. Hope you can help me out! Cheers!

MediaRighe := proc (M) local i, j, r, c, S, N; r := LinearAlgebra:-RowDimension(M); c := LinearAlgebra:-ColumnDimension(M); S := Array(1 .. r); for i to r do S[i] := 0; N := 0; for j to c do if M(i, j) <> "-" then S[j] := S[j]+M(i, j); N := N+1 end if end do; S[i] := S[i]/N end do; return S end proc

I also have this for the columns (same thing, basically):

MediaColonne := proc (M) local i, j, r, c, S, N; r := LinearAlgebra:-RowDimension(M); c := LinearAlgebra:-ColumnDimension(M); S := Array(1 .. c); for j to c do S[j] := 0; N := 0; for i to r do if M(i, j) <> "-" then S[j] := S[j]+M(i, j); N := N+1 end if end do; S[j] := S[j]/N end do; return S end proc

Thanks everybody!