transcript

excelisfun - Excel Magic Trick 1162: Cell Reference That Point To Empty Cells Evaluate To Zero, IF Function Trick

Thumbnail of the video “excelisfun - Excel Magic Trick 1162: Cell Reference That Point To Empty Cells Evaluate To Zero, IF Function Trick”
Download Markdown
Community upload. AI output has not been independently verified.

Welcome to XL Magistri number 1,162. If you want to download this workbook and follow along, click on the link below the video. Hey, in this video we want to talk about the IF function. Now, back in 1155 I actually went through all these formulas for a checkbook. This is not a checkbook, this is an inventory tracker, so check this out. We wanted the formula to check over here to see if it was equal to double quote double quote, which is a way for checking whether there's something in the cell or nothing, and then if it is empty, in essence we want to show nothing; otherwise we want to run our formula. Well, there's all sorts of different ways we could do this. We could do IS BLANK, and again, in this video I explain how all these work. This is a great one that appears in lots of Microsoft templates: if the cell is not double quote double quote, then run the formula, otherwise show nothing, or even this, IS NUMBER. But the way we were doing this inventory tracker in class, Aisha in the class introduced the Aisha method. Now check it out: we're either going to have dates or empty cells, because remember we want our formula down here to run, so as soon as we put a date, it shows up. So check this out. Aisha said equals IF, and for the logical test, yes, it's true. We normally put something that evaluates to TRUE or FALSE, but guess what? If we just click on the cell, since dates are serial numbers and down here there's nothing, the logical test interprets any nonzero number as TRUE and zero as FALSE. Now, you need to know that empty cells, when we have a cell reference in the formula pointing at an empty cell, always evaluate to zero. So if our data entry is consistent, we will always have dates, which are serial numbers, or empty cells, which evaluate to zeros in formulas. We have our TRUE/FALSE. All right, so if it's true, then we need to take the balance from above plus units purchased minus units sold; otherwise, double quote double quote, which is a zero-length text string that shows nothing. Close parenthesis, Control+Enter, and double-click and send it down. Man, that's the Aisha method. Let's prove that to ourselves. Because that cell reference is in a formula, when it looks at an empty cell it evaluates to zero. We could just double-click and hit the F9 key to evaluate and see it in our formula. Be sure and hit Escape if you do that. Or we can go up to Formulas, Evaluate Formula, or we can use the keyboard Alt+M+V, and watch this. We can evaluate with our mouse, or we can hit Enter, and sure enough, you can see there is the zero. All right, thanks to Aisha for that method. We'll see you next trick.