I am looking for a formula:
- If I put it in a cell, for example C2, it will return the value in A2
- I can't simply put
=A2
because column A could be moved to another column
I am trying to use named range to do this. I have created a named range(teacher_Names
) for A1:A. It is not hard to get the value using app script
function getTeacherNameOnTheSameRow(row) {
let ss = SpreadsheetApp.getActive();
let values = ss.getRangeByName('teacher_Names').getValues();
return values[row-1];
}
I can just put =getTeacherNameOnTheSameRow(Row())
in cells in Column C, and no matter which column I move column A to, it will work.
My question is, is there a way to do this without app script?