Copy

Hi friend,

Welcome to the Google Sheets Tips newsletter #184, the final one for 2021!

I'll be back on the 3rd of January 2022. (The first time you write the new year down always feels funny.)

In the meantime, I'll be spending time with my family, eating too much, and watching iconic Christmas movies.

I wish you all the very best of wishes for the holiday season and for the New Year! 🎉


➜ Announcements

I.
One for HR folks: my good friend and fellow GDE Max recently launched an add-on to automatically generate 9 Block graphics from Google Sheets data.

Check out 9 Block Maker

_______


➜ Google Sheets Tip #184: CHICKEN and EGG, which came first? The SORT function

Here is your Google Sheets tip, which you can think of as your Monday morning espresso, in spreadsheet form. To finish the year, I have a fun formula to share (although it illustrates some important concepts of course!).

Let us begin with one of the great unanswered questions of life:

Which came first: the chicken or the egg?

For millennia, humanity has wrestled with this conundrum.

Finally though, with the aid of advanced computing resources, we're able to answer it.

It was first solved using Python, but here I present a solution in Google Sheets.

This formula, entered into cell A1:


=SORT({"🥚";"🐥"},1,TRUE)

Yields the answer:



So there you have it!

The chicken came first...

How does this work?

Of course, I won't leave you hanging without an explanation.

The symbol for the chicken and the egg are emojis (text strings in the Sheet), which I grabbed from: https://emojipedia.org/

Next, I used array literals to create a column:

={"🥚";"🐥"}



And then I wrapped this with the SORT function, which sorts these alphabetically:

=SORT({"🥚";"🐥"},1,TRUE)



And there you have it!

(For the purists, you can also use the CHAR formula to create the chicken and the egg emojis:

=SORT({CHAR(129370);CHAR(128037)},1,TRUE)

It's a good formula because it uses functions and not emojis, but it's also a bad formula because you have no idea that the egg is shown first.)

_______


If you enjoyed this newsletter, please forward it to a friend who might enjoy it.

Have a great week!

Cheers,
Ben


P.S. Shout out to a legendary mom...



Thanks for reading!

Who am I? I'm Ben Collins, writer, teacher and, Google Developer Expert. I teach a series of popular Google Sheets and Apps Script courses and lead a team of expert consultants who you can hire to help with your next project.

1) Click here to unsubscribe if you don't want to receive these emails anymore.

2) Click here to subscribe if you've been forwarded this email by a friend or colleague and want to subscribe yourself.

3) Click here to update your email address.

Office address: Collins Analytics LLC PO Box 275 Harpers Ferry, WV 25425 USA