The first Coda puzzle set.

Laura Tsunoda
Coda Blog
Published in
3 min readFeb 1, 2018

We love puzzles at Coda. Not only are they our preferred procrastination method, they also get at an important product tenant of ours: Encourage play. Our favorite moment — and the thing we try to engender in our product design — is when work and play converge. When concentration slips into a creative groove while building out a doc, and you build something you didn’t expect.

To that end, we started a Coda Puzzle team, devoted to coming up with wily, often-unnecessary formulas and hacks with which to challenge our coworkers. Last week we thought, why not open this up to everyone, and emailed our users two puzzles.

Big thank you for everyone who participated in the inaugural Coda puzzle set. You discovered formulas we hadn’t thought about for years.

Here are the solutions.

Puzzle #1: The Emoji Slider

We love emoji sliders at Coda. They bring an emotional precision and nuance to our workplace communication. You can find them in virtually all of our internal project tracking docs, and the majority of the rest. An obvious choice for a bite-sized puzzle:

The most common solution is with Switch():

Switch(Slider, 5,"😎😎😎😎😎",4,"🙂🙂🙂🙂",3,"😐😐😐",2,"😣😣",1,"😱")

Similarly, you can use SwitchIf():

SwitchIf(Slider=5,"😎😎😎😎😎",Slider=4,"🙂🙂🙂🙂",Slider=3,"😐😐😐",Slider=2,"😣😣",Slider=1,"😱")

If you missed Switch and SwitchIF (or if you’re just sadistically addicted to matching parentheses), you can also solve this by nesting lots of If() statements, like so:

If(Slider=5,"😎😎😎😎😎", IF(Slider=4,"🙂🙂🙂🙂", IF(Slider=3,"😐😐😐", IF(Slider=2,"😣😣", IF(Slider=1,"😱", "")))))

A fair number of you used the Repeat() function (which honestly, I forgot that we had):

Switch(Slider, 5,Repeat("😎", Slider), 4, Repeat("🙂", Slider), 3, Repeat("😐", Slider), 2, Repeat("😣", Slider), 1, Repeat("😱", Slider))

Some people wanted to look up the emojis, and we saw a couple patterns for that. One group used List() like this:

List("😎", "🙂", "😐", "😣", "😱").Nth(Slider).Repeat(Slider)

And the other group created a table of emojis, and used the Lookup() formula. Very elegant:

EmojiTable.Lookup(Value, Slider)

Btw, one puzzler had a particularly genius use-case for this. He made a team morale gauge — where each team member can qualify their feelings from yucky (💩) to ecstatic (🏄‍).

Puzzle #2: The Blinking Table

This puzzle required making a table “blink,” which was really an advanced conditional formatting exercise. TLDR: Those of you that found Now() and RowId() generally sailed through (and somewhat annoyingly to those of us who were stumped, sent us messages asking for harder puzzles next time).

Most people started by figuring out how Coda thinks about time and found the Now() function. One secret tip (hidden in plain sight) was that our formula autocomplete will get you here:

Now().Second().IsOdd()

For folks who didn’t trust or find our autocomplete, we saw a lot of variations of Remainder(), Floor(), DateTimeTruncate(), and even a few people who discovered that we support X % Y as mod — but they all give a similar result.

The next step was figuring out how to color the table. Though there are multiple ways to do this (hiding data in cells was common), the most elegant way is to use our RowId() function which returns a unique ID for each row. Then the conditional format rule could be as simple as:

thisRow.RowId().IsOdd()

Putting that all together, generally led to 3 conditional formats:

Now().second().IsOdd()  AND thisRow.RowID().IsOdd() → Set color to BlueNow().second().IsEven() AND thisRow.RowID().IsEven() → Set color to Red[🕵].IsNotBlank() → Set color to white

Lots of 👏👏👏 to Trenton Broughton for his soon-to-be-patent-pending “Blinkmoji” slider, where the slider not only sets the emojis but also *controls the blinking rate* of the colors (notice the different blink frequencies?).

With Trenton’s permission, here’s the secret for how he did it:

(Floor(Second(Now()) / (6-[Emoji Slider!!]))+thisRow.RowId())%2

What’s next?

The Puzzle Team has some questions for you. How often do you want these puzzles? Should we do two bite-sized puzzles like this time, or one big, slow puzzle, perhaps will multiple components? Comment below or email us at puzzles@coda.io.

To puzzlers still stuck on the waitlist: Don’t tell the bouncers, but if you think you can crack next month’s puzzle, email me directly (laura@coda.io). I’ll sneak you in the back door. Who knows to what unlawful lengths I’ll go in the name of puzzles.

--

--