Formulas and Functions – Depict Data Studio https://depictdatastudio.com Fri, 21 Nov 2025 22:39:15 +0000 en-US hourly 1 https://wordpress.org/?v=7.0 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 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.

]]>
https://depictdatastudio.com/splitting-with-textbefore-and-textafter-in-excel/feed/ 0
Concatenation in Excel https://depictdatastudio.com/concatenation-in-excel/ https://depictdatastudio.com/concatenation-in-excel/#respond Mon, 05 May 2025 15:08:00 +0000 https://depictdatastudio.com/?p=16308 “Concatenation” means pushing things together, chaining things together, or joining things together.

It’s the opposite of pulling apart (techniques like text to columns, textsplit, etc. in Excel).

What’s Inside

  • 0:00 Welcome
  • 0:15 What is concatenation??
  • 0:22 Pushing together vs. pulling apart
  • 0:45 Download the spreadsheet
  • 1:06 Concatenating first names and last names together
  • 1:46 AnnEmery is =A4&B4
  • 2:58 Ann Emery is =A4&” “&B4
  • 3:40 =proper(A4&” “&B4)
  • 5:02 =trim(proper(A4&” “&B4))
  • 5:40 CityState is =A13&B14
  • 6:05 City State is =A13&” “&B14
  • 6:38 City, State is =A13&”, “&B14
  • 6:53 Similar techniques: =concat

Download the Spreadsheet

It’s here: https://depictdatastudio.kit.com/concatenationinexcel

]]>
https://depictdatastudio.com/concatenation-in-excel/feed/ 0
Why do my Excel formulas say “RC?!” Help!! https://depictdatastudio.com/why-do-my-excel-formulas-say-rc-help/ https://depictdatastudio.com/why-do-my-excel-formulas-say-rc-help/#respond Mon, 24 Feb 2025 19:26:29 +0000 https://depictdatastudio.com/?p=16028 Do your formulas look weird?

Maybe they say “RC[-1]” or some other jargon.

The solution:

  • Go to File
  • Options
  • Formulas
  • Uncheck the “R1C1 reference style” box

Here’s a video tutorial:

]]>
https://depictdatastudio.com/why-do-my-excel-formulas-say-rc-help/feed/ 0
What is Data Storytelling? https://depictdatastudio.com/what-is-data-storytelling/ https://depictdatastudio.com/what-is-data-storytelling/#respond Wed, 19 Feb 2025 18:39:27 +0000 https://depictdatastudio.com/?p=16017 A quick demo for my kindergartener.

]]>
https://depictdatastudio.com/what-is-data-storytelling/feed/ 0
How to Put Numbers AND Percentages in Graph Labels in Excel https://depictdatastudio.com/how-to-put-numbers-and-percentages-in-graph-labels-in-excel/ https://depictdatastudio.com/how-to-put-numbers-and-percentages-in-graph-labels-in-excel/#respond Thu, 24 Oct 2024 15:08:00 +0000 https://depictdatastudio.com/?p=15943 Want to put both the numbers and the percentages inside your Excel graph’s labels, like this?

Text boxes are clunky and time-consuming.

Instead, we’ll create Helper Cells with concatenated values.

What’s Inside

  • 0:00 Intro
  • 0:33 Dataviz On The Go
  • 0:42 Why not text boxes??
  • 1:42 Pie example
  • 5:42 Donut example
  • 7:42 Bar example
  • 12:28 Advanced: Nested IF with left, mid, right
  • 14:42 Your turn

Materials

Download the Excel file: https://depictdatastudio.ck.page/numbersandpercentagesingraphlabels

Transcript

