Hi,

I have matrix (range) with i number of rows and j number of columns. The number of columns is equal with the number of rows.


0 12 13 14
21 0 23 24
31 32 0 34
41 42 43 0

The formula I need to enter in the non-empty cells in the range is :

cell(2,1)= min(21,0)+min(0,12)+min(23,13)+min(24,14)
cell(4,3)= min(41,31)+min(42,32)+min(43,0)+min(0,34)

so it's a min value between row that the cell is on and the row equal to the number of the column the cell is on.

So any thoughts ?