For the row index take the ceiling of N/columnCount.
For the column index take the modulus of N/columnCount. If the modulus is 0 set the index to column count.

To use your example of 11, at position 6:
rowIndex = Ceiling(6/3) = Ceiling(2) = 2.
columnIndex = 6%3 = 0. Since it’s 0 we set it equal to columnCount = 3.

Keep in mind that arrays are zero-based and this does not take that into account.
In reality, item “11” is at (1,2) not at (2,3). To account for this just subtract one from the results here.