Ann K. Emery: [00:00:00] How do you put numbers and percentages inside your graph labels? In this video, you’re going to learn how to do this.
We’re going to go through two different workarounds, three different chart types, so you’ll know how to do this for pies, for donuts, for bar charts.
And you can also download the Excel file that I’m using. Just look below the video, you’ll see a link to download it for free. Obviously, you’re going to learn more if you follow along with me and you do it yourself, that’s going to be way better than just watching me do it, which would be really boring too.
I’m Ann Emery. You’re watching Dataviz On The Go, the series where you learn dataviz time savers inside everyday software like Excel.
And speaking of being on the go, I was in South Africa just a few days ago teaching dataviz and one of the participants there raised his hand and he was like, Ann, How do I add the numbers and the percentages inside my chart labels? And I walked over to his laptop and he showed me a [00:01:00] column chart that he had.
It had about 10 different columns going across and he had numbers and percentages and I was like, you already did it. What do I need to help you with? And he was like, well, but then it was text boxes manually put on each of those 10 columns, which must’ve taken him like 10 minutes to do, right? That’s way too much time.
Um, he was explaining how. When he updated the data each month, the text box location didn’t change with the height of the column. So he had to manually adjust the placement and that’s way too much work. So I’m not going to show you how to do this with text boxes. I’m going to show you the better way behind the scenes.
It involves a little bit of a learning curve, but I guarantee you in the long run, it’s going to be way faster. All right. Open up your Excel file if you haven’t already, and let’s go through each of these chart types together. So what you’re going to do along with me is you’re going to highlight the gray section of the table.
It’s a little counterintuitive. You might be tempted to highlight the numbers and the percents. [00:02:00] We’re just going to do the numbers. You’re going to go to Insert, and we’re going to add a 2D pie chart. Okay. These are the default settings that Microsoft gives us, and we’re going to make it look like this one over here.
If you have questions about big A accessibility or little A accessibility, just comment below the video and I will certainly point you in the right direction. I have hundreds of blog posts and YouTube videos and conference presentations all about accessibility in dataviz. This video is just about the labels, so I’m going to try to hold back from talking too much about the formatting and just show you the number percentage combo here.
Okay, so how you do this is you click on any one of the pie slices here, do a right click, add data labels. Then you click on the labels, any one of them, right click, [00:03:00] format data labels. Labels are kind of annoying because you have to add them and then you have to format them. It’s not my choice. That’s just how it is.
It feels like a little more work though, doesn’t it? Right? Add format. When you click format, it’s going to pull up the sidebar and you’re just going to click the percentage box. That’s basically it. The value, a number in this case, and the percentage. There are a few more formatting things that you’re probably going to want to do while we’re in here.
For example, you can add the category name. Okay. So it looks like We’re not going to do the iZigZag, which is also not colorblind friendly or grayscale friendly. We don’t do legends in dataviz. I’m going to delete this built in chart title for now. Okay, it’s getting a little closer to the model right here.
And let me go back to that format menu. We did category, we did value, we did percentage. I’m going to uncheck leader lines. Those [00:04:00] are little gray connecting lines that show up sometimes if you manually drag the label too far away, they just add clutter. I’m going to delete those. The separator. Right now, it’s category, comma, number, comma, percentage.
I’m going to do new line. And the label position, I’m going to put outside end. You might have to manually drag things just a little bit, like maybe you’d have to shrink down your pie chart. Here I am showing you all the edits when I promised myself I wouldn’t, but I didn’t want this one to be cut off, right?
Okay, and then the final thing you might want to do is maybe you make the word Colored and bold. So how you do that, I’ll zoom in to make sure you can see exactly where I’m clicking, cause it’s really small, right? When you click on the label, it looks like nothing happened. You kind of have to like click a couple of times and then depending on where your mouse is, a different section is going to be dark gray.
Can you see that? It’s just, it’s such a slight difference, like a medium gray [00:05:00] versus a light gray. Do you see that? You like, right? The one that’s a little bit darker. So the one that’s a little bit darker, the category label, you can, you have to like, Oh, it’s so hard to click on the right spot. You have to highlight it, highlight the word you have, and then you can make just the word colored.
To match the slice it corresponds to, right? To remove guesswork. And colored font should be bold to make sure it passes accessibility standards. You go through it again, right? Double click on just that first one. Highlight it. That one’s gonna be that second theme color. And bold, etc, etc. Same thing on donut charts.
Okay. Scroll down on your spreadsheet. Let’s practice this again so that it feels more fluent for you. You highlight just the number, you go to insert, you pick out your chart type. Let’s do a 2D donut. If you highlight percentage, if you’re like, duh, [00:06:00] I’ll just do it this way. I’m just going to do it better or something or different.
Um, it’s not going to work. It’s going to show you this nested donut where it has the numbers and then the percentages. And that’s weird. Why would you want your chart to look like that? Okay. We don’t want that. We want just a regular old donut chart. That’s how you highlight just the numbers. You’re going to add the labels and then format them.
So you click on the slices or wedges of the donut, right click, add, click on the labels, right click, format, very similar menu as before. Click category. You’ve got value already. Click percentage, uncheck leader lines, change the separator. We’ll do new line and then Can you place them outside? No, you can’t.
Isn’t that annoying? So you have to manually Right. There’s not the position or location section down here. I just manually drag them, you know, just like a little bit [00:07:00] kind of over here. And then sometimes I get frustrated that this takes a while, but it takes about this long. Delete this part. You’d make it colored, probably delete this, et cetera.
Right. There’s a little bit more formatting to do. You might have to like, I just can’t help but format this for you. Anyway, that’s why I have the completed version. So you can see up to Ann Emery standards, what it should look like. So, pies and donuts. Pretty easy, right? You add the labels, you format them, and you look for the little square checkbox that says percentage.
Pretty darn easy, behind the scenes. Bar charts. They’re a little bit different. We need the second workaround for these. So, for bar charts, we are going to highlight the gray area Just like before, go to insert. This should look familiar, right? Let’s add a 2D bar chart like this, but we want it to look like the number and the [00:08:00] percent.
We can try, we can try the same thing. It’s not going to work, right? Click on the bars, right click, add data labels. Click on the labels. Right click. Format. Where’s the percentage checkbox? It’s not there. That percentage checkbox is only there for pies and donuts. It’s not there for bar charts and a bunch of other chart types.
So we have to use that second workaround. And the workaround is gonna be Helper cells.
We are going to type in exactly what we want here and then whatever is sitting in these cells is going to feed in here. Okay.
Just for kicks, I’ll show you what, uh, what these do. Click on your labels, right click, format. Pulls up the window. Value from cells. This is one of my [00:09:00] favorite boxes. Click that. Ignore this little pop up for a second. All you do is you highlight your helper cells, you click okay, and it shows you the helper cells, comma, the value.
So here is hi at the top of the table, that is hi down there, right? Here is I’m and there’s I’m down there and the value. But you wouldn’t keep this, you would do a little more formatting of course, like you would just remove the value and the leader lines. You can type in whatever there. And it feeds into the label.
Isn’t that nice? So if you want number percent, should I show you the long way? Uh, I’ll show you the long way. And then the short way you could manually, this is a long way. You could manually type in. Uh, this, and then it shows up right there. Whatever’s in the helper cell [00:10:00] goes over there. Now, am I going to tell you to manually type stuff in?
Absolutely not. Absolutely not. You’re going to do a concatenation. You’re going to say equals this and. This ampersand, it is really smushed. It’s the number smush the percent altogether. It’s two, two, four, two, and then it’s 0. 384. It’s all these digits from this division, right? From the numerator and denominator living here behind the scenes.
So you go back in and edit this. If you’ve seen concatenation before, you know how to do this, right? If you’re new to concatenation. Welcome. Hopefully this opens up a whole new world for you of formatting control that you have for your dataviz behind the scenes. Formatting for this would be like, um, what would we have to do?
The number and, uh, quotes. Open parentheses, whoops, quotes, space, open [00:11:00] parentheses, quotes, and the B61 and C61, those are specific locations. Those do not get quotes, but everything else does get quotes. So if I want space, open parentheses, it has to have double quotes around it. And then everything’s just separated by the ampersand, okay?
Number, space, parentheses, percent. It’s not going to be perfect, but we’re getting closer. Number space, open parentheses percent. And you just go back through and you edit it again and again. So let’s add this, uh, let’s do a times a hundred and then we’re going to round this to a decimal place and we’re going to add what else?
Percentage symbol, closing parentheses. Okay, we’re getting closer and closer. Because I do this for a living and I’m very, very picky about my graph labels, I would also go through and do [00:12:00] one more layer of editing where I add the comma, the thousands separator comma, and I would do that using a nested if and left mid and right.
But, That really deserves another video. If you want though, you can look in this answer key and the formula that you’re going to see is going to be much longer because I have nested if and left mid right. Okay. What if, speaking of if, uh, another variation would be what if you have like a Big digits, right?
Like these are little digits, three and four digit numbers. If you have big, big, big digits, like currency, I work on a lot of grant making projects with foundations. They have things like project amounts and they’re often in the millions or tens of millions, sometimes. Same idea where you’d add some helper cells.
This is actually, here’s a really long, there’s, this [00:13:00] nested, if left, mid, right. It gets a lot longer. And the same idea, you could just highlight, insert your bar chart. Does this look familiar now? That’s why I want to show it to you twice. Add the labels, right click, whoops, got to click on them, right click, format, value from cells, select the helper cells you would have made.
Okay, uncheck, uncheck value, uncheck leader lines, and then you do a little bit more formatting so it would look something like this. One downside to using concatenated helper cells is the labels are all the same format. So you can’t make just the number bold and purple or just the percentage. It’s all or nothing.
Um, so I, I don’t love that, but you know, it’s like that, of course there are variations of this, right? Like if you have like really, really, really big numbers, things [00:14:00] like in the millions, you could also write longer formulas, if statements with left, mid and right, so that something like 123 just says 123 K or millions might say 1.
27 M for million. And then your finished version could look, you know, something like this, right? It’s really, really hard to do that, uh, with text boxes. It’s really clunky. You might make typos. You have to manually adjust it all the time. And you can’t just right click and check, check the percentage box.
So I hope that the concatenation, even though there’s a little bit of a learning curve, I think it’s going to save you a lot of time in the end. All right, it’s your turn. Let me know what types of questions you run into. Let me know if you apply it and how this works in your data set.

]]>
https://depictdatastudio.com/how-to-put-numbers-and-percentages-in-graph-labels-in-excel/feed/ 0
How to Write Dynamic Takeaway Sentences inside Interactive Excel Dashboards https://depictdatastudio.com/how-to-write-dynamic-takeaway-sentences-inside-interactive-excel-dashboards/ https://depictdatastudio.com/how-to-write-dynamic-takeaway-sentences-inside-interactive-excel-dashboards/#respond Tue, 25 Jun 2024 15:08:00 +0000 https://depictdatastudio.com/?p=15706 more »]]> I’m a big fan of takeaway text: for reports, for presentations, and even for interactive dashboards.

