How to prevent formulas from changing if I add or remove lines

Megan F 40 Reputation points
2026-07-21T18:57:12.97+00:00

Hello! I have a spreadsheet where one tab is pulling information from another tab on the same excel. I need to be able to sort, filter, and add/remove lines without the formula data changing on tab 2. I had everything linked, but then when I added additional lines the formulas for everything below the new lines got shifted and messed up. I need to be able to lock everything so I don't have to keep redoing it. It's a massive spreadsheet. I have spreadsheets where it works fine and others where it doesn't. I am not sure what setting to change. How can I do this?

An example of the formula on tab 2 (MASTER FOF) that is pulling from tab 1 (MASTER C&D) is:

='MASTER C&D'!C6

Microsoft 365 and Office | Excel | For business | Windows

3 answers

Sort by: Most helpful
  1. Barry Schwarz 5,941 Reputation points
    2026-07-23T00:40:26.13+00:00

    If the formula references the cell by address, either relative (e.g. B5) or absolute ($B$5) then:

    • When the cell moves as the result of inserting of deleting a row or column, the formula will be automatically adjusted to reference the same data at its new address.
    • When the data in the cell is changed as the result of a sort operation, then the formula is unchanged. The formula will access the new data in the cell. There is no automatic process to adjust the formula to the data's new location.

    Was this answer helpful?

    0 comments No comments

  2. Ashish Mathur 102.2K Reputation points Volunteer Moderator
    2026-07-21T22:49:06.6366667+00:00

    Hi,

    You should fetch data into Tabl2 from Tab1 based on some sort of lookup function.

    Was this answer helpful?

    0 comments No comments

  3. Hendrix-C 19,970 Reputation points Microsoft External Staff Moderator
    2026-07-21T19:26:30.2933333+00:00

    Hi Megan,

    For the best possible assistance, may I confirm whether your expected outcome is

    • To have the formula on tab 2 always pull from a specific physical cell, like "always return whatever is in cell C6, even if rows are inserted" or
    • You want to have a relative cell reference, like the formula linked with a specific data so if it's sorted, filtered or in a different cell than C6 the formula still correctly references that data.

    Please understand that my initial response may not always resolve the issue immediately. However, with your help and more detailed information, we can work together to find a solution. 

    Thank you for your understanding and cooperation. I look forward to hearing from you.


    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.