<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Marie Mosley</title>
    <description>The latest articles on DEV Community by Marie Mosley (@mmosley).</description>
    <link>https://dev.to/mmosley</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F44682%2F8e5a0cf9-8891-4f6e-847b-35bc4a9e66ec.jpg</url>
      <title>DEV Community: Marie Mosley</title>
      <link>https://dev.to/mmosley</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mmosley"/>
    <language>en</language>
    <item>
      <title>Sending questions to the future</title>
      <dc:creator>Marie Mosley</dc:creator>
      <pubDate>Mon, 07 Sep 2020 06:22:09 +0000</pubDate>
      <link>https://dev.to/mmosley/sending-questions-to-the-future-3596</link>
      <guid>https://dev.to/mmosley/sending-questions-to-the-future-3596</guid>
      <description>&lt;p&gt;2020 is my year of personal computing. &lt;/p&gt;

&lt;p&gt;When I think “I wish there was an app for...”, I build myself that app with low/no-code tools. Now I have a bunch of nice single-purpose apps on my phone, custom-built for one user: me. &lt;/p&gt;

&lt;p&gt;Most of the tools I use for this are built into the apps I already use every day.  When I want to stitch apps together, Zapier fills the gap-iers.&lt;/p&gt;

&lt;p&gt;I called my newest personal app “Ask Future Me”. It lets me write a journal prompt and send it to myself in the future, and it gives me a place to record my answer. &lt;/p&gt;

&lt;p&gt;It’s a little act of belief in an interesting future, built with some of the magic of the contemporary computing age. &lt;/p&gt;

&lt;p&gt;It uses Google Apps (Forms, Sheets, and Calendar) and one Zapier zap. &lt;/p&gt;

&lt;h3&gt;
  
  
  What it Does
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Records a question I want to answer in a future journal entry, plus the date and time when I want to answer it&lt;/li&gt;
&lt;li&gt;Sends me a push notification prompting me to answer the question on that date and time&lt;/li&gt;
&lt;li&gt;The push notification includes a link to a form that is pre-filled with:

&lt;ul&gt;
&lt;li&gt;the question&lt;/li&gt;
&lt;li&gt; the date it was originally asked&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;On that form,  I can:

&lt;ul&gt;
&lt;li&gt;Enter my answer&lt;/li&gt;
&lt;li&gt;Check a box to indicate that I have a longer answer to the prompt in my handwritten journal&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How it was Built, Step by Step
&lt;/h3&gt;

&lt;p&gt;I’m going to take you through the steps to create it in what I feel is the most efficient order. &lt;/p&gt;

&lt;p&gt;It’s not the same order I took when I was building the app! I went through all the usual struggles of trying to tell a computer what to do. I’ll spare you that drama and just show you what worked. &lt;/p&gt;

&lt;h4&gt;
  
  
  ⚠️ Before You Start ⚠️
&lt;/h4&gt;

&lt;p&gt;This tutorial assumes you're already comfortable with Google Forms, Google Sheets, and Zapier. I won't go into detail on how to use the basic features of those apps. &lt;/p&gt;

&lt;p&gt;I'll use the &lt;code&gt;QUERY&lt;/code&gt;, &lt;code&gt;SPLIT&lt;/code&gt; and &lt;code&gt;JOIN&lt;/code&gt; functions in Google Sheets. You don't need to know how these specific functions work, but you should be comfortable with creating and editing formulas in Google Sheets. &lt;/p&gt;

&lt;h3&gt;
  
  
  Step One: Taking Questions
&lt;/h3&gt;

&lt;p&gt;The first step is creating a Google Form to record questions for the future. &lt;/p&gt;

&lt;p&gt;The form takes in a question, a date, and a time of day. &lt;/p&gt;

&lt;p&gt;If you could use a refresher on how to set up a form, check out Google's &lt;a href="https://support.google.com/a/users/answer/9302965?hl=en"&gt;documentation for forms&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2p0LcR9q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/8tvlkgkukx7gh1ss08j2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2p0LcR9q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/8tvlkgkukx7gh1ss08j2.png" alt="A Google Form titled 'Ask Future Me'. The questions are 'What should I ask myself' and 'When should I ask that'"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This form automatically creates a new Sheet in Google Sheets that records form entries and a &lt;code&gt;Timestamp&lt;/code&gt; column. This sheet is where things start to get interesting. &lt;/p&gt;

&lt;h4&gt;
  
  
  Step Two: Create a Formula-Ready Copy of the Questions Sheet
&lt;/h4&gt;

&lt;p&gt;I’ll show you why I need to use formulas in step three, but for now let's get the sheet data ready to work with formulas. &lt;/p&gt;

&lt;p&gt;Each Google Forms response creates a new row in the Sheet that records the responses. Which, unfortunately, means you can’t put formulas directly onto the responses Sheet. If you do, they’ll be erased by the responses as they’re added to the sheet.  &lt;/p&gt;

