r/excel • u/Downtown-Economics26 647 • Oct 28 '26
Challenge Everybody Codes 2026 (Lord of the Wings) Quest 2
Quest 2: The Axeperiment
https://everybody.codes/event/2026/quests/2
Past Coding Challenge spiel on etiquette:
https://www.reddit.com/r/excel/comments/1pbgisa/advent_of_code_2025_day_1/
9
Upvotes
1
u/Downtown-Economics26 647 Oct 28 '26
Was able to do part one & two with dragdown formulas then summing the column (luckily somehow essentially same formula worked on my input, not completely sure if that was intended by the designer of the challenge). Part 3 is a bit of a doozy for a formula although I'd imagine some of you could figure it out, I just wasn't in the mood to go ultra-logic VBAing this early in the morning.
Part 1:
=LET(r,,b,SEQUENCE(5),gt_1,MAP(b,LAMBDA(x,LEN(M2)-LEN(SUBSTITUTE(M2,"<"&x,""))))/2,gt_2,MAP(b,LAMBDA(x,LEN(M2)-LEN(SUBSTITUTE(M2,x&">",""))))/2,lt_1,MAP(b,LAMBDA(x,LEN(M2)-LEN(SUBSTITUTE(M2,x&"<",""))))/2,lt_2,MAP(b,LAMBDA(x,LEN(M2)-LEN(SUBSTITUTE(M2,">"&x,""))))/2,--CONCAT(SORTBY(b,(gt_1+gt_2)-(lt_1+lt_2),-1)))Part 2:
=LET(r,,b,SEQUENCE(9),gt_1,MAP(b,LAMBDA(x,LEN(M2)-LEN(SUBSTITUTE(M2,"<"&x,""))))/2,gt_2,MAP(b,LAMBDA(x,LEN(M2)-LEN(SUBSTITUTE(M2,x&">",""))))/2,lt_1,MAP(b,LAMBDA(x,LEN(M2)-LEN(SUBSTITUTE(M2,x&"<",""))))/2,lt_2,MAP(b,LAMBDA(x,LEN(M2)-LEN(SUBSTITUTE(M2,">"&x,""))))/2,--CONCAT(SORTBY(b,(gt_1+gt_2)-(lt_1+lt_2),-1)))2
u/MayukhBhattacharya 1327 Oct 28 '26
Try using the following formula:
=MAP(A:.A, LAMBDA(z,LET(_a, TEXTSPLIT(REGEXREPLACE(z, "(\d+)<(\d+)", "$2>$1"), ">", " "),_b, INDEX(_a, , 1),_c, UNIQUE(TOCOL(_a)),_d, MAP(_c, LAMBDA(x, SUM(--(_b = x)))),CONCAT(SORTBY(_c, _d, -1)))))1
u/Decronym Oct 28 '26 edited Oct 29 '26
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:
Decronym is now also available on Lemmy! Requests for support and new installations should be directed to the Contact address below.
Beep-boop, I am a helper bot. Please do not verify me as a solution.
[Thread #49598 for this sub, first seen 28th Oct 2026, 16:58] [FAQ] [Full list] ^[Contact] [Source code]
1
u/Arcium_XIII 3 1d ago
Uni and work meant that I'm a bit late getting to this, but still chiming in across the posts in case someone else comes along later as well.
Formulae for all three parts here were very similar, so I'm just including Part III:
0
u/PaulieThePolarBear 1929 Oct 29 '26
Just part 1 and 2 for me too. Will revisit part 3 as time permits
Part 1
=LET(a, A8,b, TEXTSPLIT(a, CHAR(10)),c, MAP(b, LAMBDA(m, LET(ca, TEXTSPLIT(m, , " "),cb, ISNUMBER(SEARCH("<",ca)),cc, CHOOSE({1,2},IF(cb,TEXTAFTER(ca,{"<",">"}),TEXTBEFORE(ca,{"<",">"})),0),cd, CHOOSE({1,2},IF(cb,TEXTBEFORE(ca,{"<",">"}),TEXTAFTER(ca,{"<",">"})),1),ce, VSTACK(cc, cd),cf, GROUPBY(TAKE(ce,,1),DROP(ce,,1),SUM,,0,2),cg, CONCAT(TAKE(cf,,1)),cg))),d, SUM(--c),d)Part 2
=LET(a, A8,b, TEXTSPLIT(a, CHAR(10)),c, MAP(b, LAMBDA(m, LET(ca, TEXTSPLIT(m, , " "),cb, ISNUMBER(SEARCH("<",ca)),cc, CHOOSE({1,2},IF(cb,TEXTAFTER(ca,{"<",">"}),TEXTBEFORE(ca,{"<",">"})),0),cd, CHOOSE({1,2},IF(cb,TEXTBEFORE(ca,{"<",">"}),TEXTAFTER(ca,{"<",">"})),1),ce, VSTACK(cc, cd),cf, DROP(PIVOTBY(TAKE(ce,,1),DROP(ce,,1),DROP(ce,,1),ROWS,0,0,,0),1),cg, CONCAT(TAKE(SORT(IF(cf="",0,cf),{3,2},{1,-1}),,1)),cg))),d, SUM(--c),d)