Home

Change the absolute reference into new one whenever copy to new location

%3CLINGO-SUB%20id%3D%22lingo-sub-482113%22%20slang%3D%22en-US%22%3EChange%20the%20absolute%20reference%20into%20new%20one%20whenever%20copy%20to%20new%20location%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-482113%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3EIs%20there%20any%20way%20to%20change%20the%20absolute%20reference%20value%20into%20a%20new%20one%20automatically%20whenever%20copy%20into%20a%20new%20location.%3C%2FP%3E%3CP%3Ee.g.%20There%20is%20a%20series%20of%20number%20from%20A1%3AA5%20and%20I%20want%20to%20find%20out%20highest%20value%20on%20adjacent%20to%20the%20cell%20like%20%3DIF(((MAX(%24A%241%3A%24A%245)%3DA1)%2CA1%2C0)%20and%20drag%20down%20so%20this%20will%20either%20give%20me%20only%20highest%20value%20and%200%20in%20B1%20to%20B5.%3C%2FP%3E%3CP%3ENow%20my%20question%20is%20if%20I%20want%20to%20use%20the%20same%20type%20of%20formula%20in%20another%20location%20then%20I%20have%20to%20keep%20changing%20the%20particular%20value%20of%20MAX%20from%20the%20equation.%3C%2FP%3E%3CP%3EIs%20there%20any%20way%20to%20change%20that%20absolute%20reference%20value%20with%20new%20absolute%20value.%3C%2FP%3E%3CP%3EThank%20you%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-482113%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-482652%22%20slang%3D%22en-US%22%3ERe%3A%20Change%20the%20absolute%20reference%20into%20new%20one%20whenever%20copy%20to%20new%20location%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-482652%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F280482%22%20target%3D%22_blank%22%3E%40Twifoo%3C%2FA%3E%26nbsp%3B%2C%20thank%20you%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-482623%22%20slang%3D%22en-US%22%3ERe%3A%20Change%20the%20absolute%20reference%20into%20new%20one%20whenever%20copy%20to%20new%20location%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-482623%22%20slang%3D%22en-US%22%3ENice%20explanation!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-482619%22%20slang%3D%22en-US%22%3ERe%3A%20Change%20the%20absolute%20reference%20into%20new%20one%20whenever%20copy%20to%20new%20location%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-482619%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F326496%22%20target%3D%22_blank%22%3E%40chavanpr12%3C%2FA%3E%26nbsp%3B%2C%20if%20format%20a%20bit%20and%20take%20the%20formula%20for%20the%20first%20cell%20of%20the%20second%20range%3C%2FP%3E%0A%3CPRE%3E%3DIF((MAX(%0A%20%20%20INDEX(A%3AA%2C%0A%20%20%20%20%20%20IFERROR(AGGREGATE(14%2C6%2C1%2F(%24A%241%3AA10%3D%22%22)*ROW(%24A%241%3AA10)%2C1)%2B1%2C1))%3A%0A%20%20%20INDEX(A10%3AA%241048576%2C%0A%20%20%20%20%20%20MATCH(1%2CINDEX(--(A10%3AA%241048576%3D%22%22)%2C0)%2C0)-1))%0A%20%20%20%3DA10)%2CA10%2C0)%0A%3C%2FPRE%3E%0A%3CP%3EAGGREGATE%20returns%20the%20first%20(4th%20parameter%201)%20largest%20(first%20parameter%2014)%20value%20in%20the%20array%20(3rd%20parameter)%20ignoring%20all%20errors%20(second%20parameter%206).%3C%2FP%3E%0A%3CP%3EOur%20array%20here%20is%20multiplication%20of%20criteria%201%2F(%24A%241%3A%24A10%3D%22%22)%20on%20rows%20numbers%20from%20%24A%241%20to%20current%20one.%20Criteria%20returns%20an%20error%20for%20all%20blank%20cells%20(which%20will%20be%20ignored)%20and%201%20(%3D1%2FTRUE)%20for%20all%20non-blank%20cells.%20We%20multiply%20on%20cell's%20row%20numbers%20and%20return%20the%20largest%20one%2C%20in%20our%20case%2010.%20IFERROR%20is%20needed%20for%20the%20beginning%20of%20the%20first%20range%20which%20starts%20from%20A1.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENow%20as%20result%20we%20have%20INDEX(A%3AA%2C10)%2C%20or%2010th%20cell%20in%20the%20column%20A%2C%20or%20A10.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWithin%20MATCH%20the%26nbsp%3BINDEX(--(A10%3AA%241048576%3D%22%22)%2C0)%20returns%20an%20array%20with%20TRUE%20for%20each%20blank%20cell%20in%20the%20range%20starting%20from%20A10%20till%20end%20of%20the%20column%20and%20FALSE%20otherwise%2C%20double%20dash%20converts%20them%20to%201%20and%200.%20MATCH%20find%20position%20of%20the%20first%20number%201%20(1st%20parameter)%20in%20this%20array%2C%20other%20words%20position%20of%20the%20first%20blank%20cell%2C%20in%20our%20case%20that%20will%20be%206.%20Minus%201%20gives%20position%20of%20last%20non-blank%20cell%20(5).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThus%20second%20INDEX%20will%20be%26nbsp%3BINDEX(A10%3AA%241048576%2C5)%20which%20returns%205th%20cell%20in%20above%20range%2C%20or%20A14.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20result%26nbsp%3BINDEX(...)%3AINDEX()%20will%20be%20equivalent%20of%20A10%3AA14%20and%20we%20apply%20MAX%20to%20that%20range.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-482591%22%20slang%3D%22en-US%22%3ERe%3A%20Change%20the%20absolute%20reference%20into%20new%20one%20whenever%20copy%20to%20new%20location%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-482591%22%20slang%3D%22en-US%22%3E%40sergei_Baklan%20All%20this%20is%20difficult%20formula%20and%20hard%20to%20comprehend%20so%20is%20it%20possible%20to%20explain%20each%20term%20and%20their%20effect%20so%20I%20can%20edit%20according%20in%20my%20actual%20file.%3CBR%20%2F%3EThank%20you.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-482584%22%20slang%3D%22en-US%22%3ERe%3A%20Change%20the%20absolute%20reference%20into%20new%20one%20whenever%20copy%20to%20new%20location%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-482584%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EReading%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F280482%22%20target%3D%22_blank%22%3E%40Twifoo%3C%2FA%3E%26nbsp%3B%20post%20I%20corrected%20a%20bit%20the%20formula%20to%20drop%20limitation%3C%2FP%3E%0A%3CP%3E1)%20Actually%20all%20formulas%20are%20regular%20(not%20array%20ones)%2C%20includes%20initial%3C%2FP%3E%0A%3CP%3E2)%20A1%3AA1000%20could%20be%20changed%20on%26nbsp%3BA1%3AA%241048576%2C%20but%20that's%20performance%3C%2FP%3E%0A%3CPRE%3E%3DIF((MAX(INDEX(A%3AA%2CIFERROR(AGGREGATE(14%2C6%2C1%2F(%24A%241%3AA1%3D%22%22)*ROW(%24A%241%3AA1)%2C1)%2B1%2C1))%3AINDEX(A1%3AA%241048576%2CMATCH(1%2CINDEX(--(A1%3AA%241048576%3D%22%22)%2C0)%2C0)-1))%3DA1)%2CA1%2C0)%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-482443%22%20slang%3D%22en-US%22%3ERe%3A%20Change%20the%20absolute%20reference%20into%20new%20one%20whenever%20copy%20to%20new%20location%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-482443%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20the%20attached%20file%2C%20the%20formula%20in%20B1%2C%20copied%20down%20rows%2C%20is%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%3D(MAX(INDEX(A%241%3AA2%2C%3CBR%20%2F%3EIFERROR(AGGREGATE(14%2C6%2C1%2F(A%241%3AA1%3D%22%22)*ROW(A%241%3AA1)%2C1)%2B1%2C1))%3A%3CBR%20%2F%3EINDEX(A1%3A%3CSTRONG%3EA10%3C%2FSTRONG%3E%2C%3CBR%20%2F%3EMATCH(1%2CINDEX(--(A1%3A%3CSTRONG%3EA10%3C%2FSTRONG%3E%3D%22%22)%2C0)%2C0)-1))%3DA1)*A1%3C%2FP%3E%3CP%3ENote%20that%20the%20foregoing%20formula%20follows%20a%20logic%20similar%20to%20that%20of%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3B.%20Nonetheless%2C%20it%20is%20a%20non-array%20formula%20and%20assumes%20that%20the%20maximum%20number%20of%20cells%20to%20be%20evaluated%20at%20any%20given%20instance%20is%20%3CSTRONG%3E9%3C%2FSTRONG%3E.%20If%2C%20for%20example%2C%20such%20maximum%20is%20%3CSTRONG%3E99%3C%2FSTRONG%3E%2C%20%3CSTRONG%3EA10%3C%2FSTRONG%3E%20will%20have%20to%20be%20modified%20to%20%3CSTRONG%3EA100%3C%2FSTRONG%3E%2C%20as%20follows%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%3D(MAX(INDEX(A%241%3AA2%2C%3CBR%20%2F%3EIFERROR(AGGREGATE(14%2C6%2C1%2F(A%241%3AA1%3D%22%22)*ROW(A%241%3AA1)%2C1)%2B1%2C1))%3A%3CBR%20%2F%3EINDEX(A1%3A%3CSTRONG%3EA100%3C%2FSTRONG%3E%2C%3CBR%20%2F%3EMATCH(1%2CINDEX(--(A1%3A%3CSTRONG%3EA100%3C%2FSTRONG%3E%3D%22%22)%2C0)%2C0)-1))%3DA1)*A1%3C%2FP%3E%3CP%3EBy%20the%20way%2C%20Sergei's%20formula%20assumes%20such%20maximum%20to%20be%20%3CSTRONG%3E999%3C%2FSTRONG%3E.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-482292%22%20slang%3D%22en-US%22%3ERe%3A%20Change%20the%20absolute%20reference%20into%20new%20one%20whenever%20copy%20to%20new%20location%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-482292%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F326496%22%20target%3D%22_blank%22%3E%40chavanpr12%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EStraigthforward%20solution%20could%20be%3C%2FP%3E%0A%3CPRE%3E%3DIF((MAX(INDEX(%24A%241%3AA1000%2CIFERROR(AGGREGATE(14%2C6%2C1%2F(%24A%241%3AA1%3D%22%22)*ROW(%24A%241%3AA1)%2C1)%2B1%2C1))%3AINDEX(A1%3AA1000%2CMATCH(1%2CINDEX(--(A1%3AA1000%3D%22%22)%2C0)%2C0)-1))%3DA1)%2CA1%2C0)%3C%2FPRE%3E%0A%3CP%3ECSE%20formula%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-482229%22%20slang%3D%22en-US%22%3ERe%3A%20Change%20the%20absolute%20reference%20into%20new%20one%20whenever%20copy%20to%20new%20location%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-482229%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F280482%22%20target%3D%22_blank%22%3E%40Twifoo%3C%2FA%3E%26nbsp%3BSorry%20this%20is%20the%20first%20time%20in%20community%20so%20I%20didn't%20had%20an%20idea%20about%20the%20procedure%20to%20solve%20the%20method.%20I%20have%20explained%20my%20problem%20in%20excel%20file%20itself.%20Please%20do%20check%20and%20help%20to%20solve%20the%20problem.%3C%2FP%3E%3CP%3EThank%20you%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-482186%22%20slang%3D%22en-US%22%3ERe%3A%20Change%20the%20absolute%20reference%20into%20new%20one%20whenever%20copy%20to%20new%20location%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-482186%22%20slang%3D%22en-US%22%3EThat%E2%80%99s%20just%20a%20sample%20structure%20of%20the%20formula%20I%20suggest%20you%20to%20use.%20For%20specifics%2C%20you%20need%20to%20attach%20your%20sample%20file.%20Remember%2C%20no%20one%20could%20possibly%20imagine%20the%20structure%20of%20your%20actual%20data%2C%20without%20a%20sample%20file.%20You%20need%20not%20think%20twice%20to%20believe%20me!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-482169%22%20slang%3D%22en-US%22%3ERe%3A%20Change%20the%20absolute%20reference%20into%20new%20one%20whenever%20copy%20to%20new%20location%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-482169%22%20slang%3D%22en-US%22%3EYa%20that%20one%20i%20got%20but%20if%20i%20copy%20that%20formula%20then%20the%20row%20is%20going%20to%20be%20fixed%20and%20it%20won't%20change%20the%20to%20other%20cell%20like%20A%2410%3AA%2415%20automatically.%3CBR%20%2F%3EI%20hope%20I%20get%20help%20with%20that%20if%20possible%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-482135%22%20slang%3D%22en-US%22%3ERe%3A%20Change%20the%20absolute%20reference%20into%20new%20one%20whenever%20copy%20to%20new%20location%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-482135%22%20slang%3D%22en-US%22%3EUse%20mixed%20reference%20like%20this%20in%20B1%2C%20copied%20down%20to%20B5%3A%3CBR%20%2F%3E%3D(MAX(A%241%3AA%245)%3DA1)*A1%3C%2FLINGO-BODY%3E
chavanpr12
New Contributor

Hello,

Is there any way to change the absolute reference value into a new one automatically whenever copy into a new location.

e.g. There is a series of number from A1:A5 and I want to find out highest value on adjacent to the cell like =IF(((MAX($A$1:$A$5)=A1),A1,0) and drag down so this will either give me only highest value and 0 in B1 to B5.

Now my question is if I want to use the same type of formula in another location then I have to keep changing the particular value of MAX from the equation.

Is there any way to change that absolute reference value with new absolute value.

Thank you

11 Replies
Use mixed reference like this in B1, copied down to B5:
=(MAX(A$1:A$5)=A1)*A1
Ya that one i got but if i copy that formula then the row is going to be fixed and it won't change the to other cell like A$10:A$15 automatically.
I hope I get help with that if possible
That’s just a sample structure of the formula I suggest you to use. For specifics, you need to attach your sample file. Remember, no one could possibly imagine the structure of your actual data, without a sample file. You need not think twice to believe me!

@Twifoo Sorry this is the first time in community so I didn't had an idea about the procedure to solve the method. I have explained my problem in excel file itself. Please do check and help to solve the problem.

Thank you

@chavanpr12 ,

 

Straigthforward solution could be

=IF((MAX(INDEX($A$1:A1000,IFERROR(AGGREGATE(14,6,1/($A$1:A1="")*ROW($A$1:A1),1)+1,1)):INDEX(A1:A1000,MATCH(1,INDEX(--(A1:A1000=""),0),0)-1))=A1),A1,0)

CSE formula

In the attached file, the formula in B1, copied down rows, is: 

=(MAX(INDEX(A$1:A2,
IFERROR(AGGREGATE(14,6,1/(A$1:A1="")*ROW(A$1:A1),1)+1,1)):
INDEX(A1:A10,
MATCH(1,INDEX(--(A1:A10=""),0),0)-1))=A1)*A1

Note that the foregoing formula follows a logic similar to that of @Sergei Baklan . Nonetheless, it is a non-array formula and assumes that the maximum number of cells to be evaluated at any given instance is 9. If, for example, such maximum is 99, A10 will have to be modified to A100, as follows: 

=(MAX(INDEX(A$1:A2,
IFERROR(AGGREGATE(14,6,1/(A$1:A1="")*ROW(A$1:A1),1)+1,1)):
INDEX(A1:A100,
MATCH(1,INDEX(--(A1:A100=""),0),0)-1))=A1)*A1

By the way, Sergei's formula assumes such maximum to be 999

Highlighted

@Sergei Baklan ,

 

Reading @Twifoo  post I corrected a bit the formula to drop limitation

1) Actually all formulas are regular (not array ones), includes initial

2) A1:A1000 could be changed on A1:A$1048576, but that's performance