&lt;p&gt;To work around this, I create a second Sheet tab on the Sheet with the form responses.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ysHjRsgO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/yo7wnyk43hqdkowgmk7p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ysHjRsgO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/yo7wnyk43hqdkowgmk7p.png" alt="Two Google Sheets tabs. The first is labeled 'Questions', the second is labeled 'Formula Sheet'"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I name the form entries tab "Questions" and the second sheet "Formula Sheet". &lt;/p&gt;

&lt;p&gt;On "Formula Sheet", I use a &lt;a href="https://support.google.com/docs/answer/3093343?hl=en"&gt;QUERY&lt;/a&gt;   function to copy over all of the the content from the first three columns of "Questions" into "Formula Sheet". &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9JI115AL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/e78e8mdb7ud327cg1pq0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9JI115AL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/e78e8mdb7ud327cg1pq0.png" alt="'Formula Sheet' populated with a query function"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I like to use &lt;a href="https://support.google.com/docs/answer/63175?co=GENIE.Platform%3DDesktop&amp;amp;hl=en"&gt;named ranges&lt;/a&gt; in &lt;code&gt;QUERY&lt;/code&gt; formulas. In this example I named the columns on the Questions sheet "Questions", but you can use a different named range or the column + cell ranges. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;At this point, the difference between the two Sheets is subtle, but important&lt;/strong&gt;. On the "Questions" Sheet, every entry takes up a full row. On “Formula Sheet”, every entry is confined to its column, leaving space for formulas in the other columns. &lt;/p&gt;

&lt;h4&gt;
  
  
  Step Three: Format the Question and Asked-On Date for URL Parameters
&lt;/h4&gt;

&lt;p&gt;Google Forms lets you &lt;a href="https://support.google.com/docs/answer/2839588?hl=en"&gt;prefill fields using URL parameters&lt;/a&gt;. This means I can build a link that will automatically fill some of the form fields on the "Answers" form with data from the "Questions" form. I will add this link to the Google Calendar event so it will send me straight to the prefilled answer form. &lt;/p&gt;

&lt;p&gt;To make that work, the question and date from the Questions form needs to be in a URL-friendly format. &lt;/p&gt;

&lt;p&gt;Google Forms’ prefill format takes dates in YYYY-MM-DD format, and text with a plus sign (+) in place of spaces. &lt;/p&gt;

&lt;p&gt;So this date in the &lt;code&gt;Timestamp&lt;/code&gt; column: 09/12/2020 &lt;br&gt;
Needs to be converted to: &lt;code&gt;2020-09-12&lt;/code&gt;&lt;br&gt;
And this question: Which basil plant turned out better?&lt;br&gt;
Needs to be converted to &lt;code&gt;Which+basil+plant+turned+out+better?&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I convert the &lt;code&gt;Timestamp&lt;/code&gt; column to the YYYY-MM-DD format with Google Sheet’s built-in formatting tools. &lt;/p&gt;

&lt;p&gt;YYYY-MM-DD is under &lt;code&gt;Format &amp;gt; Number &amp;gt; More Formats &amp;gt; More date and time formats&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;Removing the spaces in the question and replacing them with plus signs calls for a formula using &lt;code&gt;SPLIT&lt;/code&gt; and &lt;code&gt;JOIN&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;I create a new column on the Formula Sheet called “Concatenated Question” and enter this formula (sending it down the full column):&lt;/p&gt;

&lt;p&gt;&lt;code&gt;=IFERROR(JOIN(“+”,SPLIT(B2,” “)),””)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This &lt;code&gt;SPLIT&lt;/code&gt;s the question into individual words, then &lt;code&gt;JOIN&lt;/code&gt;s them back together with plus signs in place of the spaces. &lt;/p&gt;

&lt;p&gt;I went into more depth on how these two functions can work together in &lt;a href="https://dev.to/mmosley/alphabetize-a-comma-separated-list-in-google-sheets-1oe1"&gt;this post about manipulating text in a spreadsheet cell&lt;/a&gt; if you’re interested in learning more about how this works. &lt;/p&gt;

&lt;p&gt;I wrapped the split &amp;amp; join in an &lt;code&gt;IFERROR&lt;/code&gt; function that sets the cell to blank if the split &amp;amp; join errors out. This prevents the sheet from filling up with a bunch of false-alarm errors when the B column is blank. It will be blank until there’s a new question on the sheet; that’s expected. &lt;/p&gt;

&lt;p&gt;Here's what the Formula Sheet looks like once the date formatting and the split &amp;amp; join are done. Notice that the &lt;code&gt;Timestamp&lt;/code&gt; date is in YYYY-MM-DD format, and the &lt;code&gt;Concatenated Question&lt;/code&gt; field has a copy of the question with plus signs in place of the original spaces. &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oY10WHgf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/l3lf7m7yb6lrpcxauh2p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oY10WHgf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/l3lf7m7yb6lrpcxauh2p.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step Four: Build the Answer Form
&lt;/h3&gt;

&lt;p&gt;Now I need a form to accept the answers. I create a second Google Form with fields for:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The original question &lt;/li&gt;
&lt;li&gt;The date when I asked the question &lt;/li&gt;
&lt;li&gt;My answer to the question&lt;/li&gt;
&lt;li&gt;A checkbox to indicate if there is a paper journal entry that corresponds to this question &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zIkGL4zL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/d6057ga5zi8nv1k4f6ou.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zIkGL4zL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/d6057ga5zi8nv1k4f6ou.png" alt="A Google Form that records the questions listed above."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that this form is created, I can use it to generate a prefillable URL that I can modify for use in the Zapier zap. &lt;/p&gt;

