automate reference to a row number

Hello, I have this formula that refers to the specific range of row numbers:

where 1348 and 1377 are the row numbers. I have to change it because I use this formula for different months and different individuals and I have about 12 000 rows in a single sheet.

Is there a way to automatically refer to a row number? (right now, I manually change those numbers when i copy and paste this formula to a different row range.

Thank you,

=IF(AND([Days Away]@row = 1, Adjacent@row = 1), (MAX(COLLECT([Date Only]$1348:[Date Only]$1377, [Date Only]$1348:[Date Only]$1377, <[Date Only]@row, Adjacent$1348:Adjacent$1377, 0)) + 1) + "-" + IF(MAX(COLLECT([Date Only]$1348:[Date Only]$1377, [Date Only]$1348:[Date Only]$1377, >[Date Only]@row, Adjacent$1348:Adjacent$1377, 0)) = 0, (MAX(COLLECT([Date Only]$1348:[Date Only]$1377, [Date Only]$1348:[Date Only]$1377, >=[Date Only]@row, Adjacent$1348:Adjacent$1377, 1))), MIN(COLLECT([Date Only]$1348:[Date Only]$1377, [Date Only]$1348:[Date Only]$1377, >[Date Only]@row, Adjacent$1348:Adjacent$1377, 0)) - 1), IF([Days Away]@row = 1, [Date Only]@row)) + ""

Answers

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!