=IF((MAX(INDEX(A:A,IFERROR(AGGREGATE(14,6,1/($A$1:A1="")*ROW($A$1:A1),1)+1,1)):INDEX(A1:A$1048576,MATCH(1,INDEX(--(A1:A$1048576=""),0),0)-1))=A1),A1,0)

 

@sergei_Baklan All this is difficult formula and hard to comprehend so is it possible to explain each term and their effect so I can edit according in my actual file.
Thank you.

@chavanpr12 , if format a bit and take the formula for the first cell of the second range

=IF((MAX(
   INDEX(A:A,
      IFERROR(AGGREGATE(14,6,1/($A$1:A10="")*ROW($A$1:A10),1)+1,1)):
   INDEX(A10:A$1048576,
      MATCH(1,INDEX(--(A10:A$1048576=""),0),0)-1))
   =A10),A10,0)

AGGREGATE returns the first (4th parameter 1) largest (first parameter 14) value in the array (3rd parameter) ignoring all errors (second parameter 6).

Our array here is multiplication of criteria 1/($A$1:$A10="") on rows numbers from $A$1 to current one. Criteria returns an error for all blank cells (which will be ignored) and 1 (=1/TRUE) for all non-blank cells. We multiply on cell's row numbers and return the largest one, in our case 10. IFERROR is needed for the beginning of the first range which starts from A1.

 

Now as result we have INDEX(A:A,10), or 10th cell in the column A, or A10.

 

Within MATCH the INDEX(--(A10:A$1048576=""),0) returns an array with TRUE for each blank cell in the range starting from A10 till end of the column and FALSE otherwise, double dash converts them to 1 and 0. MATCH find position of the first number 1 (1st parameter) in this array, other words position of the first blank cell, in our case that will be 6. Minus 1 gives position of last non-blank cell (5).

 

Thus second INDEX will be INDEX(A10:A$1048576,5) which returns 5th cell in above range, or A14.

 

As result INDEX(...):INDEX() will be equivalent of A10:A14 and we apply MAX to that range.

Related Conversations
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
Tabs and Dark Mode
cjc2112 in Discussions 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
9 Replies