I track my expenses using Google Sheets and use an XLOOKUP to get the available balance of a budget line e.g. groceries by searching for the previous mention of that budget line and getting the subtotal.
But if I forget to add an expense and want to insert a row it was breaking my cell references because the XLOOKUP can't include the current row (circular reference error).
I found I could use INDIRECT in the XLOOKUP *and* mix absolute R1C1 references with relative R[-1]C3 references *and* use ranges in INDIRECT which I didn't know was possible:
e.g.
=XLOOKUP(INDIRECT("R[0]C[-1]",FALSE),INDIRECT("R2C3:R[-1]C3",FALSE),INDIRECT("R2C6:R[-1]C6",FALSE),,0,-1)
If for some reason you needed to calculate a relative reference you can also calculate the R1C1 or even R[0]C[0] style reference because it's a string
e.g.
=INDIRECT("R[0]C"&IF(EQ(MOD(ROW(),2),1),2,3),FALSE)
#GoogleSheets #Spreadsheets