&lt;h4&gt;
  
  
  Step Five: Get the Prefillable URL
&lt;/h4&gt;

&lt;p&gt;Every Google Form has a “Get pre-filled link” option in the 3-dot menu up top by the “Send” button. &lt;/p&gt;

&lt;p&gt;To get a prefill link,  I enter a test answer and date on the answer form, then click the "Get Link" button. That triggers a little popup that says "Share this link to include pre-filled responses COPY LINK".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DTykHzAa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cb93psg5vc1qnxc6vjoz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DTykHzAa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cb93psg5vc1qnxc6vjoz.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Clicking "COPY LINK" gives me a URL that includes the unique IDs for each of the prefilled form fields. &lt;/p&gt;

&lt;p&gt;The URL ends with a query string that looks this: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;amp;entry.FIELDNUMBER=Example+answer&amp;amp;entry.FIELDNUMBER=2020-09-12&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Where &lt;code&gt;FIELDNUMBER&lt;/code&gt; is the unique ID number for the field to prefill. For now, I just copy and paste this URL to a scratchpad so it's handy when I need it in step eight. &lt;/p&gt;

&lt;p&gt;When I add this prefilled form link in Zapier, I’ll modify it to insert the the "Concatenated Question" from the "Formula Sheet" in the “original question” field, and the formatted &lt;code&gt;Timestamp&lt;/code&gt; for the date I asked the question in the “asked on” field. &lt;/p&gt;

&lt;h4&gt;
  
  
  Step Six: Connect Google Sheets and Google Calendar in Zapier
&lt;/h4&gt;

&lt;p&gt;With both forms built, all the data in the right format, and field IDs discovered, I can now use Zapier to link up the Forms with Google Calendar. &lt;/p&gt;

&lt;p&gt;I create a new calendar event that, on the date and time I enter on each question form, sends me the question with a link to a form to enter my answer. The link prefills the form with the question and the date the question was asked on. It's up to me to fill in the rest with my journal entry.   &lt;/p&gt;

&lt;p&gt;This is a single-task zap that can be built on the free Zapier tier. &lt;/p&gt;

&lt;p&gt;The first step is to connect Google Sheets with Google Calendar. Set "When this happens..." to "New Spreadsheet Row in Google Sheets", and "Do this..." to "Create Detailed Event in Google Calendar". &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--K4v9Al4L--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/7wy1tujvzhhrvrmhbcz3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--K4v9Al4L--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/7wy1tujvzhhrvrmhbcz3.png" alt="Google Sheets connected to Google Calendar in Zapier"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, there are some configuration steps to get the zap up and running. &lt;/p&gt;

&lt;p&gt;Here’s a quick walkthrough of configuring the zap.&lt;/p&gt;

&lt;h4&gt;
  
  
  Step Seven: Configure Google Sheets in the Zap
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;On the “Choose App &amp;amp; Event” step, select “Google Sheets” and “New Spreadsheet Row”&lt;/li&gt;
&lt;li&gt;For “Choose Account”, choose the Google account that has your Forms. &lt;/li&gt;
&lt;li&gt;For “Customize Spreadsheet”, choose “Ask Future Me” (or whatever you named your questions form) as the Spreadsheet, and “Formula Sheet” as the Worksheet. &lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Step Eight: Configure the Calendar Event in the Zap
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;On the “Choose App &amp;amp; Event” step, select “Google Calendar” and “Create Detailed Event”. &lt;/li&gt;
&lt;li&gt;For “Choose Account”, choose the Google account that owns the Calendar you want to use for your reminders.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;“Customize Detailed Event” is where we finally get to use those query parameters. &lt;/p&gt;

&lt;p&gt;Choose the “Calendar” where you want to add the question. In the “Summary” field, I put “A question from past me”. This appears as the title of the event on the calendar and in push notifications. &lt;/p&gt;

&lt;p&gt;Then, put your cursor in the Description field and select “Insert Data”. I inserted the question (from the Formula Sheet form column labeled “What should I ask myself?”) and the prefill URL to the answers form, including the query parameters. &lt;/p&gt;

&lt;p&gt;After the equals sign (=) that follows each form field ID number, I insert data from the related field on the Formula Sheet. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--soC7WhnD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/19qcapidrwvje1jts3c6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--soC7WhnD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/19qcapidrwvje1jts3c6.png" alt="A screenshot of an edited URL which includes query parameters to prefill the form"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here I've inserted the contents of the "Concatenated Question" after the equals sign following the field ID for "The original question" field on the answer form, and the contents of the &lt;code&gt;Timestamp&lt;/code&gt; field after the equals sign following the field ID for the "Asked On" field. &lt;/p&gt;

&lt;p&gt;I've crossed out the form ID and field IDs from my own URL here because they're unique to every form. Yours will be different. The form ID is a very long alphanumeric string, and the field IDs are short numeric strings.&lt;/p&gt;

