Keeping the higher value in a variable row

%3CLINGO-SUB%20id%3D%22lingo-sub-1023329%22%20slang%3D%22en-US%22%3EKeeping%20the%20higher%20value%20in%20a%20variable%20row%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1023329%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20challenge%20that%20seemed%20simple%20to%20me%20at%20the%20beginning.%20Famous%20last%20words.%20Hoping%20you%20can%20provide%20guidance.%20Some%20context%20before%20the%20question%20if%20that%20helps%20to%20frame%20it%20better.%3C%2FP%3E%3CP%3E%3CU%3EContext%3A%3C%2FU%3E%3C%2FP%3E%3CP%3EA%20row%20is%20calculating%20the%20number%20of%20floors%20in%20a%20building%20that%20need%20to%20be%20built%20out%20in%20order%20to%20accommodate%20temporary%20staff.%20When%20the%20staff%20number%20declines%20for%20some%20number%20of%20months%2C%20we%20still%20keep%20the%20floor%20and%20fill%20it%20as%20staff%20are%20hired%20again%20when%20needed.%20The%20columns%20are%20months%20over%20a%205%20year%20period.%20Note%20that%20at%20the%20end%20of%20each%2012%20month%20period%2C%20there%20is%20a%20sum%20column%20to%20show%20total%20for%20that%20fiscal%20year.%3C%2FP%3E%3CP%3E%3CU%3EQuestion%3A%3C%2FU%3E%3C%2FP%3E%3CP%3EA%20row%20calculates%20a%20number%20that%20may%20increase%20or%20decrease%20for%20each%20column%2C%20such%20as...%3C%2FP%3E%3CP%3E1%2C%201%2C%201%2C%201%2C%202%2C%202%2C%202%2C%202%2C%202%2C%202%2C%201%2C%201%2C%20SUM%20COLUMN%2C1%2C%201%2C%201%2C%201%2C%202%2C%202%2C%202%2C%203%2C%203%2C%203%2C%203%2C%203%2C%20SUM%20COLUMN%2C%203%2C%204%2C%204%2C%204%2C%203%2C%203%2C%203%2C%203%2C%204%2C%204%2C%204%20etc.%3C%2FP%3E%3CP%3EThe%20pattern%20is%20variable%20depending%20on%20other%20inputs.%20However%2C%20we%20need%20to%20keep%20the%20higher%20number%20once%20it%20appears.%20Using%20the%20example%20above%2C%20we%20would%20need%20to%20have%20it%20show%20the%20following%20(or%20have%20it%20appear%20on%20another%20row%20that%20we%20can%20use%20for%20our%20next%20set%20of%20calculations)%3A%3C%2FP%3E%3CP%3E1%2C%201%2C%201%2C%201%2C%202%2C%202%2C%202%2C%202%2C%202%2C%202%2C%202%2C%202%2C%20SUM%20COLUMN%2C%202%2C%202%2C%202%2C%202%2C%202%2C%202%2C%202%2C%203%2C%203%2C%203%2C%203%2C%203%2C%20SUM%20COLUMN%2C%203%2C%204%2C%204%2C%204%2C%204%2C%204%2C%204%2C%204%2C%204%2C%204%2C%204%20etc.%3C%2FP%3E%3CP%3EBecause%20the%20pattern%20is%20variable%2C%20I%20can't%20come%20up%20with%20a%20way%20to%20maintain%20the%20higher%20number%20once%20it%20appears.%3C%2FP%3E%3CP%3EThank%20you%20for%20your%20help!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1023329%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1023450%22%20slang%3D%22en-US%22%3ERe%3A%20Keeping%20the%20higher%20value%20in%20a%20variable%20row%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1023450%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F463921%22%20target%3D%22_blank%22%3E%40morryp%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20dynamic%20MAX%20formula%20in%20B3%20is%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3DMAX(INDEX(2%3A2%2C2%2B13*INT(COLUMN()%2F14))%3A%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3EINDEX(2%3A2%2CCOLUMN()))%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EThe%20foregoing%20formula%20is%20then%20copied%20across%2C%20skipping%20the%20sum%20column%20(in%20bold%20format)%2C%20as%20partly%20shown%20below%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20600px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F158302i7E024FC4F7CC0F40%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Dynamic%20Max-1.PNG%22%20title%3D%22Dynamic%20Max-1.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1024406%22%20slang%3D%22en-US%22%3ERe%3A%20Keeping%20the%20higher%20value%20in%20a%20variable%20row%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1024406%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%3BThank%20you%20very%20much%20for%20the%20formula.%20It%20works%20beautifully%20when%20I%20test%20it%20on%20a%20blank%20sheet%20recreating%20the%20three%20rows%20and%20applying%20the%20formula%20in%20B3%20as%20you%20explained.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20working%20on%20the%20live%20model%20I%20inserted%20a%20row%20below%20the%20variable%20numbered%20row%20and%20applied%20the%20formula.%20It%20would%20not%20return%20a%20value.%20Is%20the%20formula%20dependent%20on%20the%20row%20and%20cell%3F%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1024990%22%20slang%3D%22en-US%22%3ERe%3A%20Keeping%20the%20higher%20value%20in%20a%20variable%20row%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1024990%22%20slang%3D%22en-US%22%3EIn%20that%20case%2C%20lock%20the%20%E2%80%9CRequired%E2%80%9D%20row.%20In%20MY%20SAMPLE%20(because%20you%20didn%E2%80%99t%20attach%20any)%2C%20modify%202%3A2%20to%20%242%3A%242.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1026451%22%20slang%3D%22en-US%22%3ERe%3A%20Keeping%20the%20higher%20value%20in%20a%20variable%20row%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1026451%22%20slang%3D%22en-US%22%3E%3CP%3EHi%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%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPerfection!.%20Thank%20you%20so%20much%20for%20your%20solution.%20I%20greatly%20appreciate%20it.%3C%2FP%3E%3CP%3EBest%20regards%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1027847%22%20slang%3D%22en-US%22%3ERe%3A%20Keeping%20the%20higher%20value%20in%20a%20variable%20row%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1027847%22%20slang%3D%22en-US%22%3EYou%E2%80%99re%20perfectly%20welcome!%3C%2FLINGO-BODY%3E
New Contributor

