Friday, November 20, 2026

Advent of Code 2016 - Day 9: Explosives in Cyberspace

Part 1

Description

The input is a compressed text. A marker like (AxB) means: take the next A characters and repeat them B times. In this first version, markers inside a repeated section are not expanded. Part 1 asks for the length of the decompressed text. 

Solution

I only need the length, not the text itself, so I never build the decompressed text. I pasted the input into A6 and deal with one marker per row. Row 8 works on A6, and every later row works on the text left over after the previous section.

For the text in question, one row finds the first marker and reads its two numbers:

B8: =FIND("(",TRIM($A$6))                          ← where the marker starts
D8: =FIND("x",TRIM($A$6))
F8: =FIND(")",TRIM($A$6))                          ← where it ends
C8: =--MID(LEFT(TRIM($A$6),D8-1),B8+1,9)           ← A, the characters to repeat
E8: =--MID(LEFT(TRIM($A$6),F8-1),D8+1,9)           ← B, the repeat count

The length this marker adds is the letters before it, plus A × B for its section. Then I cut the whole marker and its A characters off the text, and the next row starts from what remains:

G8: =B8-1+C8*E8
I8: =MID(A6,F8+C8+1,10^6)

Row 9 is the same, with I8 in place of TRIM($A$6) (so B9: =FIND("(",I8), and so on), and I filled down. After 13 markers the text is used up (I20 is empty), so the answer is the sum of column G:

B2: =SUM(G8:G20)

If there were still letters after the last marker, their count would need adding.

There is a shorter formula: 

B2: =REDUCE(HSTACK(A6:B6),SEQUENCE(100),
 LAMBDA(a,v,
  LET(
  z,INDEX(a,1,1),
  o,FIND("(",z),
  p,FIND("x",z),
  q,FIND(")",z),
  l,--MID(LEFT(z,p-1),o+1,9),
  m,--MID(LEFT(z,q-1),p+1,9),
  result,IF(z="",INDEX(a,1,2)+IFERROR(o-1+m*l,LEN(z)),
   HSTACK(IFERROR(MID(z,q+l+1,8^5),""),
   INDEX(a,1,2)+IFERROR(o-1+m*l,LEN(z)))
   ),
  Part1,IF(columns(a)=1,
   a,
   result
   ),
  Part1
  )
 )
)

Part 2

Description

Now markers inside a repeated section are expanded too, and so on repeatedly. The text can get very long, so again I only calculate its length. 

Solution

I still use one row per marker, in the order the markers appear, but now the next row starts right after the marker, not after its section. The markers inside the section get their own rows, and mine has more than a thousand of them (rows 25 to 1066). The columns B to F are the same as before, except that F, the position of the ), now means “characters used up so far”: the letters in front of the marker plus the marker itself. The text left over is:

I25: =MID(A6,F25+1,8^5)

For each marker I need to know how many times the letters in front of it will be repeated. That is the product of the repeat counts of all earlier markers whose section still covers this spot. A section still covers the spot when the characters used since it ended (the sum of the F values after it) are no more than its length. Column L works that out (this is row 27, and in later rows the ranges simply grow by one row):

L27: =LET(a,$F$26:F26,
          b,SEQUENCE(ROWS(a)),
          c,REDUCE($F$24,b,LAMBDA(p,q,VSTACK(p,SORT(SUM(TAKE(a,-q)))))),
          d,SORT(c,,-1),
          e,$C$25:C26,
          f,$E$25:E26,
          g,IF(d<=e,PRODUCT(IF(d<=e,f,"")),0),
          TAKE(SORT(g,,-1),1))
  • c collects, for every earlier marker, how many characters have been used since it, and d sorts them to line up with the markers.
  • g is the product of the repeat counts of the markers that still cover this spot, and 0 for the others, and the last line takes the largest value, which is that product.
  • L25 and L26 are 0, because there are no letters in front of the first two markers.

Column M counts the letters in front of each marker, times that multiplier. Letters beyond the end of the previous marker’s section (more than C25 of them) are counted once, as the formula says:

M26: =IF(B26-1>C25,C25*L26+B26-1-C25,(B26-1)*L26)
N25: =SUM($M$25:M25)                                ← running total

The last marker is in row 1066. After it come a few more letters, and each one repeats as often as the next row’s multiplier says (L1067). The next row has no marker, so it shows an error, and I add those letters myself:

D2: =N1066+LEN(I1066)*L1067

A caveat. These rules fit my input, but I haven’t tested them on other inputs. For instance, letters that come after an inner section has ended, while an outer section is still open, would be counted once here instead of being repeated.

A fix for this is using this formula:

D2: =LET(
 s,A6,
 n,LEN(s),
 k,SEQUENCE(n),
 ch,MID(s,k,1),
 op,FILTER(k,ch="("),
 cl,FILTER(k,ch=")"),
 xx,FILTER(k,CODE(ch)=120),
 l,--MID(s,op+1,xx-op-1),
 m,--MID(s,xx+1,cl-xx-1),
 w,REDUCE(SEQUENCE(n,,1,0),SEQUENCE(ROWS(op)),
  LAMBDA(w,i,
   IF((k>=INDEX(cl,i)+1)*(k<=INDEX(cl,i)+INDEX(l,i)),
    w*INDEX(m,i),
    w
   )
  )
 ),
 Part2, SUM(w*(CODE(ch)>=65)*(CODE(ch)<=90)),
 Part2
)
Share:

Wednesday, November 18, 2026

Advent of Code 2016 - Day 8: Two-Factor Authentication

Part 1

Description

A small screen, 50 pixels wide and 6 pixels tall, starts with every pixel off. A list of instructions changes it:

  • rect AxB turns on all the pixels in the top-left corner, A wide and B tall.
  • rotate row y=A by B shifts row A to the right by B pixels, and pixels that fall off the end come back at the start.
  • rotate column x=A by B does the same for column A, shifting down.

Part 1 asks how many pixels are lit after all the instructions. 

Solution

I pasted the 162 instructions into A5:A166. One formula builds the whole screen. It starts with a grid of zeros (6 rows, 50 columns) and uses REDUCE to apply the instructions one after another. At each step p is the screen so far and q is the next instruction:

I5: =LET(a,SEQUENCE(6),
         b,SEQUENCE(,50),
         c,REDUCE(a*b*0,A5:A166,
           LAMBDA(p,q,
             LET(d,TOROW(--(TEXTSPLIT(q,{" ","x","=","by"})),3),
                 xx,INDEX(d,1,1),
                 yy,INDEX(d,1,2),
                 SWITCH(MID(q,8,1),
                   "c",IF(b=xx+1,VSTACK(TAKE(p,-yy),DROP(p,-yy)),p),
                   "r",IF(a=xx+1,HSTACK(TAKE(p,,-yy),DROP(p,,-yy)),p),
                   IF((b<=xx)*(a<=yy),1,p))))),
         c)
  • a is the row numbers 1 to 6 and b is the column numbers 1 to 50.
  • d cuts the instruction into words and numbers, and keeps only the two numbers (the words give errors, which TOROW(…,3) skips). xx is the first number and yy is the second.
  • The eighth character of an instruction tells its type: “rotate row” has an r there, “rotate column” has a c, and rect has a digit or an x.
  • For a column rotation, VSTACK(TAKE(p,-yy),DROP(p,-yy)) is the screen with its last yy rows moved to the top. The IF(b=xx+1,…,p) uses that only for the chosen column.
  • For a row rotation, HSTACK(TAKE(p,,-yy),DROP(p,,-yy)) moves the last yy columns to the front, and the IF(a=xx+1,…,p) uses it only for the chosen row.
  • For a rect, IF((b<=xx)*(a<=yy),1,p) turns on the top-left xx by yy block.

The formula fills I5:BF10, a block of 1s and 0s. The answer is the number of 1s:

B2: =SUM(I5#)

Part 2

Description

The screen is supposed to show a code made of letters, and Part 2 asks for it.

Solution

No new calculation is needed, because the screen is already there. I added conditional formatting (colour the cells whose value is 1) to I5:BF10 so the lit pixels stand out, and the letters can be read by eye. I typed what I read into D2.

Another way: a macro. As a cross-check I also drew the screen with a macro. In B5, =MID(A5,8,1) gives the instruction type (r, c or anything else for rect) and C5:D5 hold the two numbers. The macro goes through them and draws the result in I18:BF23:

Public Sub DrawScreen()
    Dim ws As Worksheet: Set ws = Worksheets("2016")
    Dim out As Range: Set out = ws.Range("I18:BF23")      ' 6 rows x 50 columns
    Dim keep(1 To 50) As Variant
    Dim r As Long, i As Long, j As Long, k As Long
    Dim ins As String, a As Long, b As Long

    out.Value = 0
    r = 5
    Do Until ws.Cells(r, 2).Value = ""
        ins = ws.Cells(r, 2).Value
        a = ws.Cells(r, 3).Value
        b = ws.Cells(r, 4).Value
        Select Case ins
            Case "r"                                      ' rotate row a by b
                For i = 1 To 50: keep(i) = out(a + 1, i).Value: Next i
                For i = 1 To 50
                    k = (i - 1 + b) Mod 50 + 1
                    out(a + 1, k).Value = keep(i)
                Next i
            Case "c"                                      ' rotate column a by b
                For i = 1 To 6: keep(i) = out(i, a + 1).Value: Next i
                For i = 1 To 6
                    k = (i - 1 + b) Mod 6 + 1
                    out(k, a + 1).Value = keep(i)
                Next i
            Case Else                                     ' rect a x b
                For i = 1 To a
                    For j = 1 To b
                        out(j, i).Value = 1
                    Next j
                Next i
        End Select
        r = r + 1
    Loop
End Sub

Both ways give exactly the same picture.




 

Share:

Advent of Code 2016 - Day 6: Signals and Noise

Part 1

Description

A message is sent repeatedly, but noise garbles it, so every copy is a bit different. The input has one copy per line, all eight letters long. Reading down each column of letters, the most frequent letter is the right one. Part 1 asks for the corrected message. 

Solution

I pasted the 546 lines into A5:A550. The first step is to split every line into its eight letters, one per column. SEQUENCE(,8) makes the numbers 1 to 8 across a row, and MID takes that character of every message:

C5: =LET(a,A5:A550,MID(a,SEQUENCE(,8),1))        ← fills C5:J550

Now each column holds all the copies of one letter of the message. For one column, COUNTIF(C5:C550,C5:C550) tells, for every cell, how many times its letter appears in the column. Comparing that with the largest count gives TRUE for the most common letter. MATCH finds the first TRUE and INDEX returns the letter:

=LET(c,C5:C550,n,COUNTIF(c,c),INDEX(c,MATCH(MAX(n),n,0)))

This is an array formula (in older versions of Excel, enter it with Ctrl+Shift+Enter). I filled it to the right, up to J4. The message is the eight letters joined together:

B2: =CONCAT(C4:J4)

I tried the puzzle’s example (16 short lines) and it gives the message from the puzzle text.

Part 2

Description

The repetition code turns out to work differently: the original message is made of the least common letter in each column.

Solution

That is the same formula with MIN in place of MAX. I put it in L4 and filled it to the right, up to S4. Each cell still looks at its own column (L4 looks at column C, M4 at column D, and so on):

L4: =INDEX(C5:C550,MATCH(TRUE,COUNTIF(C5:C550,C5:C550)=MIN(COUNTIF(C5:C550,C5:C550)),0))
D2: =CONCAT(L4:S4)

A caveat. If two letters tie for the most (or least) common, these formulas quietly pick the first one in the list. In my input every column has a clear winner, so it doesn’t matter, but the margin is small, so it is worth checking that your own columns have no ties.


Share:

Sunday, November 15, 2026

Advent of Code 2016 - Day 7: Internet Protocol Version 7

Part 1

Description

Each line of the input is an IP address made of letters, and some parts are inside square brackets. An address supports TLS if it has an ABBA somewhere outside the brackets, and no ABBA inside any brackets. An ABBA is four letters: two different letters followed by the same two reversed, such as xyyx. Part 1 asks how many addresses support TLS.

Solution

Normal Excel functions can’t look for a pattern like xyyx, so I used regular expressions through VBA. I used a function called RegExpMatch that I found online here. It says TRUE if a pattern matches somewhere in a text:

Public Function RegExpMatch(input_range As Range, pattern As String, Optional match_case As Boolean = True) As Variant
  Dim arRes() As Variant 'array to store the results
  Dim iInputCurRow, iInputCurCol, cntInputRows, cntInputCols As Long 'index of the current row in the source range, index of the current column in the source range, count of rows, count of columns

  On Error GoTo ErrHandl

  RegExpMatch = arRes

  Set regex = CreateObject("VBScript.RegExp")
  regex.pattern = pattern
  regex.Global = True
  regex.MultiLine = True
  If True = match_case Then
    regex.ignorecase = False
  Else
    regex.ignorecase = True
  End If

  cntInputRows = input_range.Rows.Count
  cntInputCols = input_range.Columns.Count
  ReDim arRes(1 To cntInputRows, 1 To cntInputCols)

  For iInputCurRow = 1 To cntInputRows
    For iInputCurCol = 1 To cntInputCols
      arRes(iInputCurRow, iInputCurCol) = regex.Test(input_range.Cells(iInputCurRow, iInputCurCol).Value)
    Next
  Next

  RegExpMatch = arRes
  Exit Function
ErrHandl:
    RegExpMatch = CVErr(xlErrValue)
End Function

I pasted the 2,000 addresses into A6:A2005. First I counted the opening brackets in each one, to see how many parts I would need:

B6: =LEN(A6)-LEN(SUBSTITUTE(A6,"[",""))

The most is 3, so an address has at most four parts outside the brackets and three inside. Then I split each address at every [ and ]. The pieces alternate between outside and inside, so C, E, G and I are outside the brackets, and D, F and H are inside:

C6: =TEXTSPLIT($A6,{"[","]"})        ← fills C6:E6, up to C6:I6 

The pattern for an ABBA is in B4:

(.)(?!\1)(.)\2\1

(.) is the first letter (A), (?!\1) says the next letter is not A again, (.) is the second letter (B), and \2\1 repeats B and then A. In K6:Q6 I test each piece: 1 if an outside piece contains an ABBA, and 1 if an inside piece does not:

K6: =--RegExpMatch(C6,$B$4)             ← outside pieces (K, M, O, Q)
L6: =--NOT(RegExpMatch(D6,$B$4)) 

An address supports TLS when every inside piece is clear and at least one outside piece has an ABBA (an empty piece counts as clear):

R6: =--AND(L6,N6,P6,OR(K6,M6,O6,Q6))
B2: =SUM(R6:R2005)

I tried the puzzle’s four examples, for instance abba[mnop]qrst (yes) and abcd[bddb]xyyx (no), and they came out as the puzzle says.

Part 2

Description

Now an address supports SSL if it has an ABA outside the brackets (like xyx) and the matching BAB inside the brackets (yxy). Again I need the number of addresses that support it.

Solution

Here the two parts have to be compared, so I tested the whole address with two patterns. The supporting ABA can come before or after the BAB, so I need both:

E4: (.)(.)(?!\2)\1[^\]]*\[.*\2\1\2[^\[]*\]
F4: \[[^\]\[]*(.)(.)(?!\2)\1.*?\][^\[]*\2\1\2
  • E4 finds an ABA outside the brackets (no ] before the next [), and later a BAB inside a pair of brackets (no [ before the next ]).
  • F4 finds an ABA inside a pair of brackets, and later a BAB outside, right after a closing ].
AI6: =RegExpMatch(A6,$E$4)
AJ6: =RegExpMatch(A6,$F$4)
AK6: =--OR(AI6:AJ6)
D2:  =COUNTIF(AK6:AK2005,">0")

The puzzle’s four examples (aba[bab]xyz, xyx[xyx]xyx, aaa[kek]eke and zazbz[bzb]cdb) give yes, no, yes, yes, as the puzzle says.

Share:

Advent of Code 2016 - Day 5: How About a Nice Game of Chess?

Part 1

Description

My puzzle input is a door ID, a short piece of text. To find the password, I append a number to the door ID, starting at 0 and counting up, and take the MD5 hash of the result. A hash that starts with five zeros is interesting, and its sixth character is the next character of the password. Part 1 asks for the password made from the first eight interesting hashes.  

Solution

Excel has no MD5 function, so I used VBA. I didn’t write the MD5 calculation myself: I added a ready-made class module called clsMD5 (I modify this from Day 4 AoC 2015, source and credit goes there) and a small function around it:

Public Function MD5Hash(ByVal strText As String) As String
    Dim cMD5 As New clsMD5
    MD5Hash = cMD5.MD5(strText)
    Set cMD5 = Nothing
End Function

The door ID is in B3. Hashing tens of millions of numbers takes a while, so a macro does the searching and writes the interesting numbers into column C. It keeps a hash only when it is useful: one of the first eight (Part 1), or one that fills a new password position (Part 2, which I explain below). It stops when both parts are complete:

Public Sub FindHits()
    Dim ws As Worksheet, md5 As clsMD5, door As String
    Dim filled(0 To 7) As Boolean, nFilled As Long
    Dim hits As Long, rowOut As Long, i As Long
    Dim h As String, p As String, useful As Boolean

    Set ws = ActiveSheet
    Set md5 = New clsMD5
    door = ws.Range("B3").Value
    ws.Range("C5:C40").ClearContents
    rowOut = 5

    Do
        h = md5.MD5(door & i)
        If Left$(h, 5) = "00000" Then
            hits = hits + 1
            useful = (hits <= 8)                       ' needed for Part 1
            p = Mid$(h, 6, 1)
            If p >= "0" And p <= "7" Then              ' a valid position for Part 2
                If Not filled(CLng(p)) Then
                    filled(CLng(p)) = True
                    nFilled = nFilled + 1
                    useful = True
                End If
            End If
            If useful Then
                ws.Cells(rowOut, 3).Value = i
                rowOut = rowOut + 1
            End If
            If hits >= 8 And nFilled = 8 Then Exit Do
        End If
        i = i + 1
    Loop
End Sub

On the sheet, each row of the list has a few columns. B repeats the door ID and C holds the number the macro found. D joins them and hashes them, E takes the sixth character (as a number when it is a digit, which Part 2 needs) and F takes the seventh:

D5: =MD5Hash(B5&C5)
E5: =IFERROR(VALUE(MID(D5,6,1)),MID(D5,6,1))
F5: =MID(D5,7,1)

I filled these down for every row of the list (rows 5 to 15). The Part 1 password is the sixth characters of the first eight rows:

B2: =CONCAT(E5:E12)

With the puzzle’s example door ID, abc, the same steps should give 18f47a30 for Part 1.

Part 2

Description

Solution

The rule changes. The sixth character of an interesting hash is now a position in the password, from 0 to 7, and the seventh character is the letter that goes there. Hashes with an invalid position (8, 9 or a letter) are ignored, and only the first hash for each position counts.

That’s why the macro keeps some hashes after the first eight: only the ones that fill a position not yet filled matter, and they are in order in the list. For each position 0 to 7, XLOOKUP finds the first row whose sixth character equals that position and returns its seventh character. COLUMN()-8 makes the position 0 in H, 1 in I, and so on to 7 in O:

H3: =XLOOKUP(COLUMN()-8,$E$5:$E$15,$F$5:$F$15,,0)       ← fill right to O3
D2: =CONCAT(H3:O3)

For the example door ID abc, the answer is 05ace8e3.

Share:

Advent of Code 2016 - Day 4: Security Through Obscurity

Part 1

Description

Each line of the input is an encrypted room name: groups of letters separated by hyphens, then a sector ID, then a checksum in square brackets, like aaaaa-bbb-z-y-x-123[abxyz]. A room is real if its checksum is the five most common letters in the name, most common first, with ties broken alphabetically. Part 1 asks for the sum of the sector IDs of the real rooms.  

Solution

I pasted the 1,066 lines into A5:A1070. One formula per row does all the work. I used LET to give each piece a name:

C5: =LET(a,$A5,
        b,--TEXTAFTER(TEXTBEFORE(a,"["),"-",-1),
        c,TEXTAFTER(TEXTBEFORE(a,"]"),"["),
        n,TEXTBEFORE(a,"["),
        d,CHAR(SEQUENCE(26,,97)),
        e,LEN(n)-LEN(SUBSTITUTE(n,d,"")),
        f,TAKE(SORTBY(d,e,-1),5),
        N(CONCAT(f)=c)*b)
  • b is the sector ID: the text before the [, then whatever comes after the last hyphen (-- turns it into a number).
  • c is the checksum between the brackets.
  • n is the name part of the line, before the [.
  • d is the letters a to z, and e counts how many times each letter appears in the name.
  • f sorts the letters by count, largest first, and keeps the first five. Because d is already in alphabetical order and SORTBY keeps the original order for ties, ties come out alphabetically, as the puzzle wants.
  • The last line compares those five letters with the checksum, and gives the sector ID if they match and 0 if not.

B5 is the same formula but ends with (CONCAT(f)=c), so it shows TRUE or FALSE for each room. The answer is the total of column C:

B2: =SUM(C5:C1070)

The puzzle’s examples agree: aaaaa-bbb-z-y-x-123[abxyz] and not-a-real-room-404[oarel] are real, and totally-real-room-200[decoy] is not.

Part 2

Description

Solution

Now the real rooms must be decrypted. Each letter is shifted forward in the alphabet by the sector ID, wrapping from z back to a, and the hyphens become spaces. I need the sector ID of the room where the North Pole objects are stored.

The shift is the sector ID modulo 26. E5 turns the name into single letters, shifts each one, and joins them again:

E5: =LET(a,A5,
        b,SUBSTITUTE(TEXTBEFORE(a,"-",-1),"-"," "),
        c,MOD(--TEXTAFTER(TEXTBEFORE(a,"["),"-",-1),26),
        e,MID(b,SEQUENCE(LEN(b)),1),
        f,IF(c+CODE(e)>122,96+MOD(c+CODE(e),122),c+CODE(e)),
        SUBSTITUTE(CONCAT(CHAR(f)),CHAR(32+c)," "))
  • CODE(e) is the number of each letter (a is 97 and z is 122). If the shifted number goes past 122, 96+MOD(…,122) wraps it around to the start of the alphabet.
  • The spaces get shifted too, because a space is code 32, and become the character with code 32 + shift. The last line changes exactly those characters back into spaces. That works because they are symbols or digits, never letters.

The sector ID of each row is in column F:

F5: =--TEXTAFTER(TEXTBEFORE(A5,"["),"-",-1)

Then G marks the rows whose decrypted name contains “north”, and the answer is the sector ID in the first marked row:

G5: =IF(ISNUMBER(SEARCH("north",E5:E1070)),1,0)
D2: =INDEX(F5:F1070,MATCH(1,G5#,0))

Only one room matches (the “northpole object storage” one). The puzzle’s example, qzmt-zixmtkozy-ivhz-343, decrypts to “very encrypted name”, as it should.

Share:

Advent of Code 2016 - Day 3: Squares With Three Sides

Part 1

Description

Each row of the input holds three numbers, the side lengths of a triangle. A triangle is possible only if the sum of any two sides is larger than the third. Part 1 asks how many of the listed triangles are possible. 

Solution

I pasted the input into A5:C1915, one triangle per row (1,911 rows).

To test a triangle, it is enough to compare the two shorter sides with the longest one. So I first sorted the three sides in every row. SMALL(A5:C5,SEQUENCE(3)) gives the smallest, the middle and the largest side, and TOROW lays them out in a row (E5:G5):

E5: =TOROW(SMALL(A5:C5,SEQUENCE(3)))       ← fill down to row 1915

Now the triangle is possible when the first two sorted sides add up to more than the third. SUMPRODUCT counts the rows where that is true:

B2: =SUMPRODUCT(--(E5:E1915+F5:F1915>G5:G1915))

The puzzle’s example, a triangle with sides 5, 10 and 25, is correctly rejected, because 5 + 10 is not more than 25.

Part 2

Description

Solution

The numbers should have been read down the columns instead: each group of three rows in a column makes one triangle. So there are the same number of triangles, but made from different numbers.

Rows 5 to 7 of column A are the first triangle, rows 5 to 7 of column B the second and rows 5 to 7 of column C the third. In H5, I5 and J5 I test each of those three groups: the smallest number plus the second smallest must be more than the largest, and the cell shows 1 if so, otherwise 0:

H5: =IF(MIN(I5:I7)+SMALL(I5:I7,2)>MAX(I5:I7),1,0)
I5: =IF(MIN(J5:J7)+SMALL(J5:J7,2)>MAX(J5:J7),1,0)
J5: =IF(MIN(K5:K7)+SMALL(K5:K7,2)>MAX(K5:K7),1,0)

The next group is rows 8 to 10, so the next formulas are in H8, I8 and J8, and so on. I copied the block down, so there is a formula in every third row (5, 8, 11 and so on down to 1913), and the rows in between stay empty. The answer is the number of 1s:

D2: =COUNTIF(M5:O1915,1)

By the way, there is an option to use this formula to check if a triangle is valid: =IF(SUM(A5:C5)>2*MAX(A5:C5),1,0).

Share:

Recent Posts

Categories

Blog Archive