&lt;p&gt;Now the zap is ready. Questions can be sent to the future 🚀&lt;/p&gt;

&lt;h3&gt;
  
  
  The Finishing Touch: Making the Questions Form Look Like an App on an iPhone
&lt;/h3&gt;

&lt;p&gt;I can enter my questions for the future in any browser, but I like having a button I can push on my phone to open it up, app-like. &lt;/p&gt;

&lt;p&gt;A Google Form is a webpage, and just like any webpage I can pin it to my home screen on my iPhone. &lt;/p&gt;

&lt;p&gt;To do that, I airdropped the link to the form from my desktop computer to my iPhone and opened it up in Safari. From the “Share” menu, I selected “Add to Home Screen”. This gives me an app-style icon for the form so I can open it up in one click from my phone. &lt;/p&gt;

&lt;p&gt;Here it is hanging out with the other journaling apps I use on my phone. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OT3MicRQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/jnassvt5foktr7af4ktq.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OT3MicRQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/jnassvt5foktr7af4ktq.jpeg" alt="An app icon labeled 'Ask Future Me' in a 'Journaling' folder on an iPhone"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's the works! Happy personal computing 👩🏼‍💻&lt;/p&gt;

</description>
      <category>lowcode</category>
      <category>nocode</category>
      <category>spreadsheets</category>
      <category>zapier</category>
    </item>
    <item>
      <title>Alphabetize a Comma-Separated List in Google Sheets</title>
      <dc:creator>Marie Mosley</dc:creator>
      <pubDate>Mon, 20 Jan 2020 21:31:06 +0000</pubDate>
      <link>https://dev.to/mmosley/alphabetize-a-comma-separated-list-in-google-sheets-1oe1</link>
      <guid>https://dev.to/mmosley/alphabetize-a-comma-separated-list-in-google-sheets-1oe1</guid>
      <description>&lt;p&gt;I subscribe to Ben Collins' "&lt;a href="https://www.benlcollins.com/google-sheets-tips/" rel="noopener noreferrer"&gt;Google Sheets Tips&lt;/a&gt;" newsletter, and I learn so much from it! &lt;/p&gt;

&lt;p&gt;This week's newsletter included a challenge: alphabetize a comma-separated list of words with a single formula. &lt;/p&gt;

&lt;p&gt;As in, go from this in cell A2: Epsilon,Alpha,Gamma,Delta,Beta&lt;br&gt;
To this in cell B2: Alpha,Beta,Delta,Epsilon,Gamma&lt;/p&gt;

&lt;p&gt;Ben dropped a hint that the &lt;a href="https://support.google.com/docs/answer/3094262?hl=en" rel="noopener noreferrer"&gt;&lt;code&gt;TRANSPOSE&lt;/code&gt;&lt;/a&gt; function would help solve the challenge.&lt;/p&gt;

&lt;p&gt;Up to now, I've only used &lt;code&gt;TRANSPOSE&lt;/code&gt; for one thing: filling a column with the contents of a row, or vice-versa, usually when referencing data from one sheet on another. So, I was a little puzzled about how it would help alphabetize values in a single cell — and how that could work in a one-liner 🤔&lt;/p&gt;

&lt;p&gt;I took some time to pick apart the challenge and I was able to crack it in four steps with the help of &lt;code&gt;TRANSPOSE&lt;/code&gt; and three other functions. &lt;/p&gt;

&lt;p&gt;You can &lt;a href="https://docs.google.com/spreadsheets/d/1-bM_DVXrMv0_O_fAe5DVU_yRQnUNCAK9E7RRK1Q4K0k/edit?usp=sharing" rel="noopener noreferrer"&gt;see the formula broken down in Google Sheets&lt;/a&gt;. Each part of the formula has its own sheet in there so you can see how this works step-by-step.  &lt;/p&gt;

&lt;h3&gt;
  
  
  Step One: &lt;code&gt;SPLIT&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;When I see a cell with comma-separated values in it, I know I'm probably gonna have to do a &lt;code&gt;SPLIT&lt;/code&gt; 🍌&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://support.google.com/docs/answer/3094136?hl=en" rel="noopener noreferrer"&gt;&lt;code&gt;SPLIT&lt;/code&gt;&lt;/a&gt; function breaks text in a cell into pieces based on a &lt;a href="https://en.wikipedia.org/wiki/Delimiter" rel="noopener noreferrer"&gt;delimiter&lt;/a&gt; character, and puts each piece of the text into a separate cell in the same row. &lt;/p&gt;

&lt;p&gt;In this case, the text in the cell is a series of comma-separated words, so the delimiter character is the comma. &lt;/p&gt;

&lt;p&gt;I split the text in the cell into individual words with this function:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;=SPLIT(A1,",")&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F2v24tdl4q9nog1z409sm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F2v24tdl4q9nog1z409sm.png" alt="a spreadsheet with a split formula splitting 5 words into separate cells inside a row."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ok, cool, that breaks the comma-separated string into individual words. But how do I sort them into alphabetical order? &lt;/p&gt;

