Share via

Is there a formula I can use in Excel Sheet B, to get the value of a cell in Sheet A, even when I add a row to Sheet A (that is, the cell in Sheet A changes row)?

EMILIO VIERA 0 Reputation points
2026-02-14T00:47:34.1566667+00:00

I have two Excel sheets.

 

The first increases in a row each working day and it holds prices for shares that change from day to day.

 

The second makes calculation based on those prices.

 

I have tried putting in one of the second sheet price, the formula “= <the cell in the first sheet that holds the corresponding price>”, but it does not do the job, because when I add a row in the first sheet, it does not change the row to take the price from.

 

So, I have been doing it manually each time I need to do the calculations.

 

Is there any formula that can allow me to get the right price even when I add new rows in the first sheet?

Microsoft 365 and Office | Excel | For home | Windows
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. EmilyS726 210.5K Reputation points Independent Advisor
    2026-02-14T03:05:07.81+00:00

    Hello

    Not sure what kind of caculation you do, but did you try pivot table instead? That might work beautifully too.

    Otherwise, convert Sheet A to an Excel Table and use structured references..

    To do so , click anywhere in Sheet A data. Go to Insert > Table (check “My table has headers”). Give the table a name like, such as "MyTable".

    Then formulas won’t break when you insert rows, and references expand automatically.

    For examples, if you want the price where Date = B2 and Ticker = A2, you can use formula and references like this:

    =XLOOKUP(A2&B2, MyTable[Ticker]&MyTable[Date], MyTable[Price])

    0 comments No comments

  2. Q&A Assist
    2026-02-14T00:47:48.3866667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To achieve the functionality you want in Excel, you can use the INDEX and MATCH functions together. This combination allows you to dynamically reference a cell in Sheet A, even if rows are added or removed. Here’s how you can set it up:

    1. Assuming:
      • Your prices are in column B of Sheet A.
      • You want to reference a price based on a corresponding identifier (like a stock name) in column A of Sheet A.
      • You have the identifier in Sheet B that you want to match with Sheet A.
    2. Formula: In Sheet B, you can use the following formula:
         =INDEX('Sheet A'!B:B, MATCH(A1, 'Sheet A'!A:A, 0))
      
      • Replace A1 with the cell in Sheet B that contains the identifier you want to match.
      • This formula will find the row number of the identifier in column A of Sheet A and return the corresponding price from column B.

    This way, even if you add or remove rows in Sheet A, the formula will still correctly reference the price associated with the identifier you are looking for in Sheet B.


    References:

    0 comments No comments

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.