<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"><channel><title><![CDATA[Dear Analyst]]></title><description><![CDATA[This is a podcast made by a lifelong analyst. I cover topics including Excel, data analysis, and tools for sharing data. In addition to data analysis topics, I may also cover topics related to software engineering and building applications. I also do a roundup of my favorite podcasts and episodes. <br/><br/><a href="https://alchen.substack.com?utm_medium=podcast">alchen.substack.com</a>]]></description><link>https://alchen.substack.com/podcast</link><generator>Substack</generator><lastBuildDate>Wed, 20 May 2026 06:39:19 GMT</lastBuildDate><atom:link href="https://api.substack.com/feed/podcast/23684.rss" rel="self" type="application/rss+xml"/><author><![CDATA[Al]]></author><copyright><![CDATA[Al Chen]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[alchen@substack.com]]></webMaster><itunes:new-feed-url>https://api.substack.com/feed/podcast/23684.rss</itunes:new-feed-url><itunes:author>Al</itunes:author><itunes:subtitle>A show made for analysts: data, data analysis, and software.</itunes:subtitle><itunes:type>episodic</itunes:type><itunes:owner><itunes:name>Al</itunes:name><itunes:email>alchen@substack.com</itunes:email></itunes:owner><itunes:explicit>No</itunes:explicit><itunes:category text="News"><itunes:category text="Tech News"/></itunes:category><itunes:category text="Education"><itunes:category text="How To"/></itunes:category><itunes:image href="https://substackcdn.com/feed/podcast/23684/13da39e33267149c38e4e45f5d51d974.jpg"/><item><title><![CDATA[Episode #45: Thinking long-term for structuring your dataset using U.S. public food assistance data]]></title><description><![CDATA[<p><em>This post originally appeared on the </em><a target="_blank" href="https://www.thekeycuts.com/dear-analyst-45-thinking-long-term-for-structuring-your-dataset-using-us-public-food-assistance-data/"><em>KeyCuts blog</em></a><em>.</em></p><p>When you need to capture some data in a structured way, you’ll open up an Excel file or Google Sheet and just start throwing data into the spreadsheet. Not much thinking; just copy and paste. As that dataset grows, the original structure you had set up for that spreadsheet may not be ideal. Specifically, the dataset is not ideal for putting into a PivotTable. Long-term, I’d argue that <em>all</em> your spreadsheets should be structured in a way that’s suitable for a PivotTable (which makes it ready for storing in a traditional database). This post explores how you can structure a dataset that looks like 99% of data out there into a structure you can analyze in a PivotTable. Link to the Google Sheet is <a target="_blank" href="https://docs.google.com/spreadsheets/d/1M8dmWoW2TD3-mHFI1_UBG-QzLS2FrJSnzXnl3Sx7_Is/edit#gid=0"><strong>here</strong></a>.</p><p><em>Video walkthrough of Google Sheet </em><a target="_blank" href="https://youtu.be/qFhluLJQpfA"><em>here</em></a><em>.</em></p><p>Why this is important</p><p>Telling someone that their data should be structured is a platitude like “such is life” and “forgive and forget.” Let’s be more specific in how this statement can impact your work.</p><p><strong>To be specific</strong>: 9 times out of 10, structure your data so that it can always be analyzed in a PivotTable.</p><p>Consider this scenario:</p><p>* Your accounting team needs your group to start forecasting expense for next month’s budget</p><p>* You start gathering the data and throw it into a spreadsheet</p><p>* Every month new data gets added to the spreadsheet, and perhaps the CFO wants to get more granular analyses on the forecast</p><p>* You start adding additional columns to the spreadsheet and perhaps summary tables in other sheets in the file</p><p>* Other teams now need to see your data to understand how your team’s decisions will impact their decisions</p><p>* This spreadsheet ends up being too hard to maintain, so there’s an internal project to put this data into a real database (some ERP solution)</p><p>* One quarter of planning goes by, and another quarter for implementation</p><p>* 6 months later, the business has changed, the structure of the database needs to be adjusted, and the data engineer role still needs to be filled</p><p>This concocted scenario is quite extreme, but the key lesson is this:</p><p>Focusing on the schema and structure of your spreadsheet <em>today</em> takes time and requires you to think about how your data will be used and maintained in the future.</p><p>U.S. public food assistance dataset</p><p>I’ve started browsing Kaggle’s to find interesting datasets recently, and <a target="_blank" href="https://www.kaggle.com/jpmiller/publicassistance"><strong>this one</strong></a> caught my attention since it looks at spending and household participation related to a public food assistance program called <a target="_blank" href="https://www.fns.usda.gov/snap/supplemental-nutrition-assistance-program"><strong>SNAP</strong></a>. As the creator of the dataset discusses, there are many issues with collecting government datasets. Data is spread out across different agencies, there are multiple formats, and data is sometimes aggregated. This makes consolidating the data a pain. These problems may sound familiar if you’re working at a large organization.</p><p>The “Raw” sheet in the <a target="_blank" href="https://docs.google.com/spreadsheets/d/1M8dmWoW2TD3-mHFI1_UBG-QzLS2FrJSnzXnl3Sx7_Is/edit#gid=0"><strong>Google Sheet</strong></a> simply shows the cost, households participating, and total people associated with the SNAP program for the 2019 fiscal year across four states (CA, IL, LA, NY):</p><p>In your organization, this could be sales data, headcount data, COGS, whatever. The key thing about this dataset is that you have all the numbers <em>organized by month across the top</em>. This table would be great for a simple time series analysis where you may want to see the <em>cost per household</em> for California over time. But what if you need to build out a more dynamic dashboard looking at various metrics for just a few months or a subset of states?</p><p>Pivoting this data</p><p>If you create a PivotTable with this data, you’ll run into this issue of having to select individual month names to put into the <em>Values</em> section of the PivotTable builder. We only have twelve months of data for FY19, imagine if this we had to this for ten years worth of data going back to FY09.</p><p>Some people asked me about what a “denormalized dataset” means in the context of Excel/Google Sheets I mentioned this term in the <a target="_blank" href="https://www.thekeycuts.com/dear-analyst-44-referencing-co2-emissions-data-with-indirect-and-filter-to-build-a-model/"><strong>previous episode</strong></a>. We need to “denormalize” this data so that it’s easier to pivot off of. This means putting in data that may repeat itself in a certain column, but this helps with structuring the data properly for a PivotTable.</p><p>In Excel, there is hacky way of denormalizing your data, and it involves going through the antiquated PivotTable wizard (which I believe you can only access via old Excel keyboard shortcuts). I don’t think the PivotTable wizard is available in the ribbon in recent versions of Excel.</p><p>This video below shows you how to do it. It involves checking a radio button for “Multiple consolidation ranges” and then double-clicking in the grand total of the sum of Values in the PivotTable. It’s not pretty, but it works:</p><p>Unfortunately for Google Sheets users, that PivotTable wizard isn’t available. If you find a similar workaround let me know.</p><p>Moving time periods to rows in Google Sheets</p><p>Whenever you see time periods (in this case, months in 2018 and 2019) organized across the columns, think about how you can put those time periods into <em>one column</em>. This starts the process of denormalization. You want something that looks like this:</p><p>When you pivot off of the Period column in the PivotTable, you can then filter for and group your values by specific dates:</p><p>Moving metrics from rows to columns</p><p>In the original data set, there’s a Metric column which contains metrics we care about for each state (Cost, Households, and Persons). This structure will make a PivotTable very hard to organize and analyze because you will have to <em>filter</em> for a specific metric in order to get any meaningful statistics from your dataset. Additionally, this structure is mixing data types (e.g. Cost is in dollars and Households is a number).</p><p>Whenever you see metrics organized in this manner, think about moving each individual metric to its own <em>column</em>:</p><p>Now, each of these <em>columns </em>is a value you can drag and drop into the “Values” section of the PivotTable. This means you can get summary results <em>or</em> drill down into a specific state’s numbers:</p><p>Transposing the data</p><p>Setting up the data structure to look like the structure in the “Solution” sheet of the Google Sheet does take a little spreadsheet gymnastics. The easiest method I’ve found is to apply the TRANSPOSE function to the original dataset and then do some copying/pasting. Here’s what a TRANSPOSE looks like:</p><p>The nice thing about this function is that it puts all your time periods (months in this case) into its own column. Each metric also is organized in a top-to-down fashion. The problem is that each state’s data is still organized across the top. At this point, you’re doing a copy and paste to consolidate the <strong>13 columns</strong> that result from the TRANSPOSE function into the <strong>5 columns</strong> we ultimately care about: State, Period, Cost, Households, and Persons.</p><p>Setting things up for a database</p><p>You may be wondering what other benefits there are for having this data structure besides the ease of creating a PivotTable. If your data ever ends up in a regular database (e.g. SQL), this is the ideal data structure for that tool.</p><p>I’ve seen scenarios at different organizations where an Excel file or Google Sheet has hundreds of thousands of rows that represent critical business data cobbled together over time. There comes a point in time from an organizational perspective where that data needs to be put into a database for ease of querying. A data engineer will have to do some data manipulation or run an <a target="_blank" href="https://en.wikipedia.org/wiki/Extract,_transform,_load"><strong>ETL process</strong></a> to convert the data into a suitable format for a database. Guess what? You can help your data engineer out by getting this structure correct from day one.</p><p>Data down good 😀, data right bad 😔</p><p>To summarize how your data should “grow” over time (big data ain’t going nowhere), your data should <strong>NOT grow right</strong>:</p><p>Instead, it should <strong>grow down</strong>:</p><p>Other Podcasts & Blog Posts</p><p>In the 2nd half of the episode, I talk about some episodes and blogs from other people I found interesting:</p><p>* Acquired Podcast Season 7 Episode #3: <a target="_blank" href="https://www.acquired.fm/episodes/epic-games"><strong>Epic Games</strong></a></p><p>* People I (Mostly) Admire Ep #2: <a target="_blank" href="https://freakonomics.com/podcast/pima-mayim-bialik/"><strong>Mayim Bialik</strong></a></p> <br/><br/>This is a public episode. If you would like to discuss this with other subscribers or get access to bonus episodes, visit <a href="https://alchen.substack.com?utm_medium=podcast&#38;utm_campaign=CTA_1">alchen.substack.com</a>]]></description><link>https://alchen.substack.com/p/episode-45-thinking-long-term-for</link><guid isPermaLink="false">substack:post:4869052</guid><dc:creator><![CDATA[Al]]></dc:creator><pubDate>Mon, 28 Sep 2020 10:05:26 GMT</pubDate><enclosure url="https://api.substack.com/feed/podcast/4869052/5341de144a79e00d76cb65568a3addf2.mp3" length="33333333" type="audio/mpeg"/><itunes:author>Al</itunes:author><itunes:explicit>No</itunes:explicit><itunes:duration>1674</itunes:duration><itunes:image href="https://substackcdn.com/feed/podcast/23684/post/4869052/c712a2211ef2655a73a9951f819f4ece.jpg"/></item><item><title><![CDATA[Episode #43: Setting up workflows that scale – from spreadsheets to tools & applications]]></title><description><![CDATA[<p><em>This post originally appeared on the </em><a target="_blank" href="https://www.thekeycuts.com/dear-analyst-43-setting-up-workflows-that-scale-from-spreadsheets-to-tools-applications/"><em>KeyCuts blog</em></a><em>.</em></p><p>This episode is the audio from <a target="_blank" href="https://www.betaworks-studios.com/events/no-code-curious-from-spreadsheets-to-tools-applications-with-al-chen"><strong>a presentation</strong></a> I gave a few weeks ago to members of Betaworks based in NYC. Betaworks is a startup accelerator, co-working space, and community of founders. No-code is a pretty hot topic right now, and in this presentation I talk about how spreadsheets is one of the first no-code “platforms” and how your spreadsheet skills can be extended to build real tools. The presentation is adapted from <a target="_blank" href="https://www.youtube.com/watch?v=M1GAArkYfug"><strong>a talk</strong></a> I gave last year at <a target="_blank" href="https://webflow.com/nocodeconf"><strong>Webflow’s No-Code Conference</strong></a>. I embedded the “slides” at the bottom of the post, and here is <a target="_blank" href="https://coda.io/d/Setting-Up-Workflows-That-Scale_dODfEyOKx_d/Setting-Up-Workflows-That-Scale-From-Spreadsheets-to-Tools-Appli_su65_#_lutKh"><strong>a link</strong></a> to the slides if you want to look on your own.</p><p>Summary of presentation</p><p>* The skills you’ve learned in Excel/Google Sheets — include data structuring — translate to building workflows for any part of your business</p><p>* Thinking beyond spreadsheets as a way to do data analysis or “number crunching”</p><p>* Any tool that helps automate or solve some workflow at your company can be built with spreadsheets</p><p>* Why learning spreadsheets can set you up well for learning “no-code” tools</p><p>Spreadsheet examples from presentation</p><p>During the presentation, I showed actual spreadsheets (Excel and Google Sheets) I’ve built in the past for freelance clients and friends. The main concept I’m trying to convey is that each of these spreadsheets look and feel more like an <em>application</em> rather than a <em>model </em>that forecasts out certain values. Each of these examples consists three core elements:</p><p>* <strong>Database</strong> – A place to store information</p><p>* <strong>User Input – </strong>Fields and forms for someone to fill out</p><p>* <strong>Calculations/Display </strong>– Formulas (e.g. “business logic”) to make the spreadsheet output something for you (the administrator) or the user</p><p><em>My 2 cents</em>: When you’re building an application in a spreadsheet, you’re extending the original purpose and audience Excel and Google Sheets was meant to serve: financial models for accountants. <em>But this is what makes the spreadsheet so versatile. </em>The fact that an analyst can string together formulas to make a spreadsheet look and feel like an application is what gives the spreadsheet power. This innovation also pushes Microsoft, Google, and other platforms to release new features that give analysts the ability to build tools, not just models.</p><p>I’ve <a target="_blank" href="https://coda.io/@atc/the-overlooked-benefit-of-no-code-tools"><strong>written</strong></a> extensively about this subject in the past, so will leave my soliloquy at that. On to the examples</p><p>Bachelorette planning Google Sheet</p><p>The first example I discuss is this bachelorette party planning Google Sheet I built for a friend. This spreadsheet has been duplicated quite a few times by friends of friends, and all it does is help a to-be bride plan figure out which weekend works best to have a bachelorette party.</p><p>The key insight is that the <em>database</em> is everything from column B onwards and row 3 and below. All the availability for each person is captured in each of these cells and there’s some conditional formatting to give the bride a visual indicator to see when a weekend is available.</p><p>The <em>user input</em> is the ability for each friend who is shared the Google Sheet to edit the cells. “Yes,” “No,” and “Maybe” are the only inputs that matter for this Google Sheet. Finally, the <em>calculations</em> are in rows 31-33 which tallies up the user inputs for each weekend so the bride can see which weekend is the “most free” for her friends.</p><p>There are countless iPhone and Android apps you can download to do this exact same thing, but this spreadsheet just does one thing and one thing well: help brides figure out which weekend to plan a bachelorette party.</p><p>Splitting costs with friends</p><p>This splitting costs with friends <a target="_blank" href="https://www.thekeycuts.com/splitting-costs-excel/"><strong>blog post</strong></a> is by far the most popular post on my blog since I published it in 2014 (thanks Google search!). Every day I still get requests to give people edit access to the Google Sheet (please just make a <a target="_blank" href="https://www.businessinsider.com/how-to-copy-a-google-sheet"><strong>copy of it</strong></a> instead of requesting edit access). Here’s the <a target="_blank" href="https://docs.google.com/spreadsheets/d/19hcQKId5M_153cbVm4XolShnxZ-IfdwMVANrpOm7LSs/edit?pli=1#gid=0"><strong>Google Sheet</strong></a> if you want to make a copy for yourself.</p><p>Similar to the previous example, the <em>database </em>is all the items, costs, and who participated in the cost from rows 2 and down. The <em>user input</em> are the cells themselves, but the most important part of the Google Sheet are the 1s and 0s from column C onward. Those 1s and 0s represent whether a friend or family member “participated” in the cost. This allows the spreadsheet to do some basic calculations to figure out who owes what.</p><p>Rows 26-28 are the <em>calculations</em> that the trip organizer can see at a glance to see who is owed or who owes money. Again, numerous apps and custom tools you can pay for or download to split costs with friends, and this Google Sheet mimics the features of those apps in a more bare bones way.</p><p>Patient intake system</p><p>This example shows when the spreadsheet is really extended beyond what it was intended to do. This was for one of my consulting clients who needed a new CRM system for managing new patients at their clinic.</p><p>The Excel file basically lets the operations manager at the clinic quickly “move” new patients from one spreadsheet to another using a VBA macro. To mimic the look and feel of an application, I drew these blue and green buttons using the shape feature in Excel and tied a macro to each button. The <em>database </em>consists of patient details, the <em>user input</em> is simply each row of data, and the <em>calculations</em> involve these macros that move data from one spreadsheet to another.</p><p>This gets into an important concept that an Excel file or Google Sheet are not that great for: <em>workflows</em>. Since everything is usually calculated in real-time in a spreadsheet, it can be difficult to do a <em>if-this-then-that</em> type of workflow without using a macro or script (see my <a target="_blank" href="https://www.thekeycuts.com/dear-analyst-filling-values-down-into-empty-cells-programmatically-with-google-apps-script-vba-tutorial/"><strong>last post</strong></a> on automating a tedious filling values down task).</p><p>“Slides” from Betaworks presentation</p><p>The rest of the presentation includes tool and tips for building applications with other no-code tools. <a target="_blank" href="https://coda.io/d/Setting-Up-Workflows-That-Scale_dODfEyOKx_d">Link to slides</a>.</p><p><a target="_blank" href="https://www.youtube.com/watch?v=M1GAArkYfug&#38;feature=emb_logo">Original talk</a> from Webflow’s No-Code Conference in 2019.</p><p>Other Podcasts & Blog Posts</p><p>In the 2nd half of the episode, I talk about some episodes and blogs from other people I found interesting:</p><p>* <em>No other podcasts for this episode given how long this episode is!</em></p><p>Subscribe: <a target="_blank" href="https://itunes.apple.com/us/podcast/dear-analyst/id1455099942?mt=2&#38;ls=1#episodeGuid=https%3A%2F%2Fwww.thekeycuts.com%2F%3Fp%3D49633"><strong>Apple Podcasts</strong></a> | <a target="_blank" href="https://subscribeonandroid.com/www.thekeycuts.com/category/podcast/feed/"><strong>Android</strong></a> | <a target="_blank" href="https://www.google.com/podcasts?feed=aHR0cHM6Ly93d3cudGhla2V5Y3V0cy5jb20vY2F0ZWdvcnkvcG9kY2FzdC9mZWVkLw"><strong>Google Podcasts</strong></a> | <a target="_blank" href="https://www.stitcher.com/podcast/dear-analyst"><strong>Stitcher</strong></a> | <a target="_blank" href="https://tunein.com/podcasts/Technology-News/Dear-Analyst-p1208784/"><strong>TuneIn</strong></a> | <a target="_blank" href="https://podcasters.spotify.com/podcast/5RMq7wU2CMRxmDokdPgn5i"><strong>Spotify</strong></a> | <a target="_blank" href="https://www.thekeycuts.com/category/podcast/feed/"><strong>RSS</strong></a></p> <br/><br/>This is a public episode. If you would like to discuss this with other subscribers or get access to bonus episodes, visit <a href="https://alchen.substack.com?utm_medium=podcast&#38;utm_campaign=CTA_1">alchen.substack.com</a>]]></description><link>https://alchen.substack.com/p/episode-43-setting-up-workflows-that</link><guid isPermaLink="false">substack:post:1834656</guid><dc:creator><![CDATA[Al]]></dc:creator><pubDate>Mon, 14 Sep 2020 10:05:08 GMT</pubDate><enclosure url="https://api.substack.com/feed/podcast/1834656/e44bb9c28e5178ad1dec2ca8d7df3741.mp3" length="33333333" type="audio/mpeg"/><itunes:author>Al</itunes:author><itunes:explicit>No</itunes:explicit><itunes:duration>3056</itunes:duration><itunes:image href="https://substackcdn.com/feed/podcast/23684/post/1834656/debf063f31dc0cc05e1f296ccf5d4cb6.jpg"/></item><item><title><![CDATA[Episode #42: Filling values down into empty cells programmatically with Google Apps Script & VBA using SPAC data]]></title><description><![CDATA[<p><em>This post originally appeared on the </em><a target="_blank" href="https://www.thekeycuts.com/dear-analyst-filling-values-down-into-empty-cells-programmatically-with-google-apps-script-vba-tutorial"><em>KeyCuts blog</em></a>.</p><p>SPACs (Special Purpose Acquisition Companies) or “blank check” companies have been <a target="_blank" href="https://qz.com/1898249/why-firms-want-direct-listings-and-spacs-instead-of-ipos/"><strong>in the news</strong></a> recently, so I used some real SPAC data for this episode. Your spreadsheet has empty cells in column A, and these empty cells should be filled with values. Your task is to fill values down <em>up until</em> you find another cell with a value, at which point you need to fill <em>that </em>value down. This episode walks through how to do this programmatically with a script in Google Apps Script (for Google Sheets) and VBA (for Excel). This is the <a target="_blank" href="https://docs.google.com/spreadsheets/d/1GSNxaCMFD1PMwwbSFEZpCE1EUTyq-lp5H-zbry4vYE0/edit#gid=0"><strong>Google Sheet</strong></a> associated with the episode. The Google App Script is <a target="_blank" href="https://gist.github.com/albertc44/17a427e27077c3921695c793ad1a0440"><strong>here</strong></a> and VBA script is <a target="_blank" href="https://gist.github.com/albertc44/974dfeb419698c4b876ff8bbd00ab514"><strong>here</strong></a>. See a quick example of what the issue is in the gif below and how the script “fills in” the values for you.</p><p><em>See the video below if you want to jump straight to the tutorial:</em></p><p><strong>Why is this data structure a problem?</strong></p><p>You’ve inherited a spreadsheet and the data structure looks like this:</p><p>It’s a list of data but there are empty cells in column A. This is usually a <em>category </em>or <em>dimension </em>in your data set that needs to be “filled down” so that the data set is complete. In the Google Sheet, each row represents one person that is associated with a given SPAC, but the SPAC Ticker column is incomplete. You’ll usually get this type of data structure through the following:</p><p>* Data was manually created by someone who didn’t fill down the values in column A since they thought it was a “category”</p><p>* You are working a data set that originally came from a PivotTable but you only have the “values” from the PivotTable, not the PivotTable itself</p><p>This data structure is a problem because if you want to do any type of analysis on this data, it will be extremely difficult since you have <em>missing values</em> in column A. Sorting, filtering, and PivotTables are all out of the question if your data set looks like that screenshot.</p><p>Solving this with keyboard shortcuts</p><p>Totally doable for this Google Sheet. This is what you could do:</p><p>All I’m doing above is the following (on PC):</p><p>* <strong>SHIFT+CONTROL+DOWN ARROW – </strong>Select all the empty cells from the current cell with a value up until the next cell with a value</p><p>* <strong>SHIFT+UP ARROW – </strong>Reduce the selection by one row</p><p>* <strong>CONTROL+D–</strong> Fill the value from the first cell in the selection down</p><p>* <strong>CONTROL+DOWN ARROW</strong> – Skip to the next value that needs to be filled down</p><p>The obvious tradeoff here is time vs. human error. Every time I have to do this task on a spreadsheet, I think about whether it was worth filling the values down “manually” using keyboard shortcuts or using a VBA script (in Excel) to do this programatically. It really depends on the number of rows. For the example SPAC Google Sheet, doing this with keyboard shortcuts takes 10 seconds tops. If this spreadsheet was 1,000,000 rows, then we have a problem.</p><p>Don’t worry, I got you. Here’s the script you can use to do this programmatically.</p><p>Using Google Apps Script in Google Sheets</p><p>First off, here’s the script you can use for Google Sheets (gist <a target="_blank" href="https://gist.github.com/albertc44/17a427e27077c3921695c793ad1a0440"><strong>here</strong></a>). Just 14 lines of code and you’re good to go:</p><p>function fillValuesDown() {  var spreadsheet = SpreadsheetApp.getActive()  var currentRange = spreadsheet.getRange("A2:A" + spreadsheet.getLastRow())  var newRange = []  var newFillValue  currentRange.getValues().map(function(value) {    if (value[0] !== '') {      newFillValue = value[0]      newRange.push([newFillValue])    } else {      newRange.push([newFillValue])    }  })  currentRange.setValues(newRange)}</p><p>Never used macros or Google Apps Script before? It’s super simply. First go to <strong>Tools</strong> then <strong>Script Editor:</strong></p><p>You may be asked to authenticate your Google account so just hit Yes to all those screens. Copy/paste the script into the editor:</p><p>Go to <strong>File </strong>and <strong>Save </strong>in order to save the script into the Google Apps Script project. Go back to Google Sheets and go to <strong>Tools</strong>, <strong>Macros</strong>, and click <strong>Import </strong>to import the fillValuesDown function into Google Sheets. Now you can use this function as a macro in your Google Sheet:</p><p>You can close out the Google Apps Script editor and now click on <strong>Tools</strong>, <strong>Macros</strong>, and click on <strong>fillValuesDown</strong> to run the script on your dataset:</p><p>How does the script work?</p><p>The script utilizes the <a target="_blank" href="https://developers.google.com/apps-script/reference/spreadsheet"><strong>Spreadsheet service</strong></a> for Google Apps Script to access the data object for your Google Sheet (more on that below). The script is really only 12 lines long, and does the following in sequential order:</p><p>* Sets the spreadsheet variable so that we can use the active worksheet you’re on</p><p>* Sets the currentRange variable to start from A2 to the last row in the table</p><p>* Two more variables are set: newRange to store the new range of values we want to put into column A, and newFillValue which is kind of like an intermediate variable used in the loop</p><p>* The script goes through all values in currentRange (including the blank ones) and adds all the correct values to the newRange array</p><p>* The currentRange is then set equal to newRange to get all the “correct” values into column A</p><p>On the backend, the currentRange array looks like this:</p><p>[['HZAC'], [], ['FST'], [], [] , []...]</p><p>The purpose of newRange is to create a new array that is a complete list of values:</p><p>[['HZAC'], ['HZAC'], ['FST'], ['FST'], ['FST'] , ['FST']...]</p><p>Recording macros vs. programming Google Sheets</p><p>When I first started learning macros, the first thing I did was record my keystrokes and break down what the backend “code” looked like. Here’s what recording a macro looks like:</p><p>When you open up the script editor, you’ll see this:</p><p>There’s a lot of activate() and getCurrentCell() functions being called. You can then deconstruct all these <em>keystrokes</em> to build a script that accomplishes the task. But here’s the key difference between recording keystrokes versus working with the data object:</p><p>You are programming keystrokes instead of the Google Sheets application.</p><p>Other advantages of programming the <em>application</em> instead of the <em>keystrokes</em>:</p><p>* Utilizes less compute resources and runs faster</p><p>* Easier to debug</p><p>* Easier to adapt to more scenarios and use cases</p><p>In the <em>keystroke</em> world, you are literally telling Google Sheets to select cells, select ranges, and moving the cursor around which doesn’t seem like a big deal. When you are working with hundreds of thousands of rows, this could cause serious performance issues. Since Google Apps Script runs in the cloud, you may not see these performance deficiencies, but you’ll definitely see this in your Excel workbooks.</p><p>Speaking of Excel workbooks…</p><p>Using the VBA script for Excel</p><p>Sub fillValuesDown()  Dim lastRow As Double  lastRow = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row  Dim currentRange As Variant: Set currentRange = ActiveSheet.Range("A2:A" & lastRow)  ReDim newRange(1 To lastRow)  Dim newFillValue As String  Dim i As Long  i = 1  For Each cell In currentRange    If IsEmpty(cell.Value) = False Then      newFillValue = cell.Value      newRange(i) = newFillValue      i = i + 1    Else      newRange(i) = newFillValue      i = i + 1    End If  Next cell  currentRange.Value = Application.Transpose(newRange)End Sub</p><p>The structure of the VBA script is pretty similar to the Google Apps Script, but it’s just a little different syntax. I’m not going to walk through the tutorial of how to set this up since it’s pretty similar to Google Sheets. In the VBA script, you do end up doing some “cell selection” like in line 8. Most of the script, however, is working with the Excel data object model so the script should run pretty quickly regardless of the size of your Excel file.</p><p>Other Podcasts & Blog Posts</p><p>In the 2nd half of the episode, I talk about some episodes and blogs from other people I found interesting:</p><p>* Developer Love #3: <a target="_blank" href="https://www.heavybit.com/library/podcasts/developer-love/ep-3-developer-experience-teams-with-peggy-rayzis-of-apollo/"><strong>Developer Experience Teams with Peggy Rayzis of Apollo</strong></a></p><p>Subscribe: <a target="_blank" href="https://itunes.apple.com/us/podcast/dear-analyst/id1455099942?mt=2&#38;ls=1#episodeGuid=https%3A%2F%2Fwww.thekeycuts.com%2F%3Fp%3D49588"><strong>Apple Podcasts</strong></a> | <a target="_blank" href="https://subscribeonandroid.com/www.thekeycuts.com/category/podcast/feed/"><strong>Android</strong></a> | <a target="_blank" href="https://www.google.com/podcasts?feed=aHR0cHM6Ly93d3cudGhla2V5Y3V0cy5jb20vY2F0ZWdvcnkvcG9kY2FzdC9mZWVkLw"><strong>Google Podcasts</strong></a> | <a target="_blank" href="https://www.stitcher.com/podcast/dear-analyst"><strong>Stitcher</strong></a> | <a target="_blank" href="https://tunein.com/podcasts/Technology-News/Dear-Analyst-p1208784/"><strong>TuneIn</strong></a> | <a target="_blank" href="https://podcasters.spotify.com/podcast/5RMq7wU2CMRxmDokdPgn5i"><strong>Spotify</strong></a> | <a target="_blank" href="https://www.thekeycuts.com/category/podcast/feed/"><strong>RSS</strong></a></p> <br/><br/>This is a public episode. If you would like to discuss this with other subscribers or get access to bonus episodes, visit <a href="https://alchen.substack.com?utm_medium=podcast&#38;utm_campaign=CTA_1">alchen.substack.com</a>]]></description><link>https://alchen.substack.com/p/episode-42-filling-values-down-into</link><guid isPermaLink="false">substack:post:1351722</guid><dc:creator><![CDATA[Al]]></dc:creator><pubDate>Mon, 07 Sep 2020 11:00:04 GMT</pubDate><enclosure url="https://api.substack.com/feed/podcast/1351722/53b1bbb1e3ff90ffdc58911d4a25917a.mp3" length="33333333" type="audio/mpeg"/><itunes:author>Al</itunes:author><itunes:explicit>No</itunes:explicit><itunes:duration>2340</itunes:duration><itunes:image href="https://substackcdn.com/feed/podcast/23684/post/1351722/d60f5ca5ba1af0325196ca8bc8e16c10.jpg"/></item><item><title><![CDATA[Episode #41: How to do a VLOOKUP to the “left” without INDEX/MATCH with TikTok data]]></title><description><![CDATA[<p><em>This post originally appeared on the </em><a target="_blank" href="https://www.thekeycuts.com/dear-analyst-how-to-do-a-vlookup-to-the-left-without-index-match-with-tiktok-data/(opens in a new tab)"><em>KeyCuts blog</em></a><em>.</em></p><p>Since TikTok is in the news right now about who is going to buy them, I thought using some fake-ish TikTok acquisition data would be relevant for this episode. A classic Excel/Google Sheets challenge: how to do a VLOOKUP to the “left” e.g. your lookup column is <em>not</em> the first column in your lookup table. There are all sorts of strategies to overcome this issue with how your data is structured. Notably, the INDEX/MATCH strategy is the most <a target="_blank" href="https://www.thekeycuts.com/the-debate-over-vlookup-versus-index-match-in-excel/"><strong>commonly-cited strategy</strong></a> when good ‘ol VLOOKUP is not at your disposal. In this episode I walk through a strategy that allows you to use VLOOKUP: array formulas. Skip to strategy #3 below if you want to see the answer. Associated <a target="_blank" href="https://docs.google.com/spreadsheets/d/1fj6iwB_Fh5QM4om_4IoR5B4YEsDpMBjMnRL8eTQmCsg/edit#gid=0"><strong>Google Sheet</strong></a> for this episode if you want to follow along.</p><p>Was trying to find some gif associated with “looking up” </p><p><em>See the video below if you want to jump straight to the tutorial:</em></p><p><strong>Why the VLOOKUP won’t work</strong></p><p>If you are new to why VLOOKUP won’t work in this scenario (see <a target="_blank" href="https://docs.google.com/spreadsheets/d/1fj6iwB_Fh5QM4om_4IoR5B4YEsDpMBjMnRL8eTQmCsg/edit#gid=0"><strong>Google Sheet</strong></a>), take a look at the data data structure below:</p><p>We have ID in column A and we want to find Company Name and Market Cap in columns C and D, respectively, for these IDs. The ID in column A is the unique identifier for the row, and we need to do a lookup to Company ID in column I.</p><p>While you can eyeball the result for the first row (“Triller” is the company for ID 3), we want to find a scalable solution using formulas.</p><p>As you start writing the VLOOKUP formula in column C, you’ll start to notice the problem: the Company ID column is not the <em>first </em>column in your table to lookup the ID value in column A:</p><p>Here are a few strategies for solving this problem (#3 is probably the one you haven’t seen before).</p><p><strong>Strategy #1: Move the lookup column to the first column position</strong></p><p>This is not the most ideal solution, but you could just simply cut and paste the Company ID column and move it to the left-most “first” column of your lookup table. In Excel you would have to do a cut and paste, but in Google Sheets you can just drag and drop the column into the proper position:</p><p>Now the VLOOKUP for Company Name will work correctly since Company ID is the first column in your lookup table:</p><p>I don’t like this strategy because it involves some manual cutting and pasting of columns. If your lookup table isn’t static (e.g. might be sales data that gets added daily), then you might be ruining the “structure” of your data on subsequent updates. Let’s see what else we can do.</p><p>Strategy #2: Make copies of the columns to the right of the lookup column</p><p>Also not an ideal solution, but it works in one-off cases where your data is static and you don’t care about showing your back-end work to a colleague. It looks like data is duplicated, but you’re basically referencing existing columns in your table so that those columns appear to the “right” of your lookup column:</p><p>Now you can do a VLOOKUP for columns I to K to get the Company Name and Market Cap values to show up in columns C and D:</p><p>Strategy #3 (preferred): Use array formulas</p><p>A relatively unknown feature in Google Sheets is you can create your own “tables” using array formulas. An array is simply a range of cells, and you can separate different range of cells using a semicolon. To create an array, you put curly brackets around your ranges. Here’s how an array of columns F and G would look like:</p><p>What’s the result? You simply get a reference to the two ranges after you enter the formula:</p><p>The key here is that you can create <em>any order </em>of range references in the array formula. We could’ve put G2:G6 first and F2:F6 second, and you would’ve seen the values in Website first followed by Company Name after entering the formula.</p><p>Knowing this, we can create our own lookup “table” using the array formula syntax like so:</p><p>Notice how the second argument in the VLOOKUP formula is no longer a table, but rather an array of column I followed by columns F to H. In this array, the second “column” is Company Name since we are saying column F is the second range of cells after column I. Market Cap is now the fourth column in this array:</p><p>In order to fill this formula down, we need to turn the range references in the array formula into absolute references as shown above.</p><p>Strategy #4 (most common): INDEX/MATCH</p><p>As mentioned at the beginning of this post, this is the most common method for looking up values to the left. I won’t give a detailed explanation of how INDEX/MATCH works, but here’s how you would get the Company Name given the data structure:</p><p>Which strategy should you use?</p><p>I’m a little torn between strategies #3 and #4 since INDEX/MATCH is the go-to method for looking up data to the left, and is also more performant than VLOOKUP on large data sets. The fact that the array formula in strategy #3 doesn’t involve a nested formula makes it potentially easier to debug in complicated spreadsheets. I haven’t used an array formula in many VLOOKUP situations since I learned INDEX/MATCH such a long time ago, but I may try this strategy in the future.</p><p>Of course, this all becomes irrelevant if you have the <a target="_blank" href="https://www.thekeycuts.com/excel-introduces-new-feature-xlookup/"><strong>XLOOKUP</strong></a><a target="_blank" href="https://www.thekeycuts.com/excel-introduces-new-feature-xlookup/"><strong> function</strong></a> at your disposal which became available to certain Office 365 subscribers about a year ago (September 2019). This video is a fun poke at XLOOKUP, but also holds some truth for the VLOOKUP purists out there (start watching at 1:19):</p><p>A little Kant and poker</p><p>I talk about this in the 2nd half of the episode, but thought it would be worth sharing a passage from <em>The Critique of Pure Reason</em> as it relates to betting on your convictions. Listen to the <em>Knowledge Project</em><a target="_blank" href="https://fs.blog/knowledge-project/maria-konnikova/"><strong>episode</strong></a> for the full background:</p><p>The usual touchstone, whether that which someone asserts is merely his persThe usual touchstone, whether that which someone asserts is merely his persuasion — or at least his subjective conviction, that is, his firm belief — is betting. It often happens that someone propounds his views with such positive and uncompromising assurance that he seems to have entirely set aside all thought of possible error. A bet disconcerts him. Sometimes it turns out that he has a conviction which can be estimated at a value of one ducat, but not of ten. For he is very willing to venture one ducat, but when it is a question of ten he becomes aware, as he had not previously been, that it may very well be that he is in error. If, in a given case, we represent ourselves as staking the happiness of our whole life, the triumphant tone of our judgment is greatly abated; we become extremely diffident, and discover for the first time that our belief does not reach so far. Thus pragmatic belief always exists in some specific degree, which, according to differences in the interests at stake, may be large or may be small.</p><p>Other Podcasts & Blog Posts</p><p>In the 2nd half of the episode, I talk about some episodes and blogs from other people I found interesting:</p><p>* The ShopTalk Show #424: <a target="_blank" href="https://shoptalkshow.com/424/"><strong>Web Components, Frameworks vs Vanilla, Accessible Numbers, and SVG Memory Usage</strong></a></p><p>* The Knowledge Project #89: <a target="_blank" href="https://fs.blog/knowledge-project/maria-konnikova/"><strong>Maria Konnikova: Less Certainty, More Inquiry</strong></a></p><p>Subscribe: <a target="_blank" href="https://itunes.apple.com/us/podcast/dear-analyst/id1455099942?mt=2&#38;ls=1#episodeGuid=https%3A%2F%2Fwww.thekeycuts.com%2F%3Fp%3D49494"><strong>Apple Podcasts</strong></a> | <a target="_blank" href="https://subscribeonandroid.com/www.thekeycuts.com/category/podcast/feed/"><strong>Android</strong></a> | <a target="_blank" href="https://www.google.com/podcasts?feed=aHR0cHM6Ly93d3cudGhla2V5Y3V0cy5jb20vY2F0ZWdvcnkvcG9kY2FzdC9mZWVkLw"><strong>Google Podcasts</strong></a> | <a target="_blank" href="https://www.stitcher.com/podcast/dear-analyst"><strong>Stitcher</strong></a> | <a target="_blank" href="https://tunein.com/podcasts/Technology-News/Dear-Analyst-p1208784/"><strong>TuneIn</strong></a> | <a target="_blank" href="https://podcasters.spotify.com/podcast/5RMq7wU2CMRxmDokdPgn5i"><strong>Spotify</strong></a> | <a target="_blank" href="https://www.thekeycuts.com/category/podcast/feed/"><strong>RSS</strong></a></p> <br/><br/>This is a public episode. If you would like to discuss this with other subscribers or get access to bonus episodes, visit <a href="https://alchen.substack.com?utm_medium=podcast&#38;utm_campaign=CTA_1">alchen.substack.com</a>]]></description><link>https://alchen.substack.com/p/episode-41-how-to-do-a-vlookup-to</link><guid isPermaLink="false">substack:post:920101</guid><dc:creator><![CDATA[Al]]></dc:creator><pubDate>Mon, 31 Aug 2020 10:09:56 GMT</pubDate><enclosure url="https://api.substack.com/feed/podcast/920101/78090552409094722865e47406fde2da.mp3" length="33333333" type="audio/mpeg"/><itunes:author>Al</itunes:author><itunes:explicit>No</itunes:explicit><itunes:duration>1783</itunes:duration><itunes:image href="https://substackcdn.com/feed/podcast/23684/post/920101/b6c0a16371768be73fd305efc89b8f27.jpg"/></item><item><title><![CDATA[Dear Analyst Episode #40: A spreadsheet error from two Harvard professors leading to incorrect economic policies after 2008 recession]]></title><description><![CDATA[<p><em>This post originally appeared on the </em><a target="_blank" href="https://www.thekeycuts.com/dear-analyst-generate-a-random-list-of-names-from-a-list-of-popular-90s-tv-characters/"><em>KeyCuts blog</em></a><em>.</em></p><p>It's 2010, and the world is coming out of recession. Two Harvard professors--one of whom is a former economist for the IMF and chess Grandmaster--publish a paper suggesting that a country with a high public debt-to-GDP ratio of over 90% is associated with low economic growth. Turns out the Excel model the professors use is riddled with some basic statistical and formula errors. The results potentially lead to incorrect economic policies, austerity measures, and high unemployment around the world. This is a <a target="_blank" href="https://docs.google.com/spreadsheets/d/1jWu02sK0J4tRIHTZ1J5XwUPfBeVV8Ef-trHJ5cAwR8g/edit?usp=sharing">Google Sheet</a> which shows one of the spreadsheet errors, and I show how you can prevent such an error in this post.</p><p></p><p><em>See the video below if you want to jump straight to the tutorial:</em></p><p><strong>Background</strong></p><p>Economists Carmen Reinhart and Kenneth Rogoff published a paper in 2010 called <a target="_blank" href="https://www.nber.org/papers/w15639"><em>Growth in a Time of Debt</em></a> (originally published in the <a target="_blank" href="https://www.aeaweb.org/journals/aer">American Economic Review</a>) where they argued:</p><p>[...] median growth rates for countries with public debt over 90 percent of GDP are roughly one percent lower than otherwise; average (mean) growth rates are several percent lower.</p><p>In 2013, PhD students Thomas Herndon, Michael Ash, and Robert Pollin of the University of Massachusetts, Amherst had re-created the study from Reinhart and Rogoff's paper as part of their PhD program. The students had to analyze the original Excel files that Reinhart and Rogoff used, and they weren't able to replicate the original results. They cited in their own paper entitled <a target="_blank" href="https://www.peri.umass.edu/fileadmin/pdf/working_papers/working_papers_301-350/WP322.pdf"><em>Does High Public Debt Consistently Stifle Economic Growth? A Critique of Reinhart and Rogoff</em></a> :</p><p>[...] coding errors, selective exclusion of available data, and unconventional weighting of summary statistics lead to serious errors that inaccurately represent the relationship between public debt and GDP growth among 20 advanced economies in the post-war period.</p><p>Reinhart and Rogoff suggested that the debt/GDP ratio and economic growth is simply a correlation, and that correlation still holds after correcting for the spreadsheet mistakes. However, that correlation is not as strong as their original paper posited.</p><p><strong>Why this was a big deal</strong></p><p>The implications of their findings resulted in news outlets, politicians, and policymakers using the 90% benchmark as a signal that a country is heading for low economic growth. Some notable examples:</p><p>* 2012 Republican nominee for the US vice presidency Paul Ryan included the paper in hi <a target="_blank" href="http://budget.house.gov/prosperity/fy2013.htm">proposed 2013 budget</a></p><p>* The <em>Washington Post</em> editorial board takes it as an economic consensus view, <a target="_blank" href="https://www.washingtonpost.com/opinions/debt-reduction-hawks-and-doves/2013/01/26/3089bd52-665a-11e2-93e1-475791032daf_story.html">stating that</a> "debt-to-GDP could keep rising — and stick dangerously near the 90 percent mark that economists regard as a threat to sustainable economic growth." </p><p>* Austerity measures are put into place around the world despite the advice from economic advisers, pushing unemployment rate above 10% in the eurozone</p><p>3 main Excel spreadsheet problems with the model</p><p>The three main errors that Herndon, Ash, and Polling discovered are the following:</p><p>* Years of high debt and average growth where selectively excluded from the data set</p><p>* Countries' GDP growth rates were not properly weighted</p><p>* Summary table excludes high-debt and average-growth countries</p><p>This video illustrates the three individual problems with the spreadsheet really clearly:</p><p>If you fix these errors, the average real GDP growth rate for countries carrying a public debt-to-GDP ratio of over 90% is actually <strong>2.2%</strong>, not <strong>-0.1%</strong>. In the <a target="_blank" href="https://docs.google.com/spreadsheets/d/1jWu02sK0J4tRIHTZ1J5XwUPfBeVV8Ef-trHJ5cAwR8g/edit#gid=0">Google Sheet</a> I shared, you wont' see the correct 2.2% average growth rate since I'm not doing the full analysis and focusing on the third Excel error stated above.</p><p>Fixing incorrect cell references for average GDP growth rates</p><p>The third error of incorrectly excluding high-growth countries from the average GDP growth rate is a particularly egregious mistake, and Reinhart and Rogoff admit that they made this simple cell referencing mistake. As you can see in the screenshot below, they simply omit rows 45 to 49 in their <strong>AVERAGE</strong> formula:</p><p><em>Source: </em><a target="_blank" href="https://statmodeling.stat.columbia.edu/"><em>https://statmodeling.stat.columbia.edu/</em></a></p><p>Here are three methods Reinhart and Rogoff could have used to ensure that they referenced the correct cells to avoid this mistake:</p><p>Method 1: Check the summary dropdown in the bottom-right</p><p>After you select all the cells that contain GDP growth rates in column G, you can look at the dropdown in the bottom right of Excel or Google Sheets to see the average. No formulas required:</p><p>You can also get other summary stats like the <strong>SUM</strong>, <strong>MIN</strong>, and <strong>MAX</strong> of your selected range of cells. Probably the easiest method to get a quick sanity check of your averages that you've calculated in lines 26-27 of the Google Sheet.</p><p>Method 2: Adding a checksum/checkaverage formula to compare results</p><p>This one is my preferred method, and is quite common in financial models. Usually you'll see this type of "error checking" when you want to make sure you've captured the correct cell references for a <strong>SUM</strong> formula, but with some extra work you can check for averages too.</p><p>You start by writing a formula <em>below</em> your actual summary stats (in this case starting on line 28 of the Google Sheet) and create a <strong>SUM</strong> formula of the data:</p><p>The big question is this: how do you know if you've referenced the correct cells in your "checksum" formula? The hope here is that by writing the <strong>SUM</strong> formula for the second time, in theory, you won't make the same mistake twice. Obviously this is a big assumption in this method, but let's assume you've properly made the reference for this internal error-checking formula.</p><p>The next formula below the "checksum" is a "count" formula:</p><p>Notice how it's not a <strong>COUNT</strong> formula. This is because the table contains the "n.a." text so a <strong>COUNTA</strong> formula would be incorrect since it would count all values in the column. We only want the numeric values, hence the reason for using <strong>COUNT</strong>.</p><p>Finally, the "checkaverage" formula compares your <em>actual</em> average in line 26 with the result of <strong>checksum</strong> / <strong>count</strong>. If the values aren't equal, then you'll get the text "Error" as the result of the <strong>IF</strong> formula:</p><p>Since line 26 references the "incorrect" averages used in Reinhart and Rogoff's paper, we get errors across the board. This "checksum" or "checkaverage" methodology gives you a visual indicator on whether your calculated results are properly referencing all the cells in the range instead of a subset. Instead of writing a "checksum" and "count" formula, you could simplify the "checkaverage" formula to this:</p><p>We simply put the <strong>SUM</strong> and <strong>COUNT</strong> formulas inside the first argument of the <strong>IF</strong> statement.</p><p>Method 3: Create a PivotTable and compare results</p><p>This method also relies on you selecting the proper cells to build your PivotTable. Again, assuming you don't make the same mistake twice, selecting the cells in the range should be a pretty simple task. After you select the cells (B4:G24 in this case), you build a PivotTable with <strong>Country</strong> in the Rows and the four debt/GDP buckets in the values. You then summarize each metric with the <strong>AVERAGE</strong> selection:</p><p>The "Grand Total" on the last line of the PivotTable contains the average across all growth rates. You can then compare these numbers to your computed numbers on the first sheet that contains your table.</p><p>Lessons to be learned for your own models</p><p>People don't check their analyses with the the above 3 methods because it takes extra work and...well...people are lazy. In addition to putting in error checks to ensure you are not making simple spreadsheet errors like this, there are other strategies you can use to ensure others can replicate your work to detect potential errors.</p><p></p><p>For Reinhart and Rogoff, they didn't make their full underlying data public. They only shared their spreadsheet after Herndon, Ash and Pollin reached out to them as the trio was trying to replicate their results. Some other strategies:</p><p>* Upload your results to a public repository like GitHub early on in your analysis and "open source" your data</p><p>* Write detailed steps on experimental design, procedures, equipment, data processing, and statistical methods used so others can replicate your experiment</p><p>I really liked this quote from a commenter about the Excel error on this <a target="_blank" href="https://statmodeling.stat.columbia.edu/2013/04/16/memo-to-reinhart-and-rogoff-i-think-its-best-to-admit-your-errors-and-go-on-from-there/">Stat Modeling blog</a></p><p>I’d like to see how many researchers expose themselves to such criticism. Uploading a raw dataset is one thing but allowing people to see all your intermediate calculations in messy detail is rare.</p><p>Too often we're caught up in doing all the number crunching ourselves and then sharing the output once we think we've crossed finished the analysis. As this example suggests, sharing your data set and model <em>as you are doing the analysis</em> can prevent a blunder like this from happening.</p><p>Auto date formatting and human gene naming problems</p><p>In the second half of this episode, I discuss an article in <a target="_blank" href="https://www.theverge.com/2020/8/6/21355674/human-genes-rename-microsoft-excel-misreading-dates"><em>The Verge</em></a> about how the HUGO Gene Nomenclature Committee had to rename gene names because of Excel's simple feature of auto-formatting dates. Gene names like "MARCH1" and "SEPT1" get re-formatted to the dates "1-Mar" and "1-Sep" when these values are entered into Excel. I thought this was interesting to see the scientific community bending to this standard feature in Excel given the widespread use of Excel in the scientific community.</p><p></p><p><em>Source: The Verge</em></p><p>Other Podcasts & Blog Posts</p><p>In the 2nd half of the episode, I talk about some episodes and blogs from other people I found interesting:</p><p>* The Verge: <a target="_blank" href="https://www.theverge.com/2020/8/6/21355674/human-genes-rename-microsoft-excel-misreading-dates">Scientists rename human genes to stop Microsoft Excel from misreading them as dates</a></p><p>* This Week In Startups #948: <a target="_blank" href="https://thisweekinstartups.com/e948-hackerone-ceo-marten-mickos-shares-insights-on-how-he-grew-his-bug-bounty-army-to-400000-strong-by-providing-a-path-to-hack-for-good-most-common-security-vulnerabilities-worst-security-breach/">HackerOne CEO Mårten Mickos shares insights on how he grew his bug bounty army to 400,000 strong by providing a path to hack for good, most common security vulnerabilities, worst security breaches, hacking the Pentagon, protecting the open source that unites us & scaling a company culture that defaults to disclosure</a></p><p>Subscribe: <a target="_blank" href="https://itunes.apple.com/us/podcast/dear-analyst/id1455099942?mt=2&#38;ls=1#episodeGuid=https%3A%2F%2Fwww.thekeycuts.com%2F%3Fp%3D49297">Apple Podcasts</a> | <a target="_blank" href="https://subscribeonandroid.com/www.thekeycuts.com/category/podcast/feed/">Android</a> | <a target="_blank" href="https://www.google.com/podcasts?feed=aHR0cHM6Ly93d3cudGhla2V5Y3V0cy5jb20vY2F0ZWdvcnkvcG9kY2FzdC9mZWVkLw">Google Podcasts</a> | <a target="_blank" href="https://www.stitcher.com/podcast/dear-analyst">Stitcher</a> | <a target="_blank" href="https://tunein.com/podcasts/Technology-News/Dear-Analyst-p1208784/">TuneIn</a> | <a target="_blank" href="https://podcasters.spotify.com/podcast/5RMq7wU2CMRxmDokdPgn5i">Spotify</a> | <a target="_blank" href="https://www.thekeycuts.com/category/podcast/feed/">RSS</a></p> <br/><br/>This is a public episode. If you would like to discuss this with other subscribers or get access to bonus episodes, visit <a href="https://alchen.substack.com?utm_medium=podcast&#38;utm_campaign=CTA_1">alchen.substack.com</a>]]></description><link>https://alchen.substack.com/p/dear-analyst-episode-40-a-spreadsheet</link><guid isPermaLink="false">substack:post:888138</guid><dc:creator><![CDATA[Al]]></dc:creator><pubDate>Mon, 24 Aug 2020 10:30:41 GMT</pubDate><enclosure url="https://api.substack.com/feed/podcast/888138/0e6de2970ddcc47a4225c6fdd3e88f7d.mp3" length="33333333" type="audio/mpeg"/><itunes:author>Al</itunes:author><itunes:explicit>No</itunes:explicit><itunes:duration>2571</itunes:duration><itunes:image href="https://substackcdn.com/feed/podcast/23684/post/888138/3f764e0afd8fb0ca9e9c0c8bc2061465.jpg"/></item><item><title><![CDATA[Episode #39: Generate a random list of names from a list of popular 90s TV characters]]></title><description><![CDATA[<p><em>This post originally appeared on the </em><a target="_blank" href="https://www.thekeycuts.com/dear-analyst-generate-a-random-list-of-names-from-a-list-of-popular-90s-tv-characters/"><em>KeyCuts blog</em></a><em>.</em></p><p>Let’s say you have a set list of names (in this case TV characters from popular 90s TV shows). You want Google Sheets/Excel to generate a random list of names from your list as if you were picking names out of a hat. How would you do this? It most likely would involve the RAND function, but let’s take it a step further and say you want to give the end user the ability to dictate the <em>number </em>of random names to return from your list (e.g. out of my list of 100, give me 5 random names). This is the <a target="_blank" href="https://docs.google.com/spreadsheets/d/14kYHOKBfJ3zmqvckQ11WVwwXdAjcJK2iUVsvbKo364U/edit#gid=0"><strong>Google Sheet</strong></a> with all the completed formulas. In addition to the audio format of this episode, I’m also going to start releasing the video tutorial:</p><p>Create your list in column B</p><p>Start with your list of names in column B. This can be any list you want to randomize. My list is just a bunch of TV characters from shows I watched when I was a kid.</p><p><em>Source: Fandom</em></p><p>In column A, you put the RAND function and copy it all the way down to the bottom of our list. You’ll get a decimal with random numbers. Doesn’t look that useful now, but this random number column will drive the rest of the tool to generate your list of random names:</p><p>Sort this random list of numbers</p><p>It sounds kind of weird, why would you sort a random list of numbers? What does that even mean? As you have probably seen, every time you refresh your Google Sheet or commit an Excel formula by hitting ENTER, all those random numbers in column A will change. This means if you sort this list of random numbers, the sorted list will change too. I put a space in column C so in cell D2, you enter this formula:</p><p>The SORT function takes in a range of cells as the first parameter, the sort index as the 2nd (which is just the number column we ant to sort on, column #1), and then true or false for sorting in ascending or descending order. You can also put 0 to indicate false which is what I did in this example to sort in descending order.</p><p>The nice thing about the SORT function is that it automatically fills the formula down to the bottom of your data set. This is a relatively new function in Excel since it kind of acts like <a target="_blank" href="https://support.microsoft.com/en-us/office/dynamic-array-formulas-in-non-dynamic-aware-excel-696e164e-306b-4282-ae9d-aa88f5502fa2"><strong>dynamic array formulas</strong></a> or <a target="_blank" href="https://support.microsoft.com/en-us/office/guidelines-and-examples-of-array-formulas-7d94a64e-3ff3-4686-9372-ecfd5caa57c7#:~:text=By%20now%2C%20you%20know%20you,to%20enter%20the%20entire%20formula."><strong>array-entered formulas</strong></a>. The formula kind of “spills” down for you as your list grows so you don’t have to worry about dragging the formula down until the last row in your data set.</p><p>A good ‘ol VLOOKUP</p><p>What does this column of sorted random numbers do for us? Well, we know that each random number in this <em>sorted</em> column corresponds to one of the numbers in column A where we generated the random number. So in column E, we just do a VLOOKUP using column D as our lookup value and columns A:B as our lookup table to get the name associated with the random number in column D:</p><p>This is not the usual way you might use VLOOKUP because you’re usually using VLOOKUP with some unique identifier as the lookup value. Column A isn’t really a unique “TV character ID” since that “ID” changes all the time with the RAND function. We don’t really care about that, because now when you refresh the Sheet, column E will always have a random list of names:</p><p>In the above gif I’m just pressing COMMAND + R a few times to refresh the Sheet so that the RAND function in column A constantly changes.</p><p>We could stop here since you now have a random list of names in column E. Let’s take this a step further and give the end user the ability to <em>choose the number </em>of random names from the list.</p><p>User input with OFFSET</p><p>We’re already doing some hacking with VLOOKUP and using it in a way that it probably wasn’t made to use, so let’s do something similar with the OFFSET<a target="_blank" href="https://support.microsoft.com/en-us/office/offset-function-c8de19ae-dd79-4b9b-a14e-b4d906d11b66"><strong>function</strong></a>. Cell H5 is just my “user input” cell where I’m getting the number of results from the user. This is a hard-coded number the user has to input. Then in cell H2, I have this OFFSET formula:</p><p>Let’s break this down by each parameter:</p><p>* <strong>E2</strong> – This is the “starting point” for my OFFSET function</p><p>* <strong>0</strong> – I don’t want to move any rows up/down</p><p>* <strong>0</strong> – I don’t want to move any columns up/down</p><p>* <strong>H1</strong> – References my user input cell indicating how many <em>rows</em> of data I want to return from my OFFSET (e.g. “height” of the range)</p><p>* <strong>1</strong> – How many columns to return (e.g. “width” of the range)</p><p>Now as you put a number in cell H1, the list of random names will grow and shrink. If you put a number that is more than the list of names you have, then it will just return the max number of names from your list (in random order, of course):</p><p>Picking the right tool for the job</p><p>A caveat I point out at the end of this episode is that while you <em>can </em>do this random list of names generator in Excel or Google Sheets, a spreadsheet may not be the best tool for the job. There are hundreds of random list generator apps that may be built specifically for your industry be it education or hospitality. Sometime it’s just easier to do it in a spreadsheet because all our data is there, but constantly question if the tool you are using is the right one for the job.</p><p>There’s a similar <a target="_blank" href="https://coda.io/@makon/randomteams"><strong>template</strong></a> in the Coda gallery which generates a random list of teams of players based on the number of teams and players you have. Just another nifty way at approaching the same problem in a different tool. <em>Disclosure: I work at Coda</em>.</p><p>Other Podcasts & Blog Posts</p><p>In the 2nd half of the episode, I talk about some episodes and blogs from other people I found interesting:</p><p>* Google Cloud Platform Podcast #226: <a target="_blank" href="https://www.gcppodcast.com/post/episode-226-documentation-in-developer-practices-with-riona-macnamara/"><strong>Documentation in Developer Practices with Riona Macnamara</strong></a></p><p>Subscribe: <a target="_blank" href="https://itunes.apple.com/us/podcast/dear-analyst/id1455099942?mt=2&#38;ls=1#episodeGuid=https%3A%2F%2Fwww.thekeycuts.com%2F%3Fp%3D49297"><strong>Apple Podcasts</strong></a> | <a target="_blank" href="https://subscribeonandroid.com/www.thekeycuts.com/category/podcast/feed/"><strong>Android</strong></a> | <a target="_blank" href="https://www.google.com/podcasts?feed=aHR0cHM6Ly93d3cudGhla2V5Y3V0cy5jb20vY2F0ZWdvcnkvcG9kY2FzdC9mZWVkLw"><strong>Google Podcasts</strong></a> | <a target="_blank" href="https://www.stitcher.com/podcast/dear-analyst"><strong>Stitcher</strong></a> | <a target="_blank" href="https://tunein.com/podcasts/Technology-News/Dear-Analyst-p1208784/"><strong>TuneIn</strong></a> | <a target="_blank" href="https://podcasters.spotify.com/podcast/5RMq7wU2CMRxmDokdPgn5i"><strong>Spotify</strong></a> | <a target="_blank" href="https://www.thekeycuts.com/category/podcast/feed/"><strong>RSS</strong></a></p> <br/><br/>This is a public episode. If you would like to discuss this with other subscribers or get access to bonus episodes, visit <a href="https://alchen.substack.com?utm_medium=podcast&#38;utm_campaign=CTA_1">alchen.substack.com</a>]]></description><link>https://alchen.substack.com/p/episode-39-generate-a-random-list</link><guid isPermaLink="false">substack:post:833008</guid><dc:creator><![CDATA[Al]]></dc:creator><pubDate>Mon, 10 Aug 2020 13:53:07 GMT</pubDate><enclosure url="https://api.substack.com/feed/podcast/833008/12c3453a35ab7cb35277e7357a6eeaeb.mp3" length="33333333" type="audio/mpeg"/><itunes:author>Al</itunes:author><itunes:explicit>No</itunes:explicit><itunes:image href="https://substackcdn.com/feed/podcast/23684/post/833008/55e57a75b38ea2a8ae9c4870190930ac.jpg"/></item><item><title><![CDATA[Episode #38: Breaking down an Excel error that led to a $6.2B loss at JPMorgan Chase]]></title><description><![CDATA[<p><em>This post originally appeared on the </em><a target="_blank" href="https://www.thekeycuts.com/dear-analyst-38-breaking-down-an-excel-error-that-led-to-six-billion-loss-at-jpmorgan-chase"><em>KeyCuts blog</em></a><em>.</em></p><p>You blink a few times at the screen and realize what you're seeing is not a type. $6.2B has left your bank due to some rogue trader making untimely bets on the market. That's B as in billion. You call up the modeler who was supposed to make sure this never happens to your bank. The modeler takes a closer look at his model, and realizes that he made a fundamental error in how he calculates <em>one </em>value that caused the dominoes to fall. This is the story of the "London Whale" at JPMorgan Chase in 2012 who cost the bank $6.2B and a breakdown of the Excel error that may have caused the whole thing.  This is the <a target="_blank" href="https://docs.google.com/spreadsheets/d/1b8kRDsGVInJAeMPBup4bSjXluiAM3JeGE_t_B5JcHWQ/edit#gid=0">Google Sheet</a> if you want to follow along with the Excel error.</p><p>Derivative of a derivative</p><p>I'm not going to pretend like a know the intricacies of all the financial products involved here, so you can read the <a target="_blank" href="https://en.wikipedia.org/wiki/2012_JPMorgan_Chase_trading_loss">Wikipedia article</a> if you want the full details. In 2012, there was a CDS (credit default swap) product called CDX IG 9 that the trader at JPMorgan may have made large bets on, and ended up on the wrong side of the bet. The London trader's name is Bruno Iksil, and it was a classic scenario of a gambler trying to get out of his losses by doubling down on black at the roulette table. </p><p>Source: The Fiscal Times</p><p>Multiple investigations were taken by the authorities in the U.S. and U.K., the the investigations show that a variety of institutional failures may have facilitated the large bets made by the London Whale. This <a target="_blank" href="https://hbr.org/2013/01/the-jp-morgan-whale-report-and">HBR article</a> by Ben Heineman, Jr. provides a nice summary of all the key players:</p><p>* <strong>London traders </strong>- The traders simply didn't understand the complexity of the derivative products they were buying and selling</p><p>* <strong>Chief Investment Office(CIO)</strong> - The head of the CIO didn't monitor the trading strategies and put in the proper controls for the portfolio of products the office was buying. The Value at Risk (VaR) model was flawed (see more below).</p><p>* <strong>Firm-wide Leaders</strong> - Not enough oversight by the CFO and CEO (Jamie Dimon) </p><p>* <strong>Board and Risk Policy Committee</strong> - The committee was told that everything was fine with the CIO, and didn't get accurate pictures of what risk officers really felt about the risky trades being made.</p><p>Appendix of the Task Force Report by JPMorgan</p><p>There is a <a target="_blank" href="https://www.corporatecontrol.de/app/download/5790652848/Task_Force_Report.pdf">130-page report</a> created by JPMorgan Chase in 2012 which details what happened internally that led to this debacle. In my opinion, the juicy stuff starts in the appendix starting on page 121 of the report. I read off some parts of this appendix in this episode, but the appendix basically details issues with the VaR models created by one of the quantitative modelers at JPMorgan to more accurately value the complex traders that were happening. Or at least they thought the model was more accurate.</p><p>At the very end of the appendix, there's a section called "Discovery of Problems with the New VaR Model and Discontinuance" where the report details the Excel error that contributed to the large inaccuracies in how the model valued risk. </p><p>The $6.2B Excel error</p><p>This is how the error is described in the report (emphasis mine):</p><p>Following that decision, further errors were discovered in the Basel II.5 model, including, most significantly, an operational error in the calculation of the relative changes in hazard rates and correlation estimates. Specifically, <strong><em>after subtracting the old rate from the new rate, the spreadsheet divided by their sum instead of their average</em></strong>, as the modeler had intended.</p><p><em>Note: I don't have domain expertise in VaR models, synthetic credit derivatives, or trading in general. The following example is my over-simplification of the error based on what's written in the report.</em></p><p>The report talks about <a target="_blank" href="https://www.investopedia.com/terms/h/hazard-rate.asp#:~:text=The%20hazard%20rate%20refers%20to,a%20given%20age%20(x).&#38;text=The%20hazard%20rate%20only%20applies,to%20as%20the%20failure%20rate.">hazard rates</a> (for what I assume relate to the default of corporate loans in this case) and how the changes in the hazard rates were improperly calculated. Here's a simple table from the <a target="_blank" href="https://docs.google.com/spreadsheets/d/1b8kRDsGVInJAeMPBup4bSjXluiAM3JeGE_t_B5JcHWQ/edit#gid=0">Google Sheet</a> showing fictitious dates, hazard rates, and the change in rates:</p><p>Now here's what happens when you apply a SUM vs. an AVERAGE to the "Change in %" column:</p><p>This is hitting the border of my knowledge of growth rates and time periods, but the <em>sum of changes</em> will always be 5X the <em>average of changes</em> given there are 5 values we are summing/averaging. </p><p>The difficulty with detecting this type of formula error</p><p>The magnitude of the difference between the SUM and the AVERAGE is not what I think is interesting, but rather the <em>absolute difference </em>between the SUM and AVERAGE. Here is a chart plotting the same data:</p><p>Based on this chart, can you estimate what the <em>average</em> of the Change in % is? Looks like something around 0%, but 3% doesn't feel <em>that </em>far off. The point I'm trying to make is that unless you are monitoring the SUM and AVERAGE consistently over time to detect any outliers, it will be difficult to know whether you made the formula mistake in the first place. With the presence of outliers, it makes it more clear that you might have an error in your model. Here's the other table from the Google Sheet with intentionally skewed hazard rates:</p><p>Here we see the magnitude of the difference is still 5X, but the <em>absolute difference</em> is much wider. This would cause an analyst to look deeper into the model and try to figure out why there is such a large discrepancy. But this is only because there are fictitious hazard rates. In the case of JPMorgan Chase, my hunch is that the gap between the lower and upper bound of daily hazard rates was really narrow, so detecting a change like this would've been very difficult without the proper controls in place.</p><p>This reminds me of the tale of the boiling frog:</p><p>Urban myth has it that if you put a frog in a pot of boiling water it will instantly leap out. But if you put it in a pot filled with pleasantly tepid water and gradually heat it, the frog will remain in the water until it boils to death. (<a target="_blank" href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC534568/#:~:text=Urban%20myth%20has%20it%20that,until%20it%20boils%20to%20death.">Source</a>)</p><p>Without a really hot pot of boiling water, it was too late for JPMorgan to detect there was something wrong with the CDS trades, and the proverbial frog boils to death.</p><p>Hanlon's Razor</p><p>One frame for this egregious Excel error is Hanlon's Razor:</p><p>"Never attribute to malice that which is adequately explained by stupidity", known in several other forms. It is a philosophical <strong>razor</strong> which suggests a way of eliminating unlikely explanations for human behavior. (<a target="_blank" href="https://en.wikipedia.org/wiki/Hanlon%27s_razor#:~:text=Hanlon&#39;s%20razor%20is%20an%20aphorism,unlikely%20explanations%20for%20human%20behavior.">Source</a>)</p><p>Perhaps the modeler cannot be blamed for his Excel error because it was an error that he had know way of knowing or predicting. I'm not trying to remove blame from the modeler, but it's an interesting frame to analyze the problem because this is an spreadsheet error that is difficult to prevent unless you have other models and risk controls that are able to predict this type of error in advance. There are many other cases of Excel errors that led to false calculations that cost firms millions of dollars, and it's hard to say if one can blame the modeler for "malice" or plain stupidity.</p><p>New intermediate Excel class on Skillshare</p><p>Quick plug for a new Excel class I just launched today on <a target="_blank" href="https://skl.sh/33d0fju"><strong>Skillshare</strong></a>. It’s an intermediate Excel class for cleaning and analyzing data.</p><p>Other Podcasts & Blog Posts</p><p>In the 2nd half of the episode, I talk about some episodes and blogs from other people I found interesting:</p><p>* a16z Podcast: <a target="_blank" href="https://tim.blog/2020/06/26/hugh-jackman/">The Future of Decision-Making--3 Startup Opportunities</a></p><p><a target="_blank" href="https://podcasts.google.com/feed/aHR0cDovL2ZlZWRzLmZlZWRidXJuZXIuY29tL0tleWN1dHM/episode/aHR0cHM6Ly93d3cudGhla2V5Y3V0cy5jb20vP3A9NDkyNDE?hl=en&#38;ved=2ahUKEwjyneTmsoHrAhX0hXIEHYDcAMQQjrkEegQICxAE&#38;ep=6">Listen to this episode here</a></p><p>Subscribe: <a target="_blank" href="https://itunes.apple.com/us/podcast/dear-analyst/id1455099942?mt=2&#38;ls=1#episodeGuid=https%3A%2F%2Fwww.thekeycuts.com%2F%3Fp%3D49014">Apple Podcasts</a> | <a target="_blank" href="https://subscribeonandroid.com/www.thekeycuts.com/category/podcast/feed/">Android</a> | <a target="_blank" href="https://www.google.com/podcasts?feed=aHR0cHM6Ly93d3cudGhla2V5Y3V0cy5jb20vY2F0ZWdvcnkvcG9kY2FzdC9mZWVkLw">Google Podcasts</a> | <a target="_blank" href="https://www.stitcher.com/podcast/dear-analyst">Stitcher</a> | <a target="_blank" href="https://tunein.com/podcasts/Technology-News/Dear-Analyst-p1208784/">TuneIn</a> | <a target="_blank" href="https://podcasters.spotify.com/podcast/5RMq7wU2CMRxmDokdPgn5i">Spotify</a> | <a target="_blank" href="https://www.thekeycuts.com/category/podcast/feed/">RSS</a></p> <br/><br/>This is a public episode. If you would like to discuss this with other subscribers or get access to bonus episodes, visit <a href="https://alchen.substack.com?utm_medium=podcast&#38;utm_campaign=CTA_1">alchen.substack.com</a>]]></description><link>https://alchen.substack.com/p/episode-38-breaking-down-an-excel</link><guid isPermaLink="false">substack:post:811100</guid><dc:creator><![CDATA[Al]]></dc:creator><pubDate>Tue, 04 Aug 2020 11:16:02 GMT</pubDate><enclosure url="https://api.substack.com/feed/podcast/811100/28adf0ff13bf64aab38d30f1615b14bf.mp3" length="33333333" type="audio/mpeg"/><itunes:author>Al</itunes:author><itunes:explicit>No</itunes:explicit><itunes:duration>2350</itunes:duration><itunes:image href="https://substackcdn.com/feed/podcast/23684/post/811100/61d554acc12b4824cb2bb3b6f04c88ff.jpg"/></item><item><title><![CDATA[Dear Analyst #37: Text manipulation functions to extract domain names from email addresses]]></title><description><![CDATA[<p><em>This post originally appeared on the </em><a target="_blank" href="https://www.thekeycuts.com/dear-analyst-text-manipulation-functions-to-extract-domain-names-from-email-addresses"><em>KeyCuts blog</em></a><em>.</em></p><p>In Excel or Google Sheets, text manipulation is usually associated with data cleaning, data cleansing, and data transformation. Sometimes your data is “dirty” and needs to be categorized in a different way or you need to “extract” a piece of text from a another piece of text. In this example, we use a combination of the FIND, RIGHT, and LEN functions to extract the domain name from an email address (e.g. the “tesla.com” from “john.smith@tesla.com”). Here’s the <a target="_blank" href="https://docs.google.com/spreadsheets/d/1kIhc15laZeaWyPqm1edmRMCpog8wiTCOgpFjG7DMzGo/edit#gid=0"><strong>Google Sheet</strong></a> if you want to make a copy for yourself to follow along.</p><p>Start with finding the @</p><p>The first step is to use the FIND function to find the location of the “@” symbol in the email address. The FIND function takes two required arguments and one optional argument. You’re basically find the <em>index location </em>of where that characters or string exists within the cell:</p><p>In the case of “john.smith@amazon.com,” the FIND function would return 11 since the “@” symbol starts at the 11th position within the email address. Pretty simple right?</p><p>Nesting LEN inside the RIGHT function</p><p>The next part is a little trickier. Now that we know the position of the “@” symbol, we want all the characters <em>after</em> the “@” symbol to get the domain of the email address. There are multiple ways of doing this, but I chose to use the RIGHT and LEN functions. To make this more clear, I could have put the LEN function in its own column, but decided to next it within the RIGHT function:</p><p>The RIGHT function takes two arguments and simply returns the number of characters from the “right” of the text you give it (in this case the email address). Since we don’t know how many characters to pull from each e-mail address, we use the result of the LEN(A2) - B2 formula which tells us how many characters to pull from the right of the email address.</p><p>LEN(A2) gives us the length of the entire text (for “john.smith@amazon.com” it’s 21). If we subtract the index position of the “@” symbol from that length, we’ll get the exact number of characters to pull for each unique email address. Pretty nifty.</p><p><em>Note: The “Position of @” column also could’ve been nested in the 3rd column (and replaced the current cell reference of </em><em>B2</em><em>).</em></p><p>I typically use a combination of FIND, LEN, and MID to extract the text I need from a longer piece of text. Once you master these few functions, you’ll be able to to pull anything you want out of a long piece of text to get “clean” data.</p><p>Other Podcasts & Blog Posts</p><p>In the 2nd half of the episode, I talk about some episodes and blogs from other people I found interesting:</p><p>* The Tim Ferriss Show #444: <a target="_blank" href="https://tim.blog/2020/06/26/hugh-jackman/"><strong>Hugh Jackman on Best Decisions, Daily Routines, The 85% Rule, Favorite Exercises, Mind Training, and Much More</strong></a></p><p>* EconTalk: <a target="_blank" href="https://www.econtalk.org/robert-lerman-on-apprenticeships/"><strong>Robert Lerman on Apprenticeships</strong></a></p> <br/><br/>This is a public episode. If you would like to discuss this with other subscribers or get access to bonus episodes, visit <a href="https://alchen.substack.com?utm_medium=podcast&#38;utm_campaign=CTA_1">alchen.substack.com</a>]]></description><link>https://alchen.substack.com/p/dear-analyst-37-text-manipulation</link><guid isPermaLink="false">substack:post:773535</guid><dc:creator><![CDATA[Al]]></dc:creator><pubDate>Mon, 27 Jul 2020 10:19:10 GMT</pubDate><enclosure url="https://api.substack.com/feed/podcast/773535/b8ba4d8ac1e9cd54c5ee3dcefc8624c9.mp3" length="33333333" type="audio/mpeg"/><itunes:author>Al</itunes:author><itunes:explicit>No</itunes:explicit><itunes:duration>1142</itunes:duration><itunes:image href="https://substackcdn.com/feed/podcast/23684/post/773535/1b0850a50fb70c7e59ccc3226caceb77.jpg"/></item><item><title><![CDATA[Dear Analyst #36: What The Economist’s model for the 2020 presidential election can teach us about forecasting]]></title><description><![CDATA[<p></p> <br/><br/>This is a public episode. If you would like to discuss this with other subscribers or get access to bonus episodes, visit <a href="https://alchen.substack.com?utm_medium=podcast&#38;utm_campaign=CTA_1">alchen.substack.com</a>]]></description><link>https://alchen.substack.com/p/dear-analyst-36-what-the-economists</link><guid isPermaLink="false">substack:post:689772</guid><dc:creator><![CDATA[Al]]></dc:creator><pubDate>Mon, 13 Jul 2020 11:30:07 GMT</pubDate><enclosure url="https://api.substack.com/feed/podcast/689772/80ee681a4bec4c84771cba2a9453522f.mp3" length="33333333" type="audio/mpeg"/><itunes:author>Al</itunes:author><itunes:explicit>No</itunes:explicit><itunes:duration>2850</itunes:duration><itunes:image href="https://substackcdn.com/feed/podcast/23684/post/689772/13da39e33267149c38e4e45f5d51d974.jpg"/></item><item><title><![CDATA[Episode #34: Trick for finding column index for VLOOKUPs using U.S. pride events data]]></title><description><![CDATA[<p></p> <br/><br/>This is a public episode. If you would like to discuss this with other subscribers or get access to bonus episodes, visit <a href="https://alchen.substack.com?utm_medium=podcast&#38;utm_campaign=CTA_1">alchen.substack.com</a>]]></description><link>https://alchen.substack.com/p/episode-34-trick-for-finding-column</link><guid isPermaLink="false">substack:post:574693</guid><dc:creator><![CDATA[Al]]></dc:creator><pubDate>Mon, 22 Jun 2020 14:47:28 GMT</pubDate><enclosure url="https://api.substack.com/feed/podcast/574693/e935b7ff592c0e47edd673795562d0b4.mp3" length="33333333" type="audio/mpeg"/><itunes:author>Al</itunes:author><itunes:explicit>No</itunes:explicit><itunes:duration>1400</itunes:duration><itunes:image href="https://substackcdn.com/feed/podcast/23684/post/574693/13da39e33267149c38e4e45f5d51d974.jpg"/></item><item><title><![CDATA[Dear Analyst #33: Comparing models for one-time vs. monthly recurring donations to support racial justice organizations]]></title><description><![CDATA[<p></p> <br/><br/>This is a public episode. If you would like to discuss this with other subscribers or get access to bonus episodes, visit <a href="https://alchen.substack.com?utm_medium=podcast&#38;utm_campaign=CTA_1">alchen.substack.com</a>]]></description><link>https://alchen.substack.com/p/dear-analyst-33-comparing-models</link><guid isPermaLink="false">substack:post:532573</guid><dc:creator><![CDATA[Al]]></dc:creator><pubDate>Mon, 08 Jun 2020 16:10:31 GMT</pubDate><enclosure url="https://api.substack.com/feed/podcast/532573/030c94c43a02f2e8c1889eb05e3abe8b.mp3" length="33333333" type="audio/mpeg"/><itunes:author>Al</itunes:author><itunes:explicit>No</itunes:explicit><itunes:duration>2731</itunes:duration><itunes:image href="https://substackcdn.com/feed/podcast/23684/post/532573/13da39e33267149c38e4e45f5d51d974.jpg"/></item><item><title><![CDATA[Dear Analyst #32: How to use the QUERY function in Google Sheets on COVID-19 data]]></title><description><![CDATA[<p>The QUERY()<a target="_blank" href="https://support.google.com/docs/answer/3093343?hl=en"><strong>function</strong></a> in Google Sheets gives you the ability to quickly filter and sort your data similar to how you might get data from a database. If you write SQL queries, the QUERY() function feels easy and natural to use. There are a few caveats as I discuss in this episode. If you want to follow along with the exercises I discuss in this episode, make a copy of <a target="_blank" href="https://docs.google.com/spreadsheets/d/1XJ_ictchF56cheJF8bfkjHB4wBH06K2ywY9U4y03EH8/edit#gid=0"><strong>this Google Sheet</strong></a> which contains the QUERY() functions I mention in the episode.</p><p>Basic query to find confirmed cases greater than 50,000</p><p>Our data set is from the <a target="_blank" href="https://github.com/CSSEGISandData/COVID-19">COVID-19 Data Repository</a> by the Center for Systems Science and Engineering (CSSE) at Johns Hopkins University. The data shows confirmed cases, deaths, and recovered cases by country (188 countries) on May 1st:</p><p>The first query simply pulls back the list of countries and confirmed cases where the number of confirmed cases is greater than 50,000. Notice how you reference the column letter name versus the actual name of the column in the header row:</p><p>The first parameter is covid_data which is a <a target="_blank" href="https://support.google.com/docs/answer/63175?co=GENIE.Platform%3DDesktop&#38;hl=en">named range</a> in Google Sheets. In this case, it references cells A1:E188 in our data set.</p><p>More SQL-like commands</p><p>You can do many database-like commands with the QUERY() function. The next example shows how you can use the ORDER BY command to find countries with deaths between 0 and 5 and the resulting list is sorted in descending order:</p><p>Check out Ben Collins’ <a target="_blank" href="https://www.benlcollins.com/spreadsheets/google-sheets-query-sql/">blog post</a> about the QUERY() function to see some of the other SQL commands you can use.</p><p>Adding in new calculated columns</p><p>In the third query, we get a little more advanced and use the LABEL command to create a new “column” called Case Fatality Rate. This calculation is simply Confirmed / Deaths. Unlike SQL, you put the LABEL at the end of the command instead of in the beginning of the SELECT statement:</p><p>Coming from SQL, you’ll need to account for the difference in the order of commands in the query in order for it to work correctly.</p><p>Inability to select column names</p><p>You’ll notice that you don’t put the actual names of the columns in your header row in the query. This can be a pro or con of the QUERY() function depending on how your underlying data set is structured.</p><p>Columns are changing a lot</p><p>If you underlying data is constantly “shuffling” where columns are moving around and the structure of the data is not set in stone, the QUERY() function will most likely break because you’re referencing the column letter instead of the column name like in a traditional SQL query.</p><p>Columns are fixed</p><p>If your columns are not shuffling around a lot, this syntax of selecting the column letter may actually be easier for you. This is because you don’t have to type out the long column name in the QUERY() function. If data is simply getting appended to the bottom of your data set, then the QUERY() function should work fine for you because the letters of the columns will always reference the correct columns of data.</p><p>PivotTables vs. the QUERY() function</p><p>One of the reasons I don’t use the QUERY() function too often is because I find PivotTables to be easy enough to use to filter, sort, and aggregate my data to do my analysis. Additionally, your columns can move around in the underlying data set and the PivotTable will still work since it’s not referencing columns by letter but rather by the name in your header row.</p><p>Plotting trend lines for COVID-19</p><p>One of the articles I discuss in this episode is this <a target="_blank" href="https://www.vox.com/2020/5/8/21250641/kevin-hassett-cubic-model-smoothing">Vox article</a> about how the Council of Economic Advisers may have applied a stock trendline in Excel to “forecast” deaths as a result of COVID-19. The article discusses the concept of “smoothing out” volatile data versus prescribing a forecast, and that line between these two concepts is a bit blurry. This is the cubic chart in Excel which you can easily build from the trendline features in Excel:</p><p><em>Source: Vox</em></p><p>And then this is the chart from a CEA Tweet that appears to show the cubic trendline as a potential forecast:</p><p></p><p>SUM by David Eagleman</p><p>A book I discuss at the end of this episode is <a target="_blank" href="https://www.amazon.com/Sum-Tales-Afterlives-David-Eagleman/dp/1491503629"><em>SUM: Tales from the Afterlives</em></a> by David Eagleman. I read a chapter from the book called Incentive and how it relates to some recent shows I’ve been watching like Westworld and Devs. Highly recommend checking out the book.</p><p>Other Podcasts & Blog Posts</p><p>In the 2nd half of the episode, I talk about some episodes and blogs from other people I found interesting:</p><p>* <a target="_blank" href="https://www.vox.com/2020/5/8/21250641/kevin-hassett-cubic-model-smoothing"><em>The Trump administration’s “cubic model” of coronavirus deaths, explained</em></a> by Matthew Yglesias</p><p>* Jocko Podcast #222: <a target="_blank" href="https://jockopodcast.com/2020/03/24/222-life-is-a-challenge-life-is-suffering-so-live-with-fortitude-with-dan-crenshaw/">Life is a Challenge. Life is Suffering. So Live With Fortitude. With Dan Crenshaw</a></p><p>* <a target="_blank" href="https://www.amazon.com/Sum-Tales-Afterlives-David-Eagleman/dp/1491503629"><em>SUM: Forty tales from the afterlives</em></a> by David Eagleman</p><p>Subscribe: <a target="_blank" href="https://itunes.apple.com/us/podcast/dear-analyst/id1455099942?mt=2&#38;ls=1#episodeGuid=https%3A%2F%2Fwww.thekeycuts.com%2F%3Fp%3D49090">Apple Podcasts</a> | <a target="_blank" href="https://subscribeonandroid.com/www.thekeycuts.com/category/podcast/feed/">Android</a> | <a target="_blank" href="https://www.google.com/podcasts?feed=aHR0cHM6Ly93d3cudGhla2V5Y3V0cy5jb20vY2F0ZWdvcnkvcG9kY2FzdC9mZWVkLw">Google Podcasts</a> | <a target="_blank" href="https://www.stitcher.com/podcast/dear-analyst">Stitcher</a> | <a target="_blank" href="https://tunein.com/podcasts/Technology-News/Dear-Analyst-p1208784/">TuneIn</a> | <a target="_blank" href="https://podcasters.spotify.com/podcast/5RMq7wU2CMRxmDokdPgn5i">Spotify</a> | <a target="_blank" href="https://www.thekeycuts.com/category/podcast/feed/">RSS</a></p><p></p> <br/><br/>This is a public episode. If you would like to discuss this with other subscribers or get access to bonus episodes, visit <a href="https://alchen.substack.com?utm_medium=podcast&#38;utm_campaign=CTA_1">alchen.substack.com</a>]]></description><link>https://alchen.substack.com/p/dear-analyst-32-how-to-use-the-query</link><guid isPermaLink="false">substack:post:525933</guid><dc:creator><![CDATA[Al]]></dc:creator><pubDate>Sun, 07 Jun 2020 18:05:32 GMT</pubDate><enclosure url="https://api.substack.com/feed/podcast/525933/c3cdc4469beaf0cb901223be61d7404d.mp3" length="33333333" type="audio/mpeg"/><itunes:author>Al</itunes:author><itunes:explicit>No</itunes:explicit><itunes:duration>2707</itunes:duration><itunes:image href="https://substackcdn.com/feed/podcast/23684/post/525933/510c5faac36fbb6b4cb1357f883f954e.jpg"/></item><item><title><![CDATA[Dear Analyst episode #31: Writing Google Apps Scripts to sync data from Coda to Google Sheets]]></title><description><![CDATA[<p><em>This post originally appeared on the </em><a target="_blank" href="https://www.thekeycuts.com/dear-analyst-31-writing-google-apps-scripts-to-sync-data-from-coda-to-google-sheets/"><em>KeyCuts blog</em></a><em>.</em></p><p>I worked on a "small" side project recently to sync data between Google Sheets and tables in Coda. The full blog post tutorial is <a target="_blank" href="https://coda.io/@atc/how-to-sync-data-from-coda-to-google-sheets-and-vice-versa-with-google-apps-script-tutorial">here</a>, and the GitHub repository is <a target="_blank" href="https://github.com/albertc44/coda-google-apps-script">here</a>. I started using <a target="_blank" href="https://developers.google.com/apps-script">Google Apps Script</a> last year and it's a super powerful way to connect different apps you use in the G Suite ecosystem. The impetus for creating these two scripts was seeing a few people in the Coda community talk about syncing data between their Google Sheets and Coda. The big caveat is that these are only one-way syncs, but there are several use cases where doing this could be useful in business workflows and making your team more productive.</p><p>Writing a script in Google Apps Script</p><p>Some Google Apps scripts can be super simple to set up. See this pretty simple workflow below of sending email automatically when there is data in your Google Sheet:</p><p>Most of the "work" with writing these scripts was transforming data so that the model in Google Sheets matches the model in Coda as per <a target="_blank" href="https://coda.io/developers/apis/v1beta1">Coda's API</a>. Once that data munging is done, the rest of the script was relatively easy in terms of giving users the ability to add, delete, and modify data. I would highly recommend taking a look at Google Apps Script <em>especiall</em>yif you use a lot of Google Sheets. You'll be able to connect your Google Sheet with other applications in G Suite and other 3rd-party apps you use for work.</p><p>Use cases for syncing data between Coda and Google Sheets</p><p>This comes straight from the <a target="_blank" href="https://coda.io/@atc/how-to-sync-data-from-coda-to-google-sheets-and-vice-versa-with-google-apps-script-tutorial">blog post</a>, but thought it was worth repeating again:</p><p>Data synced from your Google Sheet</p><p>* <strong>HR & recruiting</strong> - All your candidates are stored in a Google Sheet but you want to be able to move candidates through different stages in the interviewing pipeline and Google Sheets isn't sufficient for your needs. Having all your candidates in a table in Coda means you can use templates like <a target="_blank" href="https://coda.io/@evanatcoda/coordinating-candidates">this one</a> to manage candidates more effectively.</p><p>* <strong>E-commerce and ERP</strong> - Orders, customers, and POs may all be different tabs in a Google Sheet that gets updated through Shopify or some other e-commerce platform. In order to <em>manage</em> your e-commerce business, you may want to see charts, calendar of shipments, and reports that Google Sheets cannot provide easily. Syncing the data from Google Sheets to Coda means you can do ERP properly (see <a target="_blank" href="https://coda.io/@wilson-silva/mini-e-commerce-erp">this template</a> as an example).</p><p>* <strong>Customer Feedback</strong> - You may have a ticketing system like Zendesk or Intercom and all feedback lands in a Google Sheet somewhere. You can do some basic analytics in the Google Sheet but to <em>reply </em>to the feedback means you have to go into Gmail and start replying to customers. If your customer feedback is all in a Coda doc, you can run analytics <em>and </em>send emails using the <a target="_blank" href="https://coda.io/packs/gmail">Gmail Pack</a> (see <a target="_blank" href="https://coda.io/@hales/customer-feedback-hub">this template</a>).</p><p>Data synced to your Google Sheet</p><p>* <strong>3rd-party vendor reporting</strong> - Your vendors may not be using Coda yet, but you have all your vendor data in Coda and need to send them the data in a format they prefer. While you could <a target="_blank" href="https://help.coda.io/en/articles/3727616-intro-to-publishing">publish your Coda doc</a>, the vendor still wants the data in a Google Sheet you have edit access to.</p><p>* <strong>Data "backup"</strong> - Your team may create thousands of rows of data every quarter in a Coda doc and want to start each quarter "fresh." Coda docs grow with your teams and they may get slow as you add in more functionality, so having a backup of your data in Google Sheets is another reason to sync data from your Coda doc to Google Sheets.</p><p>* <strong>Finance & Accounting</strong> - Most internal finance and accounting functions still use Excel and spreadsheets for month-end reporting, taxes, and other business-critical activities. As your data grows in Coda, you can keep your finance counterparts in the loop by having your data synced to a Google Sheet which your finance team can use for their reporting and forecasting purposes.</p><p>Other Podcasts & Blog Posts</p><p>In the 2nd half of the episode, I talk about some episodes and blogs from other people I found interesting:</p><p>* Visual Developer's Podcast #25: <a target="_blank" href="https://visualdev.fm/episodes/episode-25-sheets-vs-coda-vs-airtable">Sheets vs. Airtable vs. Coda</a></p><p>* Jocko Podcast #226: <a target="_blank" href="https://jockopodcast.com/2020/04/21/226-the-code-the-evaluation-the-protocols-the-path-with-dave-berke/">The Code. The Evaluation. The Protocols. The PATH. With David Berke</a></p> <br/><br/>This is a public episode. If you would like to discuss this with other subscribers or get access to bonus episodes, visit <a href="https://alchen.substack.com?utm_medium=podcast&#38;utm_campaign=CTA_1">alchen.substack.com</a>]]></description><link>https://alchen.substack.com/p/dear-analyst-episode-31-writing-google</link><guid isPermaLink="false">substack:post:466810</guid><dc:creator><![CDATA[Al]]></dc:creator><pubDate>Mon, 18 May 2020 13:19:53 GMT</pubDate><enclosure url="https://api.substack.com/feed/podcast/466810/0f7cd427df6826dde10816e2f4d763b4.mp3" length="33333333" type="audio/mpeg"/><itunes:author>Al</itunes:author><itunes:explicit>No</itunes:explicit><itunes:duration>2395</itunes:duration><itunes:image href="https://substackcdn.com/feed/podcast/23684/post/466810/91212b38ae5612e1e6859d94df64303f.jpg"/></item><item><title><![CDATA[Episode #30: How to learn Excel while staying at home during COVID-19]]></title><description><![CDATA[<p><em>This post originally appeared on the </em><a target="_blank" href="https://www.thekeycuts.com/dear-analyst-how-to-learn-excel-while-staying-at-home-during-covid-19/"><em>KeyCuts blog</em></a><em>.</em></p><p>Now that you're staying home and picking up new hobbies and taking classes online, here are a few tips on how to learn Excel and spreadsheets from an online class. I have seen viewership on my own <a target="_blank" href="http://skl.sh/2lsi6up">Excel classes</a> spike since COVID-19 hit which has led me to think about the best way to learn online.  </p><p>First of all, why are so many people trying to learn Excel? Maybe since all schools and universities have pushed to online learning, students may be questioning the value of their college degrees. Maybe I should start learning skills that will actually help me land a job...enter stage left: Excel and spreadsheets.</p><p>Spreadsheets most sought after skill</p><p>In <a target="_blank" href="https://www.thekeycuts.com/dear-analyst-episode-22-calculate-win-streaks-for-a-pool-of-players-in-google-sheets/">episode 22</a>, I brought up an <a target="_blank" href="https://freakonomics.com/podcast/math-curriculum/">episode</a> of Freakonomics where they discussed different stats around subjects Freakonomics listeners wished they had learned in high school to better prepare them for their current jobs. The high-level numbers:</p><p>Skills currently used on their jobs</p><p>* <strong>Less than 5% - </strong>Percent of survey responders who said they still use calculus, trigonometry, or geometry in their current jobs</p><p>* <strong>70%</strong> - Those who use Excel or Google Sheets on a daily basis</p><p>* <strong>75%</strong> - Those who visualize data or present data to make an argument on a daily, weekly, or monthly basis</p><p>Skills people wished they had learned in high school</p><p>* <strong>0%</strong> - Those who wished they had learned other traditional math subjects in high school beyond what they had already learned</p><p>* <strong>65%</strong> - Those who wished they had learned skills around analyzing and interpreting data to uncover insights</p><p>* <strong>60%</strong> - Those who wished they had learned how to visualize and present data</p><p>It's pretty clear that data-related skills are what's actually being used on the job, and during a pandemic where you may have been furloughed, laid off, graduating from university, or really any scenario where your future is unclear and you want to secure a job, learning Excel and data skills may bubble to the top on your to-do list while you're in quarantine at home. Hopefully these tips will help you gain the skills you need to learn Excel and spreadsheets to help land your next job.</p><p>1) Block out time on your calendar to take your class</p><p>If you're a fan of David Allen's <a target="_blank" href="https://gettingthingsdone.com/"><em>Getting Things Done</em></a> philosophy, you've probably head the phrase that if it doesn't gets scheduled, it doesn't get done. Blocking off time on your Google or Outlook calendar to actually take your Excel class versus taking the class when you feel like it will ensure you get through the material and get into a state of flow with the material.</p><p>2) Minimize distractions</p><p>While it's easy to stay connected with family and friends while at home, you really need to put away your phone and apps for doing all your meetings and virtual hangouts. Turning off notifications for Facetime, Facebook, Houseparty, Slack, etc. will ensure you can get some uninterrupted time to learn Excel. There are small nuances to writing Excel formulas that can be easy to overlook when you are distracted by your friends or social media.</p><p>3) Connect with the instructor and community</p><p>Many online Excel classes encourage you to ask the instructor questions and many platforms such as Skillshare encourage students to participate in the community of other students who are taking the class with you. For my Excel classes, there are several discussions where students ask me questions and either I or another student taking the class will jump in an answer. Active participation ensures you are engaged with the class and the instructor and students can help keep you accountable.</p><p>4) Have Excel open alongside the video</p><p>It's easy to simply watch a screenshare of an instructor doing something in Excel and say: "I get that, that looks easy to do." It's one thing to see the instructor write a VLOOKUP() formula but a completely different experience when you write the formula yourself. Have Excel or Google Sheets open next to the window where you are taking the class is important for you to get hands-on experience with using Excel. Pause the video and try doing what the instructor is doing in Excel.</p><p>5) Practice with real use cases from your daily life</p><p>Probably the most important tip. In order to take what you learn from the online Excel class marketable to the real world, you need to use spreadsheets for <em>real-life scenarios</em>. The main way I learned Excel was from looking at other people's spreadsheets in a work environment. If you know someone who can share an Excel file they use at work (removing sensitive info, of course), this would give you a way to see how people use Excel in the real world. Then you can talk more intelligently about how you might design a spreadsheet during an interview.</p><p>Don't have access to Excel files from people who use Excel every day? Try Googling "financial model Excel example" or "track customers Excel example" and you'll get all sorts of nice templates. Better yet, take Google Sheets or Excel and start tracking something in your daily life. The number of home workouts you do every week. What you are spending on online deliveries. Track COVID-19 stats for your county or state. By building these simple reporting tools, you'll get a feel for how to use spreadsheets for a real world use case.</p><p>Some of my favorite Excel teachers</p><p>Been following some of these instructors for a while now, and can definitely say their classes are worth checking out if you are new to Excel:</p><p>* Oz du Soleil's <a target="_blank" href="https://www.lynda.com/Oz-du-Soleil/1907287-1.html">Lynda classes</a></p><p>* Mynda Treacy's <a target="_blank" href="http://www.mothresource.com/170-9.html">myOnlineTraininghub classes</a></p><p>* Bill Jelen's Mr. Excel <a target="_blank" href="https://www.youtube.com/user/bjele123">YouTube channel</a></p><p>MAKRO is back!</p><p>One of my favorite Excel streamers is back with this livestream. He makes some good points about how Microsoft is dumbing down Excel for beginners and alienating advanced Excel users. Bless you MAKRO.</p><p>Other Podcasts & Blog Posts</p><p>In the 2nd half of the episode, I talk about some episodes and blogs from other people I found interesting:</p><p>* a16z Episode #523: <a target="_blank" href="https://a16z.simplecast.com/episodes/devops-leansoftware-org-performance-change-it-rerun-oVroqSQL">Innovation Through Software Development and IT</a></p><p>* Knuckleheads Season 3 Episode #6: <a target="_blank" href="https://www.theplayerstribune.com/en-us/articles/isiah-thomas-knuckleheads-podcast">Isiah Thomas AKA Zeke</a></p> <br/><br/>This is a public episode. If you would like to discuss this with other subscribers or get access to bonus episodes, visit <a href="https://alchen.substack.com?utm_medium=podcast&#38;utm_campaign=CTA_1">alchen.substack.com</a>]]></description><link>https://alchen.substack.com/p/episode-30-how-to-learn-excel-while</link><guid isPermaLink="false">substack:post:448948</guid><dc:creator><![CDATA[Al]]></dc:creator><pubDate>Mon, 11 May 2020 10:55:15 GMT</pubDate><enclosure url="https://api.substack.com/feed/podcast/448948/fa3101a0c8d088174b728ec64239a3e9.mp3" length="33333333" type="audio/mpeg"/><itunes:author>Al</itunes:author><itunes:explicit>No</itunes:explicit><itunes:duration>1758</itunes:duration><itunes:image href="https://substackcdn.com/feed/podcast/23684/post/448948/64510db2aaeda081abbc11d9f28f6ca4.jpg"/></item><item><title><![CDATA[Dear Analyst #29: Working with dynamic array functions and formulas that spill]]></title><description><![CDATA[<p>Have you ever wondered what an &#8220;array-entered formula&#8221; is? It&#8217;s an intermediate/advanced concept in Excel but in late 2018, Microsoft released dynamic array functions and formulas that &#8220;spill&#8221; into the cells below your current cell with a function. This makes writing formulas easier and less prone to human error, but there are some tradeoffs to [&#8230;]</p><br/><p>The post <a rel="nofollow" href="https://www.thekeycuts.com/dear-analyst-working-with-dynamic-array-functions-and-formulas-that-spill/">Dear Analyst #29: Working with dynamic array functions and formulas that spill</a> appeared first on <a rel="nofollow" href="https://www.thekeycuts.com"></a>.</p> <br/><br/>This is a public episode. If you would like to discuss this with other subscribers or get access to bonus episodes, visit <a href="https://alchen.substack.com?utm_medium=podcast&#38;utm_campaign=CTA_1">alchen.substack.com</a>]]></description><link>https://alchen.substack.com/p/dear-analyst-29-working-with-dynamic-1be</link><guid isPermaLink="false">https://www.thekeycuts.com/?p=49038</guid><dc:creator><![CDATA[Al]]></dc:creator><pubDate>Mon, 13 Apr 2020 10:28:00 GMT</pubDate><enclosure url="https://api.substack.com/feed/podcast/382984/f661ba012405bb399b842078d3212341.mp3" length="33333333" type="audio/mpeg"/><itunes:author>Al</itunes:author><itunes:subtitle>Have you ever wondered what an “array-entered formula” is? It’s an intermediate/advanced concept in Excel but in late 2018, Microsoft released dynamic array functions and formulas that “spill” into the cells below your current cell with a function.</itunes:subtitle><itunes:explicit>No</itunes:explicit><itunes:duration>2240</itunes:duration><itunes:image href="https://substackcdn.com/feed/podcast/23684/post/382984/27b1e1c12ae84cf63451c0e8035d891e.jpg"/></item><item><title><![CDATA[Dear Analyst #28: Filling a formula down to the last row of your data set]]></title><description><![CDATA[<p>This spreadsheet tip is based on a question I get asked all the time when I teach (well taught) Excel at in-person classes: How do I fill a formula down to the last row of my data set without over-shooting the last row with keyboard shortcuts? This problem occurs with larger data sets where you [&#8230;]</p><br/><p>The post <a rel="nofollow" href="https://www.thekeycuts.com/dear-analyst-28-filling-a-formula-down-to-the-last-row-of-your-data-set/">Dear Analyst #28: Filling a formula down to the last row of your data set</a> appeared first on <a rel="nofollow" href="https://www.thekeycuts.com"></a>.</p> <br/><br/>This is a public episode. If you would like to discuss this with other subscribers or get access to bonus episodes, visit <a href="https://alchen.substack.com?utm_medium=podcast&#38;utm_campaign=CTA_1">alchen.substack.com</a>]]></description><link>https://alchen.substack.com/p/dear-analyst-28-filling-a-formula-7b0</link><guid isPermaLink="false">https://www.thekeycuts.com/?p=49026</guid><dc:creator><![CDATA[Al]]></dc:creator><pubDate>Mon, 30 Mar 2020 10:32:00 GMT</pubDate><enclosure url="https://api.substack.com/feed/podcast/382985/1fa26b1d050c3f52c072366d7caf9c49.mp3" length="33333333" type="audio/mpeg"/><itunes:author>Al</itunes:author><itunes:subtitle>This spreadsheet tip is based on a question I get asked all the time when I teach (well taught) Excel at in-person classes: How do I fill a formula down to the last row of my data set without over-shooting the last row with keyboard shortcuts?</itunes:subtitle><itunes:explicit>No</itunes:explicit><itunes:duration>1809</itunes:duration><itunes:image href="https://substackcdn.com/feed/podcast/23684/post/382985/cf2f712059d4d5385b6483ca231da8d3.jpg"/></item><item><title><![CDATA[Dear Analyst #27: Splitting a cell diagonally to label y and x-axis and COVID-19 dashboard]]></title><description><![CDATA[<p>This is an Excel trick that&#8217;s not super complicated but super useful for labelling a simple table in Excel. Let&#8217;s say you have one set of labels along the rows (e.g. &#8220;Region&#8221;) and then another set of labels along the columns (e.g. &#8220;Month&#8221;). Cell A1 is now empty because you don&#8217;t know which label to [&#8230;]</p><br/><p>The post <a rel="nofollow" href="https://www.thekeycuts.com/splitting-a-cell-diagonally-to-label-y-and-x-axis-and-covid-19-dashboard/">Dear Analyst #27: Splitting a cell diagonally to label y and x-axis and COVID-19 dashboard</a> appeared first on <a rel="nofollow" href="https://www.thekeycuts.com"></a>.</p> <br/><br/>This is a public episode. If you would like to discuss this with other subscribers or get access to bonus episodes, visit <a href="https://alchen.substack.com?utm_medium=podcast&#38;utm_campaign=CTA_1">alchen.substack.com</a>]]></description><link>https://alchen.substack.com/p/dear-analyst-27-splitting-a-cell-275</link><guid isPermaLink="false">https://www.thekeycuts.com/?p=49014</guid><dc:creator><![CDATA[Al]]></dc:creator><pubDate>Mon, 16 Mar 2020 09:06:00 GMT</pubDate><enclosure url="https://api.substack.com/feed/podcast/382986/9beefe641f20cb11058354c8ddc66f44.mp3" length="33333333" type="audio/mpeg"/><itunes:author>Al</itunes:author><itunes:subtitle>This is an Excel trick that’s not super complicated but super useful for labelling a simple table in Excel. Let’s say you have one set of labels along the rows (e.g. “Region”) and then another set of labels along the columns (e.g. “Month”).</itunes:subtitle><itunes:explicit>No</itunes:explicit><itunes:duration>1995</itunes:duration><itunes:image href="https://substackcdn.com/feed/podcast/23684/post/382986/7eef15128f1a8f95a8d57c6ec6a96b91.jpg"/></item><item><title><![CDATA[Dear Analyst Episode 26: Data visualizations for infectious diseases/ideas during coronavirus (COVID-19)]]></title><description><![CDATA[<p>Given the media attention placed on the coronavirus (COVID-19) in the media the last few weeks, I thought it was important to take a step back and look at the math behind infectious diseases and how diseases spread. I spend the entire episode taking a look at Going Critical, a blog post by Kevin Simler [&#8230;]</p><br/><p>The post <a rel="nofollow" href="https://www.thekeycuts.com/dear-analyst-episode-26-data-visualizations-for-infectious-diseases-ideas-during-coronavirus-covid-19/">Dear Analyst Episode 26: Data visualizations for infectious diseases/ideas during coronavirus (COVID-19)</a> appeared first on <a rel="nofollow" href="https://www.thekeycuts.com"></a>.</p> <br/><br/>This is a public episode. If you would like to discuss this with other subscribers or get access to bonus episodes, visit <a href="https://alchen.substack.com?utm_medium=podcast&#38;utm_campaign=CTA_1">alchen.substack.com</a>]]></description><link>https://alchen.substack.com/p/dear-analyst-episode-26-data-visualizations-1f2</link><guid isPermaLink="false">https://www.thekeycuts.com/?p=49003</guid><dc:creator><![CDATA[Al]]></dc:creator><pubDate>Mon, 09 Mar 2020 09:38:00 GMT</pubDate><enclosure url="https://api.substack.com/feed/podcast/382987/84b01b9945205fd386d64ec836d13529.mp3" length="33333333" type="audio/mpeg"/><itunes:author>Al</itunes:author><itunes:subtitle>Given the media attention placed on the coronavirus (COVID-19) in the media the last few weeks, I thought it was important to take a step back and look at the math behind infectious diseases and how diseases spread.</itunes:subtitle><itunes:explicit>No</itunes:explicit><itunes:duration>1267</itunes:duration><itunes:image href="https://substackcdn.com/feed/podcast/23684/post/382987/644acf6dcfd9884514f75354d3943218.jpg"/></item><item><title><![CDATA[Dear Analyst Episode 25: Structuring data challenge (denormalize data) with Get and Transform]]></title><description><![CDATA[<p>This episode is based on a video and Tweet posted by Mr. Excel (Bill Jelen). Bill discusses an Excel challenge someone emailed him about regarding how to &#8220;transform&#8221; a badly structured table of data into a structure that makes it easy to do PivotTables and other downstream analysis. Interestingly, I received a ticket from a [&#8230;]</p><br/><p>The post <a rel="nofollow" href="https://www.thekeycuts.com/dear-analyst-episode-25-structuring-data-challenge-denormalize-data-with-get-and-transform/">Dear Analyst Episode 25: Structuring data challenge (denormalize data) with Get and Transform</a> appeared first on <a rel="nofollow" href="https://www.thekeycuts.com"></a>.</p> <br/><br/>This is a public episode. If you would like to discuss this with other subscribers or get access to bonus episodes, visit <a href="https://alchen.substack.com?utm_medium=podcast&#38;utm_campaign=CTA_1">alchen.substack.com</a>]]></description><link>https://alchen.substack.com/p/dear-analyst-episode-25-structuring-b85</link><guid isPermaLink="false">https://www.thekeycuts.com/?p=48981</guid><dc:creator><![CDATA[Al]]></dc:creator><pubDate>Tue, 18 Feb 2020 11:03:00 GMT</pubDate><enclosure url="https://api.substack.com/feed/podcast/382988/535b58422f72cb48d02d6502c7ad38c7.mp3" length="33333333" type="audio/mpeg"/><itunes:author>Al</itunes:author><itunes:subtitle>This episode is based on a video and Tweet posted by Mr. Excel (Bill Jelen). Bill discusses an Excel challenge someone emailed him about regarding how to “transform” a badly structured table of data into a structure that makes it easy to do PivotTables...</itunes:subtitle><itunes:explicit>No</itunes:explicit><itunes:duration>2153</itunes:duration><itunes:image href="https://substackcdn.com/feed/podcast/23684/post/382988/b9f270ea9a9cd6f507a1a54526acb9a4.jpg"/></item><item><title><![CDATA[Dear Analyst Episode 24: Finding and ranking percentiles]]></title><description><![CDATA[<p>I discuss how to calculate percentiles in Excel or Google Sheets using the PERCENTILE function. With the PERCENTILE function, you can calculate the value that would represent nth percentile in your list of values. This is not exactly the calculation I was looking for. Instead, what if you wanted to know what the rank percentile [&#8230;]</p><br/><p>The post <a rel="nofollow" href="https://www.thekeycuts.com/dear-analyst-episode-24-finding-and-ranking-percentiles/">Dear Analyst Episode 24: Finding and ranking percentiles</a> appeared first on <a rel="nofollow" href="https://www.thekeycuts.com"></a>.</p> <br/><br/>This is a public episode. If you would like to discuss this with other subscribers or get access to bonus episodes, visit <a href="https://alchen.substack.com?utm_medium=podcast&#38;utm_campaign=CTA_1">alchen.substack.com</a>]]></description><link>https://alchen.substack.com/p/dear-analyst-episode-24-finding-and-5bc</link><guid isPermaLink="false">https://www.thekeycuts.com/?p=48966</guid><dc:creator><![CDATA[Al]]></dc:creator><pubDate>Mon, 03 Feb 2020 11:05:00 GMT</pubDate><enclosure url="https://api.substack.com/feed/podcast/382989/34dbc4e652a891cf798b0e866adfeff7.mp3" length="33333333" type="audio/mpeg"/><itunes:author>Al</itunes:author><itunes:subtitle>I discuss how to calculate percentiles in Excel or Google Sheets using the PERCENTILE function. With the PERCENTILE function, you can calculate the value that would represent nth percentile in your list of values.</itunes:subtitle><itunes:explicit>No</itunes:explicit><itunes:duration>1591</itunes:duration><itunes:image href="https://substackcdn.com/feed/podcast/23684/post/382989/ea8ca00e3e57b093bac4112bd75a4059.jpg"/></item><item><title><![CDATA[Revisiting Calculating Average Trends Across Time Periods in Spreadsheets]]></title><description><![CDATA[<p>In this episode, I discuss how to calculate trends over time in Excel for the purposes for forecasting future values. I reference an old post about calculating trends where someone recently left a comment about the counter-intuitiveness on calculating averages of changes in your values. In order to follow along with this episode, I would [&#8230;]</p><br/><p>The post <a rel="nofollow" href="https://www.thekeycuts.com/revisiting-calculating-average-trends-across-time-periods-in-spreadsheets/">Revisiting Calculating Average Trends Across Time Periods in Spreadsheets</a> appeared first on <a rel="nofollow" href="https://www.thekeycuts.com"></a>.</p> <br/><br/>This is a public episode. If you would like to discuss this with other subscribers or get access to bonus episodes, visit <a href="https://alchen.substack.com?utm_medium=podcast&#38;utm_campaign=CTA_1">alchen.substack.com</a>]]></description><link>https://alchen.substack.com/p/revisiting-calculating-average-trends-67b</link><guid isPermaLink="false">https://www.thekeycuts.com/?p=48945</guid><dc:creator><![CDATA[Al]]></dc:creator><pubDate>Mon, 20 Jan 2020 11:38:00 GMT</pubDate><enclosure url="https://api.substack.com/feed/podcast/382990/282193bc2fea073a09e7cc4ce172c292.mp3" length="33333333" type="audio/mpeg"/><itunes:author>Al</itunes:author><itunes:subtitle>In this episode, I discuss how to calculate trends over time in Excel for the purposes for forecasting future values. I reference an old post about calculating trends where someone recently left a comment about the counter-intuitiveness on calculating ...</itunes:subtitle><itunes:explicit>No</itunes:explicit><itunes:duration>1229</itunes:duration><itunes:image href="https://substackcdn.com/feed/podcast/23684/post/382990/1a94cf051c62cc55fbdb9f6b6c5752e0.jpg"/></item><item><title><![CDATA[Dear Analyst Episode 22: Calculate win streaks for a pool of players in Google Sheets]]></title><description><![CDATA[<p>If you are by your computer, you may want to open this Google Sheet to understand the example discussed in this episode. I walk through a rather long formula involving the FREQUENCY(), COLUMN(), MAX(), and the ARRAYFORMULA() functions in Google Sheets. Here&#8217;s the full formula below to calculate win streaks in the Google Sheet: [crayon-5e9a5d15b7f0f403479039/] [&#8230;]</p><br/><p>The post <a rel="nofollow" href="https://www.thekeycuts.com/dear-analyst-episode-22-calculate-win-streaks-for-a-pool-of-players-in-google-sheets/">Dear Analyst Episode 22: Calculate win streaks for a pool of players in Google Sheets</a> appeared first on <a rel="nofollow" href="https://www.thekeycuts.com"></a>.</p> <br/><br/>This is a public episode. If you would like to discuss this with other subscribers or get access to bonus episodes, visit <a href="https://alchen.substack.com?utm_medium=podcast&#38;utm_campaign=CTA_1">alchen.substack.com</a>]]></description><link>https://alchen.substack.com/p/dear-analyst-episode-22-calculate-63d</link><guid isPermaLink="false">https://www.thekeycuts.com/?p=48929</guid><dc:creator><![CDATA[Al]]></dc:creator><pubDate>Mon, 16 Dec 2019 12:16:00 GMT</pubDate><enclosure url="https://api.substack.com/feed/podcast/382991/06b99bfbc0d4c8bc9aec0e1155ccb766.mp3" length="33333333" type="audio/mpeg"/><itunes:author>Al</itunes:author><itunes:subtitle>If you are by your computer, you may want to open this Google Sheet to understand the example discussed in this episode. I walk through a rather long formula involving the FREQUENCY(), COLUMN(), MAX(), and the ARRAYFORMULA() functions in Google Sheets....</itunes:subtitle><itunes:explicit>No</itunes:explicit><itunes:duration>1488</itunes:duration><itunes:image href="https://substackcdn.com/feed/podcast/23684/post/382991/83bb4a9046c6d178409b1d95c32df8b7.jpg"/></item><item><title><![CDATA[Dear Analyst Episode 21: Building No-Code Tools and Applications from Spreadsheets]]></title><description><![CDATA[<p>This is my talk from Webflow&#8217;s No-Code Conference that took place on November 13th, 2019 in San Francisco. The title of my talk was called Building No-Code Tools and Applications from Spreadsheets. The slides from my presentation are on SlideShare here. Themes from the talk This was my first time talking about my experience with [&#8230;]</p><br/><p>The post <a rel="nofollow" href="https://www.thekeycuts.com/building-no-code-tools-and-applications-from-spreadsheets/">Dear Analyst Episode 21: Building No-Code Tools and Applications from Spreadsheets</a> appeared first on <a rel="nofollow" href="https://www.thekeycuts.com"></a>.</p> <br/><br/>This is a public episode. If you would like to discuss this with other subscribers or get access to bonus episodes, visit <a href="https://alchen.substack.com?utm_medium=podcast&#38;utm_campaign=CTA_1">alchen.substack.com</a>]]></description><link>https://alchen.substack.com/p/dear-analyst-episode-21-building-79c</link><guid isPermaLink="false">https://www.thekeycuts.com/?p=48917</guid><dc:creator><![CDATA[Al]]></dc:creator><pubDate>Mon, 18 Nov 2019 11:03:46 GMT</pubDate><enclosure url="https://api.substack.com/feed/podcast/382992/22a23a40f500eea16d53bd899a224084.mp3" length="33333333" type="audio/mpeg"/><itunes:author>Al</itunes:author><itunes:subtitle>This is my talk from Webflow’s No-Code Conference that took place on November 13th, 2019 in San Francisco. The title of my talk was called Building No-Code Tools and Applications from Spreadsheets. The slides from my presentation are on SlideShare here...</itunes:subtitle><itunes:explicit>No</itunes:explicit><itunes:duration>1632</itunes:duration><itunes:image href="https://substackcdn.com/feed/podcast/23684/post/382992/f8b2bc4f715f73e3c15551cde7f9ada9.jpg"/></item><item><title><![CDATA[What it’s like teaching a week-long online data analytics course]]></title><description><![CDATA[<p>A few weeks ago I had the opportunity to teach a week-long data analytics course through General Assembly. The course was taught entirely online using Zoom. I discuss some of the topics the students learned in the class, and what the experience was like teaching an online class in real time. The topics we covered [&#8230;]</p><br/><p>The post <a rel="nofollow" href="https://www.thekeycuts.com/teaching-weeklong-data-analytics-course/">What it&#8217;s like teaching a week-long online data analytics course</a> appeared first on <a rel="nofollow" href="https://www.thekeycuts.com"></a>.</p> <br/><br/>This is a public episode. If you would like to discuss this with other subscribers or get access to bonus episodes, visit <a href="https://alchen.substack.com?utm_medium=podcast&#38;utm_campaign=CTA_1">alchen.substack.com</a>]]></description><link>https://alchen.substack.com/p/what-its-like-teaching-a-week-long-c90</link><guid isPermaLink="false">https://www.thekeycuts.com/?p=48909</guid><dc:creator><![CDATA[Al]]></dc:creator><pubDate>Mon, 11 Nov 2019 11:30:53 GMT</pubDate><enclosure url="https://api.substack.com/feed/podcast/382993/da312252ed90c498d62eca34a4e5597a.mp3" length="33333333" type="audio/mpeg"/><itunes:author>Al</itunes:author><itunes:subtitle>A few weeks ago I had the opportunity to teach a week-long data analytics course through General Assembly. The course was taught entirely online using Zoom. I discuss some of the topics the students learned in the class,</itunes:subtitle><itunes:explicit>No</itunes:explicit><itunes:duration>1900</itunes:duration><itunes:image href="https://substackcdn.com/feed/podcast/23684/post/382993/4dceaee9fd9d695f3bf741f8b4908e5f.jpg"/></item></channel></rss>