&lt;p&gt;Ideally I'd use &lt;code&gt;SORT&lt;/code&gt;, which can alphabetically sort words in a column. &lt;/p&gt;

&lt;p&gt;But...these words aren't in a column. They're in a row.&lt;/p&gt;

&lt;p&gt;Ah ha!💡This is where &lt;code&gt;TRANSPOSE&lt;/code&gt; pitches in to help.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step Two: &lt;code&gt;TRANSPOSE&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;After the &lt;code&gt;SPLIT&lt;/code&gt; I have all my words in their own cells across the row. But since I would like to &lt;code&gt;SORT&lt;/code&gt; them, they should really be in a column. Remember how &lt;code&gt;TRANSPOSE&lt;/code&gt; can turn a row into a column?  &lt;/p&gt;

&lt;p&gt;By wrapping the &lt;code&gt;SPLIT&lt;/code&gt; function that broke the string into words in a &lt;code&gt;TRANSPOSE&lt;/code&gt; function, the split-up words are arranged as a column. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;=TRANSPOSE(SPLIT(A1,","))&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fwuovwsbec2i5b8tng7hx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fwuovwsbec2i5b8tng7hx.png" alt="a spreadsheet with a transpose function, which displays the result of a split function in a column instead of its default row format."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's a column that I can now &lt;code&gt;SORT&lt;/code&gt;!&lt;/p&gt;

&lt;h3&gt;
  
  
  Step Three: &lt;code&gt;SORT&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://support.google.com/docs/answer/3093150?hl=en" rel="noopener noreferrer"&gt;&lt;code&gt;SORT&lt;/code&gt;&lt;/a&gt; can do a lot more than just alphabetize, but that's all I need it for today. &lt;/p&gt;

&lt;p&gt;When I wrap the split &amp;amp; transposed words in a &lt;code&gt;SORT&lt;/code&gt; function, they are alphabetically sorted.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;=SORT(TRANSPOSE(SPLIT(A1,",")))&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fkw5lp7jsch34cdzciv53.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fkw5lp7jsch34cdzciv53.png" alt="a spreadsheet formula with a sort function alphabetizing a list."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The hard part is done! But they're still in a column, and the challenge was to return it all in one cell. So there's just one more thing left to do. &lt;code&gt;JOIN&lt;/code&gt; the words back together. &lt;/p&gt;

&lt;h3&gt;
  
  
  Step Four: &lt;code&gt;JOIN&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://support.google.com/docs/answer/3094077?hl=en" rel="noopener noreferrer"&gt;&lt;code&gt;JOIN&lt;/code&gt;&lt;/a&gt; is like the opposite of &lt;code&gt;SPLIT&lt;/code&gt;. Instead of breaking a string up at a delimiter, it creates a string from values (aka, &lt;a href="https://en.wikipedia.org/wiki/Concatenation" rel="noopener noreferrer"&gt;concatenates&lt;/a&gt; the values) with a delimiter. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;=JOIN(",",SORT(TRANSPOSE(SPLIT(A1,","))))&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fe7xuw8cof51q6yp9i1ie.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fe7xuw8cof51q6yp9i1ie.png" alt="a spreadsheet formula with a join function concatenating an alphabetized list."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That brings the split, transposed, and sorted list of values together into a single, comma-separated list — all in one cell 😁&lt;/p&gt;

&lt;p&gt;Thanks to &lt;a href="https://twitter.com/benlcollins" rel="noopener noreferrer"&gt;Ben Collins&lt;/a&gt; for the challenge, I'm looking forward to the next one!&lt;/p&gt;

</description>
      <category>spreadsheets</category>
      <category>googlesheets</category>
    </item>
    <item>
      <title>Hitting the SWITCH in Spreadsheets</title>
      <dc:creator>Marie Mosley</dc:creator>
      <pubDate>Wed, 04 Dec 2019 21:07:04 +0000</pubDate>
      <link>https://dev.to/mmosley/hitting-the-switch-in-spreadsheets-57n0</link>
      <guid>https://dev.to/mmosley/hitting-the-switch-in-spreadsheets-57n0</guid>
      <description>&lt;p&gt;The &lt;code&gt;SWITCH&lt;/code&gt; spreadsheet function is a concise way to write what could otherwise be a convoluted &lt;code&gt;IF&lt;/code&gt;/&lt;code&gt;OR&lt;/code&gt; function. I'll show you two possible uses for &lt;code&gt;SWITCH&lt;/code&gt; in this post. I know you will find many more uses on your own once you know it 😁&lt;/p&gt;

&lt;p&gt;You can follow along with the examples in this post in my &lt;a href="https://docs.google.com/spreadsheets/d/1FnwYVgczrCM0qKEmi-p3CEbf23P02SLZBCvYPyIknpA/edit?usp=sharing" rel="noopener noreferrer"&gt;SWITCH function demo in Google Sheets&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  A SWITCH Example
&lt;/h3&gt;

