Due On 2021-05-26
In spreadsheet, Can I get the row number and column number of the current cell?
Nicholasfox shared this question 1 year ago
I'm tring to get a matrix like the picture attached.
With Excel, I can easily finish this task by: =IF(ROW()<=COLUMN(),POWER(COLUMN()-1,2)+ROW(),POWER(ROW()-1,2)+2*ROW()-COLUMN())
In GGB, I faced two difficult.
1. row() and column() need a parameter, I can't get the row and column number of the current cell.
2. absolute reference is not surpported in row command. row(A1) works, but row($A1) does not.
- Feedback & Questions
- +43 677 6137 2693
Input this into cell B2, It worked.=If(Row(A1) ≤ Column(A1) , (Column(A1) - 1)² + Row(A1), (Row(A1) - 1)² + 2Row(A1) - Column(A1))
Regarding the effort for creating and maintaining the table, I consider a solution using Sequence() and a small script to be better.
Comments have been locked on this page!