cell1 = [1,2,3,9 ;4,8,7,4]
This is not a cell, but a double matrix. Do you mean:
data = {[1,2,3,9 ; ...
4,8,7,4]; ...
[13,3,64,6; ...
71,8,59,4]; ...
[31,43,54,9; ...
41,18,17,1]}
"where the bold elements are the identifiers" - there are no bold elements.
Why do you store the data in three different arrays? And are they really cell arrays? If you joint the values to one matrix, the averaging is done by a call to accumarray.
"the thid column an identifier of pprooducts" - why do you calculate the average over the 3rd column then? Is this meaningful?
"the other two collumns sales values for a certain country (col name)" - What is a "col name"?
What happens with the rows containing the 4th element 1 and 6?