I have to admit I don't fully understand what you asking for, but I am going to try to give a few pointers which might help you.

In Mathematica lists are entered with curly braces and elements separated by commas, like so:

{1,2,3,4}

If you want to make a list programmatically, you can use the Table command, like so:

Table[x^2, {x,0,10}]

This will make a list of eleven elements, like so:

{0,1,4,9,16,25,36,49,64,81,100}

If you now want a list of lists you can give another argument to Table, like so:

Table[ i*j, {i,3},{j,3}]

This will make a 3x3 matrix/array like this:

{{1, 2, 3}, {2, 4, 6}, {3, 6, 9}}

If you want to see the value of just one element you can use Part:

t =Table[i*j, {i,3},{j,3}];

Part[t,2,2] (* gives element at position row=2,column=2, which is 4 *)

A shorthand notation for Part is the double square bracket notation (not single square brackets):

t[[2,2]] === Part[t,2,2]

With all this in hand you can now use functions on rows and columns, for example:

Count[ t[[1]], 2 ] (* count the number of 2s in the first row *)

Count[ t[[2]], 4 ] (* count the number of 4s in the second row *)

Count[ t[[-1]], 6 ] (* count the number 6s in the last row (-2 is the second to last row, and so on) *)

Count[ t[[All,1]], 2 ] (* count the number of 2s in the first column (All means all rows, and 1 means first column) *)

Count[ t[[All,-2]], 6 ] (* count the number of 6s in the next to last column *)

Now if you want to count the occurences for multiple values, like from 0 to 50, and for each row you can do:

Table[

Count[ t[[ row ]], value ],

{row,3},

{value,0,50}

] // Grid

And I am using Grid here to format the result in a nicer grid like format.

(The // notation is a post-fix function application, so f and x // f are equivalent)

http://reference.wolfram.com/mathematica/ref/List.htmlhttp://reference.wolfram.com/mathematica/ref/Table.htmlhttp://reference.wolfram.com/mathematica/ref/Part.htmlhttp://reference.wolfram.com/mathematica/ref/Count.html

http://reference.wolfram.com/mathematica/ref/Grid.htmlhttp://reference.wolfram.com/mathematica/ref/Postfix.html