&lt;p&gt;Let’s say you’re running a fitness center with a daily yoga class. There are 3 yoga instructors. They work on this schedule: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tom teaches on Saturday, Sunday, and Thursday&lt;/li&gt;
&lt;li&gt;Alexis teaches on Monday and Friday&lt;/li&gt;
&lt;li&gt;Marianne teaches on Tuesday and Wednesday&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;How would you automatically show which teacher is teaching the class based on the day of the week in a spreadsheet column?&lt;/p&gt;

&lt;p&gt;You could do this with nested &lt;code&gt;IF&lt;/code&gt;s, and maybe some &lt;code&gt;OR&lt;/code&gt;s, but that’s complicated and messy, especially if you ever need to update the schedule!&lt;/p&gt;

&lt;p&gt;This is where the &lt;code&gt;SWITCH&lt;/code&gt; function shines. You can write the whole thing inside one set of parentheses, no nesting required. &lt;/p&gt;

&lt;p&gt;Here’s how you could write a &lt;code&gt;SWITCH&lt;/code&gt; function to automatically show the right instructor for each day of the week: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;=SWITCH([cell],"Saturday", "Tom", "Sunday", "Tom", "Monday", "Alexis", "Tuesday", "Marianne", "Wednesday", "Marianne", "Thursday", "Tom", "Friday", "Alexis")&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Replace [cell] with the first cell in the column that contains the values you want to switch. In this screenshot I'm staring with C2. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fdfyfd33cn7hjz68cle9e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fdfyfd33cn7hjz68cle9e.png" alt="SWITCH function inside a Google Sheet"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I wrote the function in day of the week order, but that’s not required.  What matters is that the possible value from the selected column &lt;em&gt;goes first&lt;/em&gt;, followed by what you want to show as the result for that value. &lt;/p&gt;

&lt;p&gt;So in this case, "Saturday", which would be in the day of the week column, is followed by "Tom" because I want to show "Tom" in the formula column anytime "Saturday" shows up in the days of the week column.&lt;/p&gt;

&lt;p&gt;I couldn't do "Tom" followed by "Saturday" because "Tom" wouldn't be in the days of the week column — or at least, he shouldn't! If this &lt;code&gt;SWITCH&lt;/code&gt; found a "Tom" in the days of the week column it would throw an error. &lt;/p&gt;

