I have a table that can be sorted with formulas that reference rows above/below a formula. As I sort the table, using absolute references or not, I cannot get the formulas to stay with the correct row as it is sorted. I also have formulas in the row that refer to other columns of that row so the answer is not as easy as switching my rows and columns.
Example showing the formulas I'm using:
Currently B3 will result "40". If I want to sort the table by the sample (column A) alphabetically, the formula currently in B3 will move to B4. Whether I use absolute ref's or not ($:$), my formula continues to display the same "=B2-B4" and this will now give me a circular reference because the formula is in B4.
Desired Result: After sorting, make the formula now located in B4 still refer to the correct sample/row as it moves. It should now say =B2-B3 to still give me "40".
(Columns C&D only shows my need of formulas inside of a row also)
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Sample[/TD]
[TD]Gal/Min[/TD]
[TD]Lb/Gal[/TD]
[TD]Lb/Min[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Tank A[/TD]
[TD]50[/TD]
[TD]10[/TD]
[TD]=B2*C2[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Tank ZZZZZZ[/TD]
[TD]=B2-B4[/TD]
[TD]10[/TD]
[TD]=B3*C3[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Tank B[/TD]
[TD]10[/TD]
[TD]10[/TD]
[TD]=B4*C4[/TD]
[/TR]
</tbody>[/TABLE]
Example showing the formulas I'm using:
Currently B3 will result "40". If I want to sort the table by the sample (column A) alphabetically, the formula currently in B3 will move to B4. Whether I use absolute ref's or not ($:$), my formula continues to display the same "=B2-B4" and this will now give me a circular reference because the formula is in B4.
Desired Result: After sorting, make the formula now located in B4 still refer to the correct sample/row as it moves. It should now say =B2-B3 to still give me "40".
(Columns C&D only shows my need of formulas inside of a row also)
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Sample[/TD]
[TD]Gal/Min[/TD]
[TD]Lb/Gal[/TD]
[TD]Lb/Min[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Tank A[/TD]
[TD]50[/TD]
[TD]10[/TD]
[TD]=B2*C2[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Tank ZZZZZZ[/TD]
[TD]=B2-B4[/TD]
[TD]10[/TD]
[TD]=B3*C3[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Tank B[/TD]
[TD]10[/TD]
[TD]10[/TD]
[TD]=B4*C4[/TD]
[/TR]
</tbody>[/TABLE]