Sometimes people think that takeaway text isn’t possible for dynamic dashboards in Excel. They worry that they’ll have to write each sentence by hand. False!

In this video, you’ll learn about two ingredients:

  • Concatenation: You’ll use the ampersand (&) to join the content from a few cells together.
  • Helper Cells: There are pivot tables, helper tables (with lookups), and more concatenation to write out the graph labels.

You can write takeaway sentences about:

  • The most or least (the poles)
  • The averages
  • Anything else you think your audience might be interested in

What’s Inside

  • 0:00 Why we need “takeaway text” in data visualization
  • 1:26 Two elements needed: Concatenation and Helper Cells
  • 1:41 Concatenation in Excel – the Primary Language example
  • 2:26 Concatenation – the Months in Program example
  • 3:12 Concatenation – the Household Income example with rounding
  • 3:46 Concatenation – the Residence map example
  • 3:56 Ideas for takeaway sentences to describe graphs: Min and max, mode, etc.
  • 4:36 Helper Cells (linked to pivot tables with lookups)
  • 5:38 Need more info??

Your Turn

Download this Excel dashboard and follow along: https://depictdatastudio.gumroad.com/l/Demographics-Dashboard

Transcript

Ann K. Emery: [00:00:00] I’m a big fan of takeaway text, takeaway text in reports and presentations, even in dynamic dashboards like this one.