&lt;h3&gt;
  
  
  SWITCH Benefits
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;SWITCH&lt;/code&gt; can save you from having to make a complicated series of nested &lt;code&gt;IF&lt;/code&gt;s when you have a finite list of possible combinations. &lt;/li&gt;
&lt;li&gt;It’s case-insensitive on the value, so you don’t have to worry if the stuff in the value column isn’t all in the same case (in fact, that's a good job for a &lt;code&gt;SWITCH&lt;/code&gt;! You can use it to standardize capitalization in a new column when the text in the value column is in mixed case 😉).&lt;/li&gt;
&lt;li&gt;You can create a “default” value for when you don’t have a match for a value. That's useful for spotting missing data or other unaccounted-for situations in your sheet. I'll show you how to do that in the next example.&lt;/li&gt;
&lt;li&gt;You can use it in Excel, Google Sheets, and Airtable.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  SWITCH Limitations
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;SWITCH&lt;/code&gt; can't do comparisons like greater than/less than on its own.&lt;/li&gt;
&lt;li&gt;It can’t do “fuzzy” matches. Exact spelling matters!&lt;/li&gt;
&lt;li&gt;It’s not available in Numbers for Mac (a huge bummer for me, personally).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Another Example: SWITCH with a Default Value
&lt;/h3&gt;

&lt;p&gt;Let’s say you’re on a product team where tickets with a specific tag always get assigned to one person. I’m using my 7-person team at &lt;a href="https://codepen.io" rel="noopener noreferrer"&gt;CodePen&lt;/a&gt; in this example. &lt;/p&gt;

&lt;p&gt;In this demo we have 10 different possible ticket tags:&lt;/p&gt;

&lt;p&gt;Payment, Documentation, Design, Redux, DB, React, CSS, AWS, jQuery, GraphQL, Ruby&lt;/p&gt;

&lt;p&gt;And 7 different possible ticket owners:&lt;br&gt;
Tim, Alex, Chris, Marie (&lt;a href="https://twitter.com/mmosley" rel="noopener noreferrer"&gt;that’s me!&lt;/a&gt;), Rach, Klare, Stephen&lt;/p&gt;

&lt;p&gt;Tim handles: AWS and DB &lt;br&gt;
Alex handles: Payment &lt;br&gt;
Chris handles: CSS and jQuery &lt;br&gt;
Marie handles: Documentation &lt;br&gt;
Rach handles: GraphQL and Redux &lt;br&gt;
Klare handles: Design &lt;br&gt;
Stephen handles: React &lt;/p&gt;

&lt;p&gt;Nobody has been assigned to handle Ruby or DNS tickets yet (and &lt;code&gt;SWITCH&lt;/code&gt; is going to let us know that!)&lt;/p&gt;

&lt;p&gt;Notice that some people have more than one ticket type that should be assigned to them. &lt;/p&gt;

&lt;p&gt;The &lt;code&gt;SWITCH&lt;/code&gt; would go like this: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;=SWITCH([cell],"AWS", “Tim","DB","Tim","Payment","Alex","CSS","Chris","jQuery","Chris","Documentation","Marie","Redux", “Rach", “GraphQL","Rach","Design","Klare","React","Stephen","UNASSIGNED")&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Again, be sure to use the actual cell reference in your formula. In this screenshot I'm starting with G2. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fu0rtevxmtpeojr03vb24.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fu0rtevxmtpeojr03vb24.png" alt="A SWITCH function with an optional unassigned value"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That last value, &lt;code&gt;UNASSIGNED&lt;/code&gt;, is the optional default value. It’s displayed when the function encounters a tag that doesn’t have a match in the switch list. That tells us we need to figure out who will take ownership of those tickets. When we decide who that will be, we can edit the function to include the new name. &lt;/p&gt;

&lt;h3&gt;
  
  
  Documentation
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://support.google.com/docs/answer/7013690?hl=en" rel="noopener noreferrer"&gt;Google Sheets documentation for SWITCH&lt;/a&gt;&lt;br&gt;
&lt;a href="https://support.office.com/en-us/article/switch-function-47ab33c0-28ce-4530-8a45-d532ec4aa25e" rel="noopener noreferrer"&gt;Excel documentation for SWITCH&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ok you’re all set, go flip a &lt;code&gt;SWITCH&lt;/code&gt;! 💡&lt;/p&gt;

</description>
      <category>spreadsheets</category>
    </item>
    <item>
      <title>Recreating Excel’s ISNUMBER in a Numbers Spreadsheet</title>
      <dc:creator>Marie Mosley</dc:creator>
      <pubDate>Sun, 02 Jun 2019 17:45:13 +0000</pubDate>
      <link>https://dev.to/mmosley/recreating-excel-s-isnumber-in-a-numbers-spreadsheet-237i</link>
      <guid>https://dev.to/mmosley/recreating-excel-s-isnumber-in-a-numbers-spreadsheet-237i</guid>
      <description>&lt;p&gt;The other day I had to go through a bunch of strings in a .csv file and find which ones ended with two digits.&lt;/p&gt;

&lt;p&gt;They were all short strings created from a limited character set that included all the letters of the English alphabet, numbers 0-9, dashes, and underscores. Like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Rolf01&lt;/li&gt;
&lt;li&gt;layout_final_final_final&lt;/li&gt;
&lt;li&gt;menu-v2&lt;/li&gt;
&lt;li&gt;Sally06&lt;/li&gt;
&lt;li&gt;Marius48&lt;/li&gt;
&lt;li&gt;header_large_v2&lt;/li&gt;
&lt;li&gt;michelle-78&lt;/li&gt;
&lt;li&gt;Heather78&lt;/li&gt;
&lt;li&gt;group-in-august&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I opened the file in Numbers for Mac, fully planning to use &lt;code&gt;ISNUMBER&lt;/code&gt; to find if the last two characters of each string were numbers. Excel and Google Sheets both have that function. But as it turns out, Numbers doesn't 😬&lt;/p&gt;

&lt;h3&gt;
  
  
  The Formula and the Filter
&lt;/h3&gt;

&lt;p&gt;After a little digging in the &lt;a href="https://www.apple.com/mac/numbers/compatibility/functions.html"&gt;Numbers docs&lt;/a&gt; I came up with an alternative.&lt;/p&gt;

&lt;p&gt;I put together this formula, which I added to column B.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;NOT(ISERROR(VALUE(RIGHT(A2,”2”))))&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cbt7mKGS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/edmstwcgwl7q011jramw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cbt7mKGS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/edmstwcgwl7q011jramw.png" alt="Numbers sheet with the function shown in the function editor."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This printed &lt;code&gt;TRUE&lt;/code&gt; in the cell if the last two characters were numbers, or &lt;code&gt;FALSE&lt;/code&gt;  if the last two characters were not numbers. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6ovOT6HO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/kk3uo3o0fzvgb9a1lhun.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6ovOT6HO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/kk3uo3o0fzvgb9a1lhun.png" alt="Numbers sheet showing TRUE when column A strings end in two digits, or FALSE when they do not."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, using Numbers’ “Organize” feature, I filtered the sheet by Column B, where the &lt;code&gt;text is not&lt;/code&gt; "FALSE". &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4Wy6nUYx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ah0k6kw6fc0hxuvifref.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4Wy6nUYx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ah0k6kw6fc0hxuvifref.png" alt="Numbers sheet organized so that only the rows with TRUE are shown."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That filtered out all of the rows where the strings in column &lt;code&gt;A&lt;/code&gt; didn’t end in two digits.&lt;/p&gt;

&lt;h3&gt;
  
  
  How the Formula Works
&lt;/h3&gt;

&lt;p&gt;This formula is a series of questions about the strings in column &lt;code&gt;A&lt;/code&gt;. The questions start in the innermost function and works outward.&lt;/p&gt;

&lt;p&gt;My first question is: what are the last 2 characters of the string in column A? As a function that’s:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;RIGHT(A2,”2”)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This function returns a new string made up of the two characters at the &lt;em&gt;right&lt;/em&gt; end of the string in cell &lt;code&gt;A2&lt;/code&gt;. That’s another way of saying the “last two” characters in a string read left to right. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TFtnftud--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/6y08e9zp2ij0ti9e2xj3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TFtnftud--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/6y08e9zp2ij0ti9e2xj3.png" alt="The last two characters of the string in column A is shown in column B."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once I had those two characters, the question I ask with the next two steps of the function is “are those two characters numbers?”&lt;/p&gt;

&lt;p&gt;&lt;code&gt;VALUE(RIGHT(A2,”2”))&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;VALUE&lt;/code&gt; returns the “number value” of a string. It’s handy for things like getting just the number from a price string that includes a currency symbol. For example, it would return &lt;code&gt;100&lt;/code&gt; from a string that read &lt;code&gt;$100&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;When the string does not have a number value—for example, because it’s a string of letters—the &lt;code&gt;VALUE&lt;/code&gt; function will throw an error. &lt;/p&gt;

&lt;p&gt;So at this point in the function, I’m using it to return the numeric value of the last 2 characters of the string in column &lt;code&gt;A&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If I stopped here, I would get numbers in the cells where the string had a number value, and errors in the cells where the strings did not have a number value.  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WXT8w8ve--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/yvqywbjwmhngm1z85l1y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WXT8w8ve--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/yvqywbjwmhngm1z85l1y.png" alt="Errors shown when the VALUE function can't find a numeric value."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That’s &lt;em&gt;technically&lt;/em&gt; enough to sort the sheet —  I could filter out all rows where column B’s value is not within the range of 0 - 99. But it's messy.&lt;/p&gt;

&lt;p&gt;To keep things tidy, I added a check for if the &lt;code&gt;VALUE&lt;/code&gt; function returned an error. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;ISERROR(VALUE(RIGHT(A2,”2”)))&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ISERROR&lt;/code&gt; returns &lt;code&gt;TRUE&lt;/code&gt; if the expression inside it returns an error, or &lt;code&gt;FALSE&lt;/code&gt; if the expression inside does not return an error. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ri4Fp0so--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/dorhtplyetta6qr909ax.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ri4Fp0so--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/dorhtplyetta6qr909ax.png" alt="using the ISERROR function on the sheet."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here, I’m asking it to check if the numeric  &lt;code&gt;VALUE&lt;/code&gt; of the two characters at the &lt;code&gt;RIGHT&lt;/code&gt; end of the string in &lt;code&gt;A2&lt;/code&gt;  returns an error. If it does, the question &lt;code&gt;ISERROR&lt;/code&gt; is answered with &lt;code&gt;TRUE&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;That answers my question about whether or not the last two characters are numbers: &lt;code&gt;TRUE&lt;/code&gt; means there was an error with getting the number value of the last two characters, so they are not numbers.  &lt;code&gt;FALSE&lt;/code&gt; means there was no problem with getting their number value, so they are numbers. &lt;/p&gt;

&lt;p&gt;And, it’s enough of an answer to organize my sheet. I could filter out the rows where this formula returned &lt;code&gt;TRUE&lt;/code&gt; .&lt;/p&gt;

&lt;p&gt;That’s a nice short formula that gave the answer I needed, but I felt that formula brevity got in the way of spreadsheet clarity here.&lt;/p&gt;

&lt;h3&gt;
  
  
  Saying Yes with TRUE
&lt;/h3&gt;

&lt;p&gt;Since the question I’m asking this sheet is “does this string end with two digits?”, Answering ”yes” by returning &lt;code&gt;TRUE&lt;/code&gt; feels better than answering “yes” with &lt;code&gt;FALSE&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;And that’s where the last piece of the formula comes in: the &lt;code&gt;NOT&lt;/code&gt; function.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;NOT(ISERROR(VALUE(RIGHT(A2,”2”))))&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Here, I’m asking the formula to say &lt;code&gt;TRUE&lt;/code&gt; when there is &lt;code&gt;NOT&lt;/code&gt; an error in the numeric &lt;code&gt;VALUE&lt;/code&gt; of the &lt;code&gt;2&lt;/code&gt; &lt;code&gt;RIGHT&lt;/code&gt;-most characters of the string in cell &lt;code&gt;A2&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This gave me &lt;code&gt;TRUE&lt;/code&gt; whenever the string ended with two digits, and &lt;code&gt;FALSE&lt;/code&gt; when it didn’t. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ErGgPSkD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/heb3uiq55upq9e3j56my.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ErGgPSkD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/heb3uiq55upq9e3j56my.png" alt="Final formula being entered into the sheet."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then when I organized the sheet to filter out all the rows where the answer was &lt;code&gt;FALSE&lt;/code&gt;, I got all the rows where the string in column &lt;code&gt;A&lt;/code&gt; ended with two digits. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MdnB6T64--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/jtgils07vrvissgm6l30.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MdnB6T64--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/jtgils07vrvissgm6l30.png" alt="Fully sorted sheet, showing only the rows where the string in column A ends with 2 digits."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;👍&lt;/p&gt;

</description>
      <category>spreadsheets</category>
      <category>csv</category>
      <category>numbers</category>
    </item>
  </channel>
</rss>
