Parsing Archives - Depict Data Studio https://depictdatastudio.com/tag/parsing/ Fri, 21 Nov 2025 22:39:15 +0000 en-US hourly 1 https://wordpress.org/?v=7.1.2 Splitting with =TEXTBEFORE and =TEXTAFTER in Excel https://depictdatastudio.com/splitting-with-textbefore-and-textafter-in-excel/ https://depictdatastudio.com/splitting-with-textbefore-and-textafter-in-excel/#respond Mon, 22 Sep 2025 15:08:00 +0000 https://depictdatastudio.com/?p=16488 Is all your data smushed into one cell? You might need a "splitting" or parsing technique.

The post Splitting with =TEXTBEFORE and =TEXTAFTER in Excel appeared first on Depict Data Studio.

]]>
In this video, you’ll see 3 ways to “split” data in Excel:

  • Text to columns
  • Textsplit
  • Textbefore and textafter

Then, you’ll learn how to use =TEXTBEFORE and =TEXTAFTER:

Download the Excel File

And practice yourself: https://depictdatastudio.kit.com/textbeforetextafter

Transcript

[00:00:00] In this video, you’re gonna practice text before and text after, which are methods of splitting.

And I want you to practice this along with me.

So look down below this YouTube video in the description, and you’ll see a link to download this for free.

Okay, let me give you some context about the project and then we will get into the actual text before and text after functions.

Recently I was working on a project that looked like this, where I had, you know, a bunch of data. I had things like ID numbers, I had country codes, and I wanted to find country names, and I was gonna fill them in with good old lookup formulas, which are beyond the scope of this video. But, you know, with like a V, H, X, or index match to fill them in.

I needed to find a list of the codes and the names. I went to like good old copilot and I just asked it. I was like, “Hey, this is what I need. I need country names, I need country codes.” And within seconds it gave me the list.

I [00:01:00] tried copying it and it gave me like all this messed stuff: Afghanistan space, Space, space, space, space, space, space, pipe, space, af.

And a lot of times people are like, “Ann, like just type it in by hand,” et cetera. I don’t have time to do that for like 50 bajillion countries and codes. That’s where splitting formulas come to the rescue.

There’s different types of splitting. This is not an exhaustive list. These are just the ones that are the most related.

I tried to put some notes here just as like a quick, you know, a quick cheat sheet for you about the versions and pros and cons.

There’s text to columns. Available in all the versions, it’s buttons. It’s a wizard. It’s great, unless you are using uppercase T Excel Tables. It has to be done manually. I don’t love this. That means Future You, Future Ann has to spend more time doing it over and over and over.

Text split, amazing, but it’s not in all the versions of Excel. It doesn’t [00:02:00] work with Tables. It spills into nearby cells, which can like be a tricky thing to work around.

So enter text before and text after, which we’re focusing on today.

They’ve been around for a while, so a lot of your coworkers and colleagues that you share files with probably have them at this point.

They are formulas, which means Future you can easily replicate this. And they don’t spill, which is amazing.

Okay, let’s get into the how tos. I’ll zoom way in. I’ll demo and then remember, you should download this spreadsheet and try it yourself.

The goal is to have country name and then over here in a separate column, the country code.

Text before is gonna grab this whole cell, that whole text, comma, the delimiter, like what is it that separates it?

Well, it’s a pipe which is on my keyboard. It’s between backspace and enter is what that little symbol is. [00:03:00]

Now A3 is a cell reference. You can see the color codes. It’s like a specific location, so I don’t need any quotes around it. But the pipe is not a cell reference, so I have to surround it with the double quotes because it’s like things I’m selecting off of my keyboard.

Okay, so this is gonna grab everything before the pipe.

Country code comes after. Okay, text after. I wanna split out this cell. That’s all smooshed together. And the delimiter is the pipe, which again goes inside double quotes, as you know. Mm-hmm. Okay. So you get Afghanistan AF, and then you can fill these all the way down and they work for you. Okay.

One thing I am curious about though, remember how it’s like Afghanistan, space, space, space, space, space. I feel like to like really sleep well at night, I would probably wanna trim off the extra spaces off both of these, just to be like extra sure. I’m probably going to onion layer them, nest them inside a trim.

[00:04:00] Then I can know they’re like completely, completely perfect.