Now, a lot of times people are like, “Ann I love takeaway text too, but it’s n/a for me. I can’t do it because I have a dynamic dashboard. I can only put…” This is what they tell me. This isn’t true though.

“I can only put the topic. I can’t also put the takeaway message because then as people explore the data, I can’t like manually write all these sentences.” Okay. But false. Look at how the takeaway sentences, let me zoom in so you can see this one a little bit better. Look at how they change as they interact with the dashboard.

It’s dynamic. Look, it says 17 people. And then I’m looking at this one right here at 17 people. And then it says 14, and then it says 11. This one changes. This one changes. This one doesn’t change because it’s always English is the most common language in this fictional data set about fictional programs.

Um, [00:01:00] but if it did change, if it was suddenly Farsi or French, that’s what the sentence would say, because look, It’s concatenated, okay? It’s not done by hand. I didn’t, by hand, just type in, like, blah, blah, blah, blah, blah, blah. That would be a ton of work. It would defeat the purpose of an interactive dashboard, right?

It, like, it wouldn’t be possible to write those by hand. So, This is what this video is about. I’m going to show you behind the scenes how you need these two things. Okay. You need to concatenation and you need helper cells, concatenation and helper cells. I’m going to show you the concatenation first, and then I’ll show you the helper cells in a moment.