I have a challenge that seemed simple to me at the beginning. Famous last words. Hoping you can provide guidance. Some context before the question if that helps to frame it better.

Context:

A row is calculating the number of floors in a building that need to be built out in order to accommodate temporary staff. When the staff number declines for some number of months, we still keep the floor and fill it as staff are hired again when needed. The columns are months over a 5 year period. Note that at the end of each 12 month period, there is a sum column to show total for that fiscal year.

Question:

A row calculates a number that may increase or decrease for each column, such as...

1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, SUM COLUMN,1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, SUM COLUMN, 3, 4, 4, 4, 3, 3, 3, 3, 4, 4, 4 etc.

The pattern is variable depending on other inputs. However, we need to keep the higher number once it appears. Using the example above, we would need to have it show the following (or have it appear on another row that we can use for our next set of calculations):

1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, SUM COLUMN, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, SUM COLUMN, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 etc.

Because the pattern is variable, I can't come up with a way to maintain the higher number once it appears.

Thank you for your help!

 

5 Replies

@morryp 

The dynamic MAX formula in B3 is: 

=MAX(INDEX(2:2,2+13*INT(COLUMN()/14)):
INDEX(2:2,COLUMN()))

The foregoing formula is then copied across, skipping the sum column (in bold format), as partly shown below: 

Dynamic Max-1.PNG

@Twifoo Thank you very much for the formula. It works beautifully when I test it on a blank sheet recreating the three rows and applying the formula in B3 as you explained.

 

When working on the live model I inserted a row below the variable numbered row and applied the formula. It would not return a value. Is the formula dependent on the row and cell? 

In that case, lock the “Required” row. In MY SAMPLE (because you didn’t attach any), modify 2:2 to $2:$2.

Hi @Twifoo 

 

Perfection!. Thank you so much for your solution. I greatly appreciate it.

Best regards

You’re perfectly welcome!