Have fun playing around with text before and text after. I love these time savers and I hope you do too.

The post Splitting with =TEXTBEFORE and =TEXTAFTER in Excel appeared first on Depict Data Studio.

]]>
https://depictdatastudio.com/splitting-with-textbefore-and-textafter-in-excel/feed/ 0
10 Must-Have Analytical Skills https://depictdatastudio.com/10-must-have-analytical-skills/ https://depictdatastudio.com/10-must-have-analytical-skills/#comments Tue, 23 Mar 2021 15:15:00 +0000 https://depictdatastudio.com/?p=13001 Data cleaning and data analysis alone can take hours, days, or weeks. It will always take some time, but it doesn’t have to take forever. It might not be your favorite part of the process. But it doesn’t have to be a headache, either.

In this blog post, we’ll cover 10 analytical skills that can make your next data project easier, faster, and error-free.

The post 10 Must-Have Analytical Skills appeared first on Depict Data Studio.

]]>
That beautiful chart is one of the last steps in the analytical process.

For most projects, it goes something like this:

  1. Planning. Figure out what data you need. You might get data requests from your boss. You might hold a months-long strategic planning process. You might participate in a program evaluation where the evaluator helps you brainstorm what your questions are and how to collect data to answer those questions.
  2. Collect the data. Design and administer surveys. Organize focus groups. Review public data sources (e.g., Census data).
  3. Analyze the data. Take raw, messy data from tons of different data sources and get it neat and tidy so it can feed into charts.
  4. Visualize the data and share the reports, one-pagers, dashboards, and slideshows with stakeholders.

Data analysis and data cleaning alone can take hours. Days. Weeks.

We’ve all got horror stories about data cleaning that took forever and ever and ever and ever. I often spend 10x more time cleaning data than creating charts.

Data analysis still takes time, but it doesn’t have to take forever.

Data analysis might not be your favorite part of the process. But it doesn’t have to be a headache, either.

In this blog post, we’ll cover 10 skills that can make your next data project easier, faster, and error-free.

10 Must-Have Analytical Skills

No matter the topic area. No matter the software program. Here are 10 must-have skills for cleaning and analyzing data.

Which skills are you already strong in? Which ones need to be developed? You can follow the links to additional tutorials.

Outliers

I recommend (1) checking every dataset for outliers, and then (2) deciding how you’re going to deal with them.

Humor me: Comment and let me know how you define the term “outlier.”

To some people, it generally means a really small or really large value.

To other people, it has a specific numeric meaning.

A million years ago, I worked on a longitudinal study in a university research lab. Here’s how the principal investigator of that study defined “outlier:”

An outlier is any value that falls more than three standard deviations outside the mean.

He taught us to calculate each variable’s mean and standard deviation. Then, we’d see which values were smaller than three standard deviations below the mean, and which values were larger than three standard deviations above the mean. Those were the outliers.

Next, we had to deal with outliers.

I’ve heard novices suggest that you should just delete outliers. NOOOOOOO. Deleting outliers will skew and affect the distribution of our dataset.

Here’s what the principal investigator taught us:

We should trim outliers—setting their value to be exactly three standard deviations above or below the mean.

For example, if three standard deviations above the mean is 150, and you’ve got an outlier of 160, you treat that 160 as 150 rather than deleting it.

This is a little jargony for a blog post, so if you’d like to learn more, let me know. I’ve got video resources in everyday language inside our Simple Spreadsheets course.

Duplicates

I’ve seen people identify duplicate ID numbers by scrolling through their dataset, squinting at the ID column, and hoping to spot the same ID number in there twice.

Eye-balling is fine with tiny datasets. But it’s impossible to scroll through hundreds, thousands, or tens of thousands of entries. It would take ALL DAY. And, we’d miss something.

Here’s how I like to identify duplicates:

  1. I use Microsoft Excel’s Conditional Formatting to make duplicate ID numbers pop out in bright red.
  2. Then, I re-sort my dataset so that the bright red numbers appear at the top. I go through the duplicate entries one at a time and try to figure out why those entries have appeared multiple times.

Or, I use the Remove Duplicates feature in Excel.

Or, you can even use pivot tables for data cleaning, like identifying duplicates. This blog post by Oz Du Soleil will get you started.

Missing Data