Concatenation is is a formula. Okay. I’m going to just going to type this one right here so you can see it. It’s a formula. So you start with equals. You say equals the helper cell you would have already set up. That’s over here. I’ll show you this in a moment. Stay tuned. Okay. Equals the helper cell and double [00:02:00] quotes sentence structure, double quotes.

Okay. Helper cell where you already have English selected and Double quotes, sentence structure, double quotes. English is the most common language at this site. Double quotes. Press enter and your sentence structure is written for you. Let me show you this one. Uh, let me move this one down, make a little bit of space.

It would be equals helper cell. Where do I have my helper cell? It would be under the, let’s see how well I labeled this. Okay, under the months in program section with the pivot tables. Here’s a helper table and I’m going to pick this helper cell. Okay. Equals helper cell and that’s concatenation. It joins things from different cells together and quotes sentence structure quotes.

What did I want this one to say? [00:03:00] 14 people, double quotes, space people have blah, blah, blah, blah, blah, blah, period, double quotes. Enter 14 people, blah, Okay. Uh, this one is really, really similar. It’s got two helper cells. It’s helper cell, the number and double quotes people at this site. Up to their open parentheses.

When you have parentheses in your sentences, it gets a little tricky too. Cause some of your formulas are going to have. Parentheses. And here’s the other help or sell with the percentage that I had to round. And then I add to multiply to a hundred and then I had to add the percentage symbol, you know, et cetera, et cetera, double quotes at the end.

What did I have in this one? Participants live in and help or sell. So you have to think about what should the sentence say? And in your real life it’s going to be [00:04:00] different. Then these obviously ideas for you, it would be things like calling out the most or the least the polls that makes interesting data stories.

It could be, um, here’s a poll. That’s the most, it could be a big slice, a little slice, something you think your audience might be interested in. Here’s another idea of showing the most like nine people are from Montana. In this site, whichever site is selected here. Okay, that’s concatenation, concatenation, right?

You’re adding helper cells and some sentence structure. It’s joined by the ampersand. The second thing you need is you need the helper cell, right? So it’s over here and I’ll show you, I don’t know, which one should I show you behind the scenes of maybe this one, the language one. So right here, I’ve got a pivot table.

Of the languages. And then I have a helper table because I needed this helper table to [00:05:00] change it from person to people do that on a couple of the charts, right on zero people, but then this one says one person. So a lot of times I’ll do cells like this, so I can have the actual number, but then the graph label right next door.

I figured out how many languages there were. I did a ma, a Simple Max formula. You’ve seen that one before, right? What is the, what is the most, what’s the category the most? And then I did a X lookup to say if it’s 21 is the most, what language does that correspond to? It’s English. Let me know which of this, these techniques you’d like more info about.

Do you wanna hear more about helper tables about. Graph labels that are dynamic about person versus people, XLOOKUP, MAXFORM, I don’t know, you tell me, you tell me and I’ll get through as many of your questions as I possibly [00:06:00] can.

]]>
https://depictdatastudio.com/how-to-write-dynamic-takeaway-sentences-inside-interactive-excel-dashboards/feed/ 0