SOLVED

How do you have a formula link, keep the data from a cell that moves from sorting?

%3CLINGO-SUB%20id%3D%22lingo-sub-2338463%22%20slang%3D%22en-US%22%3EHow%20do%20you%20have%20a%20formula%20link%2C%20keep%20the%20data%20from%20a%20cell%20that%20moves%20from%20sorting%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2338463%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20this%20scenario%20I%20have%20data%20from%20A2%2C%20B2%20%26amp%3B%20C2%20link%20to%20F2%2C%20it%20is%20a%20concatenate%20formula%20which%20makes%20F2%20cell%20show%20%22raff%2056%20w%22.%20Column%20D%20%26amp%3B%20E%20are%20empty%20so%20that%20my%20F%20column%20does%20not%20sort%20with%20AB%26amp%3BC%20columns.%20I%20would%20like%20to%20be%20able%20to%20sort%20the%20rows%20for%20AB%26amp%3BC%20but%20wish%20to%20keep%20the%20content%20%22raff%2056%20w%22%20in%20the%20F2%20cell%20regardless%20of%20where%20it%20end%20up%20in%20the%20sort.%20Meaning%20if%20%22raff%2056%20w%22%20in%20now%20moved%20down%20to%20row%20A13%2C%20B13%20%26amp%3B%20C13%2C%20I%20wish%20Cell%20F2%20to%20pull%20the%20information%20from%20there.%20Basically%20following%20where%20ever%20it%20sorts%20and%20maintaining%20the%20link.%20Is%20that%20possible%20and%20if%20so%20may%20someone%20tell%20me%20how%20it%20is%20done%20please%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethanks%20so%20much%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2338463%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-2338717%22%20slang%3D%22en-US%22%3ERe%3A%20How%20do%20you%20have%20a%20formula%20link%2C%20keep%20the%20data%20from%20a%20cell%20that%20moves%20from%20sorting%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2338717%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1048917%22%20target%3D%22_blank%22%3E%40Asparagus%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThat%20is%20just%20the%20way%20Excel%20works%20-%20sorting%20a%20range%20does%20not%20update%20references%20to%20cells%20in%20the%20range%20from%20cells%20outside%20that%20range.%20A%20workaround%20would%20be%20to%20add%20a%20column%20with%20unique%20identifiers%2C%20and%20to%20use%20INDEX%2FMATCH%2C%20XLOOKUP%20or%20VLOOKUP%20to%20retrieve%20values%20associated%20with%20a%20specific%20identifier.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22S0388.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F279343i6DCDC2868B1044A2%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22S0388.png%22%20alt%3D%22S0388.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EThe%20formula%20in%20G2%20is%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3DINDEX(%24B%242%3A%24B%245%2CMATCH(F2%2C%24A%242%3A%24A%245%2C0))%26amp%3B%22%20%22%26amp%3BINDEX(%24C%242%3A%24C%245%2CMATCH(F2%2C%24A%242%3A%24A%245%2C0))%26amp%3B%22%20%22%26amp%3BINDEX(%24D%242%3A%24D%245%2CMATCH(F2%2C%24A%242%3A%24A%245%2C0))%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBecause%20we%20look%20up%20the%20unique%20index%201%2C%20the%20result%20will%20remain%20the%20same%20when%20the%20range%20in%20columns%20A%20to%20D%20is%20sorted.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2338783%22%20slang%3D%22en-US%22%3ERe%3A%20How%20do%20you%20have%20a%20formula%20link%2C%20keep%20the%20data%20from%20a%20cell%20that%20moves%20from%20sorting%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2338783%22%20slang%3D%22en-US%22%3EThat%20is%20so%20clever%2C%20thank%20you%20so%20much%2C%20this%20is%20more%20than%20perfect!%3C%2FLINGO-BODY%3E
New Contributor

In this scenario I have data from A2, B2 & C2 link to F2, it is a concatenate formula which makes F2 cell show "raff 56 w". Column D & E are empty so that my F column does not sort with AB&C columns. I would like to be able to sort the rows for AB&C but wish to keep the content "raff 56 w" in the F2 cell regardless of where it end up in the sort. Meaning if "raff 56 w" in now moved down to row A13, B13 & C13, I wish Cell F2 to pull the information from there. Basically following where ever it sorts and maintaining the link. Is that possible and if so may someone tell me how it is done please?

 

thanks so much 

3 Replies
best response confirmed by Asparagus (New Contributor)
Solution

@Asparagus 

That is just the way Excel works - sorting a range does not update references to cells in the range from cells outside that range. A workaround would be to add a column with unique identifiers, and to use INDEX/MATCH, XLOOKUP or VLOOKUP to retrieve values associated with a specific identifier.

 

S0388.png

The formula in G2 is

 

=INDEX($B$2:$B$5,MATCH(F2,$A$2:$A$5,0))&" "&INDEX($C$2:$C$5,MATCH(F2,$A$2:$A$5,0))&" "&INDEX($D$2:$D$5,MATCH(F2,$A$2:$A$5,0))

 

Because we look up the unique index 1, the result will remain the same when the range in columns A to D is sorted.

That is so clever, thank you so much, this is more than perfect!

@Asparagus 

As variant

=TEXTJOIN(" ",1,INDEX(B2:D5,MATCH(F2,A2:A5,0),0))