transcript

excelisfun - Excel Magic Trick 1402: Formula to Put Check Mark In Cell If Number Greater Than Zero

Thumbnail of the video “excelisfun - Excel Magic Trick 1402: Formula to Put Check Mark In Cell If Number Greater Than Zero”
Download Markdown
Community upload. AI output has not been independently verified.

Welcome to Excel Magic Trick number 1,402. If you want to download this Excel workbook file so you can follow along, click on the link below the video. In this video, we get to see a formula to put a check mark in a cell if the number is greater than zero. Here's what the end result should look like, and guess what: it's going to be a kind of indirect solution based on ASCII characters.

Let's go over to the sheet 1402. I'd actually like to build the whole list of ASCII characters, but we'll do that in a second and search through to see which one is the check mark. But before we do that, here's what I did: I went to Insert and Symbol, because I knew there was a check mark there somewhere. Or I used the keyboard, Alt+I, and went straight to Wingdings and searched through this list, and sure enough, down here there is the check mark. There's actually a couple of check marks. Now if I insert this by clicking it, then clicking Insert and Close, I can see that is a check mark. But if I look up to the formula bar, that's the character that's sitting underneath. If I go over to Home, it's got a character, and on top it has the Wingdings font. So now I want to figure out which one of the many ASCII characters this is.

I'm going to use the CHAR function, but I need the code, and I don't know what code number it is. No problem. I'm going to generate all 255 ASCII characters. This is a cool trick, because ASCII characters can sometimes be the answer to a particular problem. I put the number 1 and want to extend down to 255. Watch this trick: in the lower right-hand corner, that little box is called the fill handle. When I move my cursor over top of the fill handle, I see the crosshair, or "angry rabbit." I'm going to right-click, drag down, then drag back up and let go, and up pops a secret menu. Now I'm going to do that again: right-click drag down, drag up, let go, and there's the secret menu that gives us access to Series. There are actually a few other ways to get to Series, but that's a cool, fast way.

I need to extend 1 to 255 down the column. Step value is 1, please, and stop at 255. When I click OK, instantly I have the numbers 1 to 255. Control+Down Arrow shows that, yes, it created the list down to 255. Control+Up Arrow. Now I can use the CHAR function. It needs the number, or the ASCII code. I'm going to click on the number 1. CHAR goes from the code and shows you the character. There's also a CODE function, so if I did CODE of that, which we'll do in a second, it'll show me the number, whichever number it is. Close parentheses, Control+Enter, double-click, and send it down.

I showed you this list because again, this is a good skill to have, since sometimes you need to figure out what the code or character is. Why are some of them blank? Well, this one happens to be character 10, which is a line feed, or in Excel, it's Alt+Enter, a line break in a cell. If you go over to the sheet 1402 Answer, I have the full list here with what each one actually is.

Now let's try Control+Home to jump to cell A1. Let's try this one: equals CODE. This is what I should have done in the first place. What's the code of that? Control+Enter. It's 252. If I go down to the bottom with Control+Down Arrow, sure enough, there's the actual underlying character. If I click over here, where I inserted it down here, there's the same character, 252, with Wingdings. So there's our solution.

Control+Home. Now we can come over and build an IF formula. Remember, we use the IF function anytime we have one of two things we want in the cell: we either want to show nothing, or character 252. Our logical test is some logical expression that comes out TRUE or FALSE. I'm going to say: hey, relative cell reference, are you greater than zero? Comma. When that logical test comes out TRUE, then what do I need to put in the cell? CHAR(252), close parentheses. That's the value if TRUE. Comma. If the logical test comes out FALSE, what do I want? I need to show nothing, so I use a double quote, double quote to show nothing. That's technically a zero-length text string, but it's what we use in a formula to show nothing. Close parentheses, Control+Enter, double-click, and send it down. Just what we want.

With the column selected, I go up and select the Wingdings font, and there are our check marks. When this -1 turns to a 95, instantly we see a check mark. Control+Z. All right, that's a little fun putting check marks in. Whoa, look at that: that's our formula in Wingdings. Imagine if we had to type out our formula like that instead of like that up in the formula bar.

All right, we saw the IF function. We saw how to use CHAR on the numbers 1 to 255 to show everything. We saw how to insert a symbol and then use CODE to figure out what the code is. We'll see you in the next video.