We need to check our dataset for missing data every single time.

This isn’t a once-in-a-while luxury.

This isn’t a if-I-remember-it optional step.

Checking for missing data is mandatory.

You might find patterns in your dataset: An entire row is empty. An entire column is empty. Find out why.

Let’s pretend you collected electronic surveys. You might see a mostly-empty column if your survey had a skip pattern, for example. Or, you might see a mostly-empty row if someone started the survey but didn’t finish answering all the questions. These patterns are normal and expected. The most important part is to understand all the nuances of why you might see missing data before you move on to any tabulations.

Or, you might not see a pattern in the dataset (like the image above).

This Swiss cheese pattern might mean that people skipped survey questions here and there, for example. That’s probably normal in your project. Again, the goal is to spot missing data and understand why it’s missing as early as possible in the project.

Measurement Scales

Nominal, ordinal, interval, and ratio. These are called measurement scales.

We need to understand whether each variable in our project is nominal, ordinal, interval, or ratio because that affects how we summarize that variable.

Let’s pretend you’re organizing a virtual conference, and you give attendees a survey when the event is over.

You might have a check-all-that-apply question where you ask people which part(s) of the conference they liked: the breakout sessions, and/or the keynote speaker, and/or the networking events. These categories are nominal data, which means we should be paying attention to frequencies—how many people checked the box for the breakout sessions, the keynote speaker, and the networking events.

This blog post gets you started with beginner-level formulas for numbers,like calculating the mean, median, mode, and standard deviation.

This blog post gets you started with pivot tables, which I find most helpful for categories.

Distributions

Being able to describe a dataset as left-skewed, right-skewed, or symmetrical is a must-have analytical skill.

We also need to understand how those distributions affect real-world decision making.

If academic test scores are left-skewed—now what?

If mental health assessments are right-skewed—now what?

Distributions also affect chart-choosing. For example:

  • We can use a traditional histogram to show the distribution.
  • We can use a unit chart or wheat plot to emphasize individual dots in the histogram.
  • We can use a population pyramid to compare two groups’ distributions, side by side.
  • We can use a swarm plot when the dots are overlapping and need to be jittered.

Recategorizing/Recoding Variables

You might need to recategorize or recode values if:

  • You have a list of zip codes but you really just care about the states.
  • You have a list of states but you really just care about the regions where those states are located.
  • You have a list of countries but you really just care about regions of the world.
  • You have a list of ages (0, 1, 2, 3, 4, 5, etc.) but you really just care about age ranges (0-9, 10-19, 20-29, etc.).
  • You have a list of schools but you really just care about which district the school is located within.
  • You have a list of test scores (40%, 55%, 70%) but you really just want to focus on students who passed or didn’t pass the exam.
  • You have a list of body mass indices (19, 24, 29, 32, etc.) but you want to categorize the raw numbers into underweight, normal weight, overweight, and obese.
  • You have a list of languages spoken but you really want to divide people into those who speak Mandarin and those who don’t.
  • You have a list of countries where people were born but you really just want to divide people into born in U.S. and not born in U.S.
  • … and so on.

This blog post gets you started with beginner-level categorizing using =if() and =vlookup().

Merging Datasets Together

Is your student demographic data living in one spreadsheet?

And your test scores are living in another spreadsheet?

But you want to see how demographic characteristics might be related to test scores? For example, do students living in one zip code score higher than students in another zip code?

We’ll need to combine those two spreadsheets together.

In Excel, you’ll need fluency in vlookup, hlookup, index-match, and xlookup.

This blog post gets you started with =vlookup().

Merging Variables Together

Sometimes, we need to merge entire datasets, tables, or spreadsheets together.

Other times, we need to merge individual variables together.

For example, if you have first names in one column, last names in another column, but you really want to see everything displayed in Last, First format.

Manual merging is a pain, and it’s destined for typos.

Instead, we can use use Excel’s =concatenate() formula or the & operator to merge variables.

Pulling Variables Apart

Sometimes we also need to pull variables apart, like when you’ve got Last, First but you really just want First. Or just Last.

In Excel, we can use formulas like left, right, or mid.

Excel’s text-to-columns is another game-changer.

This blog post gets you started with one of those techniques, =()left.

Exploratory Visualization

Why wait until we’re hours, days, or weeks into the analytical process before we see any charts??

Quick visuals help us scan the dataset for patterns early and often.

My favorite exploratory visualization techniques in Excel are:

  1. heat tables,
  2. data bars, and
  3. spark lines.

(NOT most of the Conditional Formatting options, ha! Here’s what not to do when it comes to exploratory visualization.)

Which Software Program Should I Use??

We can apply these analytical skills in any software program.

In college, I learned to use SPSS in my statistics and research methods courses.

After college, I worked in a university research lab, and we all used SAS.

After that, I worked in a consulting firm, and we all used Excel. I’ve linked to some Excel-specific resources throughout this blog post in case that’s your organization’s tool of choice, too.

Your Turn

Which must-have analytical skills would you add to this list? What types of techniques for transforming raw data into clean, tabulated data have been crucial in your own job?

I’ve linked to a few blog posts with how-to tips. Do you have additional how-to resources to share, like books, blog posts, or YouTube videos?

The post 10 Must-Have Analytical Skills appeared first on Depict Data Studio.

]]>
https://depictdatastudio.com/10-must-have-analytical-skills/feed/ 1
How to Format Months, Days, and Years in Excel https://depictdatastudio.com/formatting-dates/ https://depictdatastudio.com/formatting-dates/#comments Tue, 28 Jul 2015 15:08:34 +0000 http://annkemery.com/?p=6872 Does your file include any dates? If so, check out these simple formatting tips so that your dates are displayed in the style you want.

The post How to Format Months, Days, and Years in Excel appeared first on Depict Data Studio.

]]>
Does your file include any dates? If so, check out these simple formatting tips so that your dates are displayed in the style you want.

Selecting Your Preferred Date Format

If your spreadsheet contains dates, you can select either the Short Date or Long Date format.
Ann K. Emery on displaying long dates or short dates in Microsoft Excel

Separating Out the Date’s Month, Day, and Year

Sometimes I need to parse out my date. I might only be interested in the specific month, or the specific day, or the specific year—rather than the entire date.

In these situations, we can use Excel’s =month(), =day(), and =year() functions.

To find the date’s month, type =month( and then click on the cell that contains the full date (like A2 in this example). Then, add a closing parentheses to the end of the function and press the Enter key on your keyboard. Excel will give you a 1 to indicate that the full date’s month is January.

To find the day of the month, type =day( and then click on the cell that contains the full date (again, cell A2). Add a ) to complete the function and click Enter. Excel gives you a 1 to indicate that January 1 is the first day of the month.

Finally, to separate out just the year from the full date, type =year( and click on the cell that contains the full date you’re interested in (cell A2). You know the drill: Add another parentheses to complete the function, press Enter on your keyboard, and Excel will give you a value of 2015.
Ann K. Emery on Microsoft Excel's month, day, and year formulas

Figuring Out the Length of Time Between Two Dates

Did you know that Excel stores semi-recent dates as numbers? January 1, 1900 is actually stored as a 1 behind the scenes in Excel which means that January 1, 2015, which comes 42,005 days later, is stored as 42,005.

This cool feature allows you to perform basic addition and subtraction with dates. Let’s pretend you want to figure out how long an employee worked at your organization. You can use subtraction: the Last Day of Employment minus the First Day of Employment equals the Length of Employment.
Ann K. Emery on figuring out the number of days that took place between two dates in Excel

Auto-Filling Dates

I bet you’ve got better things to do with your time than to type Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sept, Oct, Nov, Dec every time you want to see a list of month abbreviations. Excel to the rescue! Type at least the first three abbreviations (Jan, Feb, Mar). Then, highlight those three cells. Scroll your cursor over the tiny square in the lower left-hand corner of the box surrounding the three highlighted cells and drag the tiny square downwards to auto-fill the remaining month abbreviations.
Ann K. Emery on auto-filling dates (Jan, Feb, Mar) into your spreadsheet
Would you rather have a list of the full month names, rather than the abbreviations? Type January, February, March into A1, A2, and A3. Highlight those cells and drag them downwards to fill in the remaining nine months.
Ann K. Emery on auto-filling dates (January, February, March) into your spreadsheet

The post How to Format Months, Days, and Years in Excel appeared first on Depict Data Studio.

]]>
https://depictdatastudio.com/formatting-dates/feed/ 6