Further to what @Lupp has told you, you have confused us with your use of terminology. In Calc a “row” is a horizontal sequence of cells, each of which might contain text or a single number. Three numbers, all in the same cell, are not a row, and are difficult to define as numbers. You are very fortunate that @Lupp has given you a solution to what you want to do and in the way you want to do it.
It would be trivial, and much more “regular”, to accomplish the same thing if you placed each number in its own cell. Then your first average (what you called A) would be =AVERAGE(A1,A2,A3) and the second (B) would be =AVERAGE(A4,A5,A6) or just =AVERAGE(A4:A6). Having each number in its own cell always works and requires no special coding.