Search code examples
google-sheetsgoogle-sheets-formula

Google Sheets Absolute Reference not locking to a cell


I have this formula

=CHOOSEROWS(SORT('Sheet1'!$C$1:H627,RANDARRAY(ROWS('Sheet1'!$C$1:H627)),1),SEQUENCE(2))

Which is working great, however when I insert a new row at the top and cell reference in the formula moves to $C$2 when it should stay at $C$1, how do I fix this?


Solution

  • Use INDIRECT:

    =LET(r,INDIRECT("Sheet1!C1:H"&ROW(Sheet1!H627)),SORTN(r,2,,RANDARRAY(ROWS(r)),1))