SOLVED
Home

How to keep a linked cell linked to a cell that changed location?

%3CLINGO-SUB%20id%3D%22lingo-sub-698443%22%20slang%3D%22en-US%22%3EHow%20to%20keep%20a%20linked%20cell%20linked%20to%20a%20cell%20that%20changed%20location%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-698443%22%20slang%3D%22en-US%22%3E%3CP%3EI%20linked%20cell%20C37%20in%20Document%20PL%20to%20cell%20D60%20in%20Document%20PR%20which%20has%20a%20value%20of%204.50.%20But%20I%20deleted%20a%20row%20in%20Document%20PR%20so%20now%20the%20previous%20cell%20D60%20is%20now%20cell%20D59%20and%20the%20new%20cell%20D60%20has%20a%20value%20of%2014.35.%20Cell%20C37%20in%20Document%20PL%20updated%20its%20info%20to%20reflect%20the%20new%20cell%20D60.%20But%20I%20want%20cell%20C37%20to%20automatically%20update%20a%20change%20in%20cell%20location%20to%20keep%20pointing%20to%20the%20cell%20that%20contains%20the%20value%20of%204.50.%20Is%20there%20a%20way%20to%20do%20that%3F%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-698443%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-698538%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20keep%20a%20linked%20cell%20linked%20to%20a%20cell%20that%20changed%20location%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-698538%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F361771%22%20target%3D%22_blank%22%3E%40MsUser78%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20could%20use%20defined%20names%20for%20all%20referencing.%26nbsp%3B%20The%20catch%20is%20that%20the%20source%20workbook%20would%20need%20to%20be%20opened%20before%20the%20named%20reference%20can%20be%20read.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPower%20Query%20will%20read%20from%20Tables%20and%20named%20ranges%20without%20opening%20the%20source%20workbook%20to%20the%20user%20interface.%26nbsp%3B%20I%20presume%20the%20application%20must%20still%20open%20the%20workbook.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-698594%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20keep%20a%20linked%20cell%20linked%20to%20a%20cell%20that%20changed%20location%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-698594%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F214174%22%20target%3D%22_blank%22%3E%40Peter%20Bartholomew%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECan%20you%20tell%20me%20how%20to%20do%20it%20in%20an%20example%3F%20I'm%20not%20familiar%20with%20terminology%20and%20I%20could%20get%20something%20wrong.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-700733%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20keep%20a%20linked%20cell%20linked%20to%20a%20cell%20that%20changed%20location%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-700733%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F361771%22%20target%3D%22_blank%22%3E%40MsUser78%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EProbably%20not%20much%20use%20providing%20files%20because%20they%20will%20reference%20my%20user%20and%20folder%20details%2C%20not%20yours.%3C%2FP%3E%3CP%3EPut%20a%20few%20numbers%20in%20a%20row%20or%20column%20and%20give%20them%20a%20name%20by%20typing%20into%20the%20Name%20box%20(to%20the%20left%20of%20the%20function%20box)%20or%20using%20Define%20Name%20on%20the%20Ribbon%20Formulas%20tab.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOpen%20a%20new%20workbook%20and%20type%20a%20formula%20that%20references%20the%20range%20in%20the%20first%20book%20e.g.%3C%2FP%3E%3CP%3E%3D%20SUM(Book1!Numbers)%3C%2FP%3E%3CP%3Ewhere%20'Numbers'%20happens%20to%20be%20the%20name%20defined%20in%20the%20first%20book%20and%20selected%20using%20the%20mouse%20cursor.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-714599%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20keep%20a%20linked%20cell%20linked%20to%20a%20cell%20that%20changed%20location%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-714599%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F214174%22%20target%3D%22_blank%22%3E%40Peter%20Bartholomew%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you!%3C%2FP%3E%3CP%3EBtw%2C%20I%20don't%20know%20if%20MS%20devs%20saw%20my%20post%20because%20now%20the%20linked%20cell%20is%20automatically%20updated%20with%20the%20new%20location%20of%20the%20original%20cell%20if%20it%20changes.%20%3A%20D%3C%2FP%3E%3CP%3E(For%20other%20reader's%20reference%20here%20is%20a%20link%20about%20name%20boxes%20and%20how%20to%20use%20them%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fwww.computerhope.com%2Fissues%2Fch000704.htm%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.computerhope.com%2Fissues%2Fch000704.htm%3C%2FA%3E%26nbsp%3B%2C%20if%20link%20is%20broken%20just%20type%20%22name%20box%20excel%22%20and%20choose%20your%20pick.%20Be%20aware%20that%20name%20cannot%20contain%20spaces%2C%20at%20the%20time%20of%20this%20writing.)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-715212%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20keep%20a%20linked%20cell%20linked%20to%20a%20cell%20that%20changed%20location%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-715212%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F361771%22%20target%3D%22_blank%22%3E%40MsUser78%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EInteresting%2C%20I%20will%20have%20to%20try%20it.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMind%20you%2C%20it%20will%20make%20little%20difference%20to%20me%20because%20I%20do%20not%20use%20direct%20referencing.%26nbsp%3B%20I%20have%20on%20occasion%20described%20the%20practice%20of%20referencing%20data%20by%20its%20location%20relative%20to%20a%20worksheet%20as%20an%20abomination%20that%20should%20never%20have%20entered%20the%20world%20of%20professional%20model%20building%20(financial%20or%20engineering).%26nbsp%3B%20It%20is%20fit%20only%20for%20%3CEM%3Ead-hoc%3C%2FEM%3E%2C%20disposable%20calcs.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20may%20not%20be%20surprised%20that%20few%20agreed%20with%20me!%26nbsp%3B%20That%20does%20not%20necessarily%20make%20me%20wrong%20though.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-734970%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20keep%20a%20linked%20cell%20linked%20to%20a%20cell%20that%20changed%20location%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-734970%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F214174%22%20target%3D%22_blank%22%3E%40Peter%20Bartholomew%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20think%20my%20earlier%20assertion%20that%20the%20cell%20location%20updates%20was%20not%20true%20after%20all.%20Today%20I%20was%20working%20in%20a%20document%20that%20had%20links%20in%20some%20cells%20and%20it%20got%20all%20messed%20up%20when%20I%20updated%20it%20because%20the%20cells%20the%20links%20pointed%20at%20had%20moved.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
MsUser78
New Contributor

I linked cell C37 in Document PL to cell D60 in Document PR which has a value of 4.50. But I deleted a row in Document PR so now the previous cell D60 is now cell D59 and the new cell D60 has a value of 14.35. Cell C37 in Document PL updated its info to reflect the new cell D60. But I want cell C37 to automatically update a change in cell location to keep pointing to the cell that contains the value of 4.50. Is there a way to do that? 

6 Replies

@MsUser78 

You could use defined names for all referencing.  The catch is that the source workbook would need to be opened before the named reference can be read.

 

Power Query will read from Tables and named ranges without opening the source workbook to the user interface.  I presume the application must still open the workbook.

@Peter Bartholomew 

Can you tell me how to do it in an example? I'm not familiar with terminology and I could get something wrong.

Solution

@MsUser78 

Probably not much use providing files because they will reference my user and folder details, not yours.

Put a few numbers in a row or column and give them a name by typing into the Name box (to the left of the function box) or using Define Name on the Ribbon Formulas tab.

 

Open a new workbook and type a formula that references the range in the first book e.g.

= SUM(Book1!Numbers)

where 'Numbers' happens to be the name defined in the first book and selected using the mouse cursor.

@Peter Bartholomew 

Thank you!

Btw, I don't know if MS devs saw my post because now the linked cell is automatically updated with the new location of the original cell if it changes. : D

(For other reader's reference here is a link about name boxes and how to use them: https://www.computerhope.com/issues/ch000704.htm , if link is broken just type "name box excel" and choose your pick. Be aware that name cannot contain spaces, at the time of this writing.)

@MsUser78 

Interesting, I will have to try it.

 

Mind you, it will make little difference to me because I do not use direct referencing.  I have on occasion described the practice of referencing data by its location relative to a worksheet as an abomination that should never have entered the world of professional model building (financial or engineering).  It is fit only for ad-hoc, disposable calcs.

 

You may not be surprised that few agreed with me!  That does not necessarily make me wrong though.

@Peter Bartholomew 

I think my earlier assertion that the cell location updates was not true after all. Today I was working in a document that had links in some cells and it got all messed up when I updated it because the cells the links pointed at had moved. 

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
46 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
30 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
13 Replies