Home

Find the row that has the maximum value across a number of columns

%3CLINGO-SUB%20id%3D%22lingo-sub-838131%22%20slang%3D%22en-US%22%3EFind%20the%20row%20that%20has%20the%20maximum%20value%20across%20a%20number%20of%20columns%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-838131%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20table%20that%20has%20columns%20which%20represent%20week%20numbers%20and%20rows%20which%20represent%20people.%20The%20cells%20have%20a%20number%20in%20for%20each%20week%20against%20each%20person.%20What%20formula%20can%20I%20use%20to%20find%20out%20the%20person%20that%20has%20the%20highest%20total%20value%20across%20a%20number%20of%20weeks%3F%20For%20example%2C%20I%20want%20to%20select%20weeks%201%20to%205%20to%20see%20who%20scored%20the%20most%20points%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-838131%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-838261%22%20slang%3D%22en-US%22%3ERe%3A%20Find%20the%20row%20that%20has%20the%20maximum%20value%20across%20a%20number%20of%20columns%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-838261%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F394688%22%20target%3D%22_blank%22%3E%40JNollett%3C%2FA%3E%26nbsp%3Bcan%20you%20please%20share%20the%20file%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-838275%22%20slang%3D%22en-US%22%3ERe%3A%20Find%20the%20row%20that%20has%20the%20maximum%20value%20across%20a%20number%20of%20columns%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-838275%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F394688%22%20target%3D%22_blank%22%3E%40JNollett%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20may%20use%20an%20array%20formula%20(entered%20with%20Ctrl%2BShift%2BEnter)%20similar%20to%20B16%20of%20the%20attached%20file%2C%20which%20is%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3DLOOKUP(2%2C1%2F(MMULT(B%242%3AJ%2411%2C%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3ETRANSPOSE(B%241%3AJ%241%5E0*(B%241%3AJ%241%26gt%3B%3DB%2413)*(B%241%3AJ%241%26lt%3B%3DB%2414)))%3DB%2415)%2C%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3EA%242%3AA%2411)%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3ENote%20that%20Column%20K%20was%20presented%20therein%20for%20the%20sole%20purpose%20of%20verifying%20the%20correctness%20of%20the%20result%20obtained%20from%20the%20foregoing%20formula.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-842961%22%20slang%3D%22en-US%22%3ERe%3A%20Find%20the%20row%20that%20has%20the%20maximum%20value%20across%20a%20number%20of%20columns%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-842961%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20%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%3EI%20love%20the%20formula%2C%20but%20I%20have%20a%20minor%20problem%20in%20that%20my%20data%20is%20in%20a%20table%2C%20so%20the%20headers%20are%20actually%20headers%20and%20not%20just%20cells%2C%20so%20the%20first%20part%20of%20your%20formula%2C%20that%20equals%2042%2C%20returns%200%20(zero).%20I%20tried%20changing%20%3CFONT%3EB%241%3AJ%241%3C%2FFONT%3Eto%26nbsp%3B%3CFONT%3ETable2%5B%5B%23Headers%5D%2C%5B1%5D%3A%5B52%5D%5D%2C%20but%20that%20doesn't%20work%20and%20returns%200%20(zero)%20too.%20Any%20ideas%3F%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-842984%22%20slang%3D%22en-US%22%3ERe%3A%20Find%20the%20row%20that%20has%20the%20maximum%20value%20across%20a%20number%20of%20columns%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-842984%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F394688%22%20target%3D%22_blank%22%3E%40JNollett%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20a%20table%2C%20the%20numbered%20weeks%20will%20actually%20be%20text.%26nbsp%3B%20You%20therefore%20need%20either%20convert%20the%20'To'%20and%20'From'%20values%20to%20text%20or%2C%20conversely%2C%20convert%20the%20header%20row%20to%20values.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20programming%20style%20is%20not%20the%20same%20as%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's%20so%20I%20defined%20a%20name%20'%3CSTRONG%3Emask%3C%2FSTRONG%3E'%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CFONT%3E%3D%20(VALUE(Table1%5B%23Headers%5D)%26gt%3B%3DFrom)%20*%20(VALUE(Table1%5B%23Headers%5D)%26lt%3B%3DTo)%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CFONT%3Ewhich%20I%20use%20to%20filter%20out%20unwanted%20columns.%26nbsp%3B%20My%20formula%20to%20sum%20across%20rows%26nbsp%3B%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CFONT%3E%3D%20MMULT(Table1%2C%20TRANSPOSE(mask)%20)%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CFONT%3Egives%20the%26nbsp%3B%3CFONT%3E'%3CSTRONG%3Escore%3C%2FSTRONG%3E'%3C%2FFONT%3E.%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%3EFrom%20there%2C%20I%20part%20company%20with%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%3Eand%2C%20I%20expect%2C%20you%20because%20I%20am%20using%20the%20latest%20Office%20365%20version.%26nbsp%3B%20I%20simply%20sorted%20the%20names%20descending%20by%20score%26nbsp%3B%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CFONT%3E%3D%20%40%20SORTBY(%20Name%2C%20score%2C%20-1%20)%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CFONT%3Eand%20returned%20the%20first%20value%20only.%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-843066%22%20slang%3D%22en-US%22%3ERe%3A%20Find%20the%20row%20that%20has%20the%20maximum%20value%20across%20a%20number%20of%20columns%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-843066%22%20slang%3D%22en-US%22%3EMy%20suggested%20formula%20was%20a%20sample.%20Please%20attach%20your%20sample%20file%20for%20the%20specifics.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-843227%22%20slang%3D%22en-US%22%3ERe%3A%20Find%20the%20row%20that%20has%20the%20maximum%20value%20across%20a%20number%20of%20columns%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-843227%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F394688%22%20target%3D%22_blank%22%3E%40JNollett%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20the%20attached%20version%20for%20the%20file%2C%20I%20converted%20A1%3AJ11%20as%20Table1.%20Column%20L%20and%20B15%20are%20presented%20for%20verification%20purposes%20only.%20Thus%2C%20the%20revised%20array%20formula%20in%20B16%20is%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3DLOOKUP(2%2C1%2F(FREQUENCY(0%2C%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3E1%2F(1%2BMMULT(Table1%5B%5B1%5D%3A%5B9%5D%5D%2C%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3ETRANSPOSE(Table1%5B%5B%23Headers%5D%2C%5B1%5D%3A%5B9%5D%5D%5E0*%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3E(--Table1%5B%5B%23Headers%5D%2C%5B1%5D%3A%5B9%5D%5D%26gt%3B%3DB%2413)*%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3E(--Table1%5B%5B%23Headers%5D%2C%5B1%5D%3A%5B9%5D%5D%26lt%3B%3DB%2414))))))%2C%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3ETable1%5BName%5D)%3C%2FSTRONG%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-843393%22%20slang%3D%22en-US%22%3ERe%3A%20Find%20the%20row%20that%20has%20the%20maximum%20value%20across%20a%20number%20of%20columns%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-843393%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%3EThat%20worked%20until%20I%20added%20data%20from%20the%20next%20month.%20Take%20a%20look.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-843394%22%20slang%3D%22en-US%22%3ERe%3A%20Find%20the%20row%20that%20has%20the%20maximum%20value%20across%20a%20number%20of%20columns%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-843394%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%3EI%20am%20using%20the%20latest%20version%20of%20Office%20365%20too%2C%20but%20SCORE%20is%20not%20a%20field%20in%20my%20data.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-843855%22%20slang%3D%22en-US%22%3ERe%3A%20Find%20the%20row%20that%20has%20the%20maximum%20value%20across%20a%20number%20of%20columns%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-843855%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F394688%22%20target%3D%22_blank%22%3E%40JNollett%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20defined%20the%20Name%3CFONT%3E'%3CSTRONG%3Escore%3C%2FSTRONG%3E'%20using%20Name%20Manager.%26nbsp%3B%20The%20formula%20goes%20into%20the%20Refers%20To%20dialogue%20box.%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CFONT%3E%3D%20MMULT(Table1%2C%20TRANSPOSE(mask)%20)%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CFONT%3EWhenever%20'%3CSTRONG%3Escore%3C%2FSTRONG%3E'%20appears%20in%20a%20formula%20on%20the%20worksheet%2C%20Excel%20will%20evaluate%20it%20as%20an%20array%20formula%20without%20requiring%20Ctrl%2BShift%2BEnter%26nbsp%3B%20%5BOffice%20365%20is%20moving%20to%20evaluate%20all%20formulas%20as%20array%20formulas%20by%20default%5D.%26nbsp%3B%20To%20display%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CFONT%3E%3D%20score%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CFONT%3Eon%20a%20worksheet%20may%20require%20CSE%20(depending%20on%20the%20version%20of%20Excel)%20but%26nbsp%3B%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CFONT%3E%3D%20MAX(%20score%20)%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CFONT%3Ewill%20work%20correctly%20irrespective%20of%20the%20version.%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-844957%22%20slang%3D%22en-US%22%3ERe%3A%20Find%20the%20row%20that%20has%20the%20maximum%20value%20across%20a%20number%20of%20columns%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-844957%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%3EHow%20does%20it%20work%20in%20the%20file%20that%20I%20attached%20though%2C%20as%20I%20cannot%20appear%20to%20get%20it%20to%20work.%20I%20don't%20understand%20the%26nbsp%3B%40sortby%26nbsp%3B%20command%20either.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-845091%22%20slang%3D%22en-US%22%3ERe%3A%20Find%20the%20row%20that%20has%20the%20maximum%20value%20across%20a%20number%20of%20columns%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-845091%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F394688%22%20target%3D%22_blank%22%3E%40JNollett%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESeems%20I%20still%20had%20the%20workbook%20in%20memory%20on%20my%20laptop.%26nbsp%3B%20It%20also%20contains%20an%20implementation%20of%20one%20of%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's%20formulas.%26nbsp%3B%20One%20thing%20I%20did%20when%20creating%20the%20table%20was%20to%20exclude%20the%20Name%20and%20Totals%20columns%2C%20leaving%20a%20blank%20column%20to%20separate%20them.%26nbsp%3B%20This%20allows%20me%20to%20use%3C%2FP%3E%3CP%3E%3CSTRONG%3EVALUE(Table1%5B%23Headers%5D)%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3Ewhich%20grows%20dynamically%20with%20extra%20columns%2C%20rather%20than%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CSPAN%3EVALUE(Table1%5B%5B%23Headers%5D%2C%5B1%5D%3A%5B9%5D%5D)%3C%2FSPAN%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSPAN%3Ewhich%20would%20need%20to%20be%20edited%20to%20include%20additional%20columns.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThe%20SORTBY%20column%20is%20a%20new%20function%2C%20introduced%20last%20September%2C%20and%20gradually%20being%20rolled%20out%20as%20part%20of%20the%20Dynamic%20Array%20changes.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CSPAN%3E%3CFONT%3E%3D%20%40%20SORTBY(%20Name%2C%20score%2C%20-1%20)%3C%2FFONT%3E%3C%2FSPAN%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CFONT%3Esorts%20the%20'Name'%20array%20by%20'score'%20in%20descending%20order.%26nbsp%3B%20The%20'%40'%20sign%20before%20the%20an%20array%20result%20truncates%20the%20result%20to%20a%20single%20value%20(otherwise%20I%20would%20get%20a%20sorted%20version%20of%20the%20entire%20list%20of%20names).%3C%2FFONT%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CFONT%3EAt%20present%2C%20you%20will%20have%20the%20new%20function%20if%20you%20are%20signed%20up%20to%20Office%20365%20insider%20(weekly%20updates)%3B%20it%20is%20in%20the%20process%20of%20being%20rolled%20out%20to%20'monthly'%20and%20'semi-annual'%20may%20have%20some%20time%20to%20wait.%3C%2FFONT%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%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%3C%2FP%3E%3CP%3EI%20think%20the%20term%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CSPAN%3E(Table1%5B%5B%23Headers%5D%2C%5B1%5D%3A%5B9%5D%5D)%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSTRONG%3E%5E0%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3Eis%20redundant%20since%20the%20following%20terms%20will%20give%20the%20same%20result%20without%20it.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-845977%22%20slang%3D%22en-US%22%3ERe%3A%20Find%20the%20row%20that%20has%20the%20maximum%20value%20across%20a%20number%20of%20columns%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-845977%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%20agree.%20The%20two%20conditional%20clauses%20cause%20such%20redundancy.%20If%20there%20were%20only%20one%20conditional%20clause%2C%20then%20no%20such%20redundancy%20would%20have%20occurred.%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20your%20keen%20observation.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
JNollett
Occasional Contributor

I have a table that has columns which represent week numbers and rows which represent people. The cells have a number in for each week against each person. What formula can I use to find out the person that has the highest total value across a number of weeks? For example, I want to select weeks 1 to 5 to see who scored the most points

12 Replies

@JNollett can you please share the file?

@JNollett 

You may use an array formula (entered with Ctrl+Shift+Enter) similar to B16 of the attached file, which is: 

=LOOKUP(2,1/(MMULT(B$2:J$11,
TRANSPOSE(B$1:J$1^0*(B$1:J$1>=B$13)*(B$1:J$1<=B$14)))=B$15),
A$2:A$11)

Note that Column K was presented therein for the sole purpose of verifying the correctness of the result obtained from the foregoing formula.

Hi @Twifoo 

 

I love the formula, but I have a minor problem in that my data is in a table, so the headers are actually headers and not just cells, so the first part of your formula, that equals 42, returns 0 (zero). I tried changing B$1:J$1 to Table2[[#Headers],[1]:[52]], but that doesn't work and returns 0 (zero) too. Any ideas?

 

@JNollett 

In a table, the numbered weeks will actually be text.  You therefore need either convert the 'To' and 'From' values to text or, conversely, convert the header row to values.

 

My programming style is not the same as @Twifoo 's so I defined a name 'mask'

= (VALUE(Table1[#Headers])>=From) * (VALUE(Table1[#Headers])<=To)

which I use to filter out unwanted columns.  My formula to sum across rows 

= MMULT(Table1, TRANSPOSE(mask) )

gives the  'score'.

 

From there, I part company with @Twifoo and, I expect, you because I am using the latest Office 365 version.  I simply sorted the names descending by score 

= @ SORTBY( Name, score, -1 )

and returned the first value only.

 

My suggested formula was a sample. Please attach your sample file for the specifics.
Highlighted

@JNollett 

In the attached version for the file, I converted A1:J11 as Table1. Column L and B15 are presented for verification purposes only. Thus, the revised array formula in B16 is: 

=LOOKUP(2,1/(FREQUENCY(0,
1/(1+MMULT(Table1[[1]:[9]],
TRANSPOSE(Table1[[#Headers],[1]:[9]]^0*
(--Table1[[#Headers],[1]:[9]]>=B$13)*
(--Table1[[#Headers],[1]:[9]]<=B$14)))))),
Table1[Name])

@TwifooThat worked until I added data from the next month. Take a look.

@Peter BartholomewI am using the latest version of Office 365 too, but SCORE is not a field in my data.

@JNollett 

I defined the Name 'score' using Name Manager.  The formula goes into the Refers To dialogue box.

= MMULT(Table1, TRANSPOSE(mask) )

Whenever 'score' appears in a formula on the worksheet, Excel will evaluate it as an array formula without requiring Ctrl+Shift+Enter  [Office 365 is moving to evaluate all formulas as array formulas by default].  To display

= score

on a worksheet may require CSE (depending on the version of Excel) but 

= MAX( score )

will work correctly irrespective of the version.

@Peter BartholomewHow does it work in the file that I attached though, as I cannot appear to get it to work. I don't understand the @sortby  command either.

@JNollett 

Seems I still had the workbook in memory on my laptop.  It also contains an implementation of one of @Twifoo's formulas.  One thing I did when creating the table was to exclude the Name and Totals columns, leaving a blank column to separate them.  This allows me to use

VALUE(Table1[#Headers])

which grows dynamically with extra columns, rather than

VALUE(Table1[[#Headers],[1]:[9]])

which would need to be edited to include additional columns.

 

The SORTBY column is a new function, introduced last September, and gradually being rolled out as part of the Dynamic Array changes.

= @ SORTBY( Name, score, -1 )

sorts the 'Name' array by 'score' in descending order.  The '@' sign before the an array result truncates the result to a single value (otherwise I would get a sorted version of the entire list of names).

 

At present, you will have the new function if you are signed up to Office 365 insider (weekly updates); it is in the process of being rolled out to 'monthly' and 'semi-annual' may have some time to wait.

 

@Twifoo 

I think the term

(Table1[[#Headers],[1]:[9]])^0

is redundant since the following terms will give the same result without it.

@Peter Bartholomew 

I agree. The two conditional clauses cause such redundancy. If there were only one conditional clause, then no such redundancy would have occurred. 

Thanks for your keen observation. 

Related Conversations
Extentions Synchronization
Deleted in Discussions on
3 Replies
Tabs and Dark Mode
cjc2112 in Discussions on
35 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
9 Replies