Introduction
Welcome to Excel Magic Trick 1921. In this video, we're going to see how to create an automatic checkbook bank reconciliation formula. Actually, formulas, because we've got to have one for our book balance and one for the bank balance. We'll work on the sheet 1921 and I'll show you the single input, single output formula first. That means individual cell references, and then we'll do a dynamic spilled array formula.
Fundamental problem with tracking bank account balances, and thus why bank reconciliation is such an important accounting task
Here's the ultimate problem. When you're tracking your bank account balance and the bank is also tracking it, if you go to the bank and try to find this number, they might not know about all the transactions in your book. Similarly, the bank might have transactions that you don't know about. But for us, we want to worry about this column right here. Our book balance has to take into consideration everything. So we need to add or subtract for each particular cell. For example, for our book balance, we'd have to manually say, "Hey, I'm going to take this minus this minus this minus this plus plus," and that would be the balance. But for the bank, they don't know about this one, so it would be an in, a plus, minus, plus. But forget that one. Enter.
So somehow, automatically, we need to get these two different balances based on the Y in this column. Not only that, but the key is we open the website with the bank balance. Once we find a transaction like this one right here, we simply type a Y, enter, and now the bank balance updates. And what do we do? We look at this number and check if it's the same over there. If they are, bam, we have reconciled. Not only that, but the formula should work even if we don't know about those two. But now we just looked at our website and found this number, so why not better subtract it? And sure enough, it did. But notice up here, we still have these previous balances, which are correct for the bank but not for us.
Data Validation dropdown list feature to verify that only a y value can be added to the reconciliation column
All right, let's see how to do this. Since the formulas are going to be looking at the letter Y in this column, it might be helpful to set this up in advance. Go up to Data, over to Data Tools, and we want to add Data Validation. When I click, we're allowed to create a rule that says, hey, what goes into each cell? I don't want to allow the default any value. I want a list. And check this out: I can just type the letter Y. It is text. I don't even have to put it in double quotes. Click OK. Now in each cell, I have a dropdown with a Y. That way we don't accidentally type "y space" or an x and mess up our formula.
1 Formula to calculate "My Book Balance" using the SUM, IF, and ISNUMBER functions
Now for my book balance, I obviously need to add and subtract, but it's always going to be looking at the previous balance. Watch this. Equals. I'm going to click on that cell. That really won't work because it's not a number. It's text. But let's try it: plus whatever the in is, minus whatever the out is. Notice we can have a formula with these two cell references pointing here, minus and plus, because when we don't put something there, it's just going to be zero. But of course, Ctrl+Enter, that value error says you put something incorrect into this formula. F2, and sure enough, the operators plus, minus, and other math operators don't work on text.
But here's a killer trick. Equals the SUM function, which is programmed to ignore text. So I just say: hey, take the previous balance, comma, in for this row, comma, minus whatever we put for this row in out. That is a beautiful trick when you're trying to create a formula for a running balance. It worked, and look at that: it totally ignored the text in one cell above.
SUM function trick to reference the previous bank balance (Relative Cell Reference) and not get a #VALUE! Error
Now, to copy this formula all the way down, use that little green box in the lower right corner. That's the fill handle. Right now, the cursor is called the selection cursor, but if you hover over the fill handle, you see the crosshair. That's what Bill Gates calls it. I like to call it the angry rabbit. You can click and drag, and this copies the formula down. Now we can pick any particular cell, F2 to put it in edit mode, and sure enough, it's doing its job. It's looking at one cell above for the previous balance, then subtracting E7 and adding F7, zero, and F2 right there. SUM has no problem with that text.
Now, what we'd like to do is only have the formula appear when we enter a date. From row 12 down, I don't want these formulas to show, but as soon as I put a date, I want the formula to pop up. We're going to put one of two things in the cell, and anytime you do that, you use the IF function. So after the equal sign and before SUM, I type IF, and when I see it in the dropdown, I hit Tab. We need a logical test, and that logical test has to come out true or false. All I'm going to say is, hey, is there a date? But wait a second, what is a date? A date is a number. So I'm going to nest a function right inside the logical test: ISNUMBER. I see it there, I hit Tab. The value will be a relative cell reference, so as we copy down, it's always going to look at the date in this row. Close parentheses, and I'm going to click back. ISNUMBER delivers a true or false to the logical test. If it comes out true, that means there's a date in this row, and that's the formula it's going to run.
Now we come to the end: comma. What do we want if it's not a date? That means ISNUMBER delivers a false. We're going to use the syntax to show nothing: double quote, double quote. Technically, that is a zero-length text string, so it is something: it's text with zero length. But that's what we use in a formula to show nothing. Now close parentheses, Ctrl+Enter. Instead of using my angry rabbit and clicking and dragging because there are formulas all the way down, I can simply double-click and it sends it all the way down. That is looking good. F2 right here. I can hover and see it says FALSE, so the formula didn't put the value if true in this cell. All it did was display nothing. Whereas F2 and click on the logical test, hover, that got a TRUE. Sure enough, with the value of TRUE, it ran the formula. Now let's test it. 12/3, Enter, and sure enough the formula pops up. This amount is 792.36. Enter, and it's working both ways: it's showing up when we enter a date, and when we add a new number, it adjusts the book balance.
2 Formula to calculate "Bank Balance" using the SUM, ISNUMBER, and two back-to-back nested IF functions
Now, the formula to calculate the bank balance is very similar, but check this out. We need to consider whether a Y is in the reconcile column. We also have to include that date condition: is there a date in this row? If yes, then show the formula. This formula is not going to be looking at the previous balance in my book balance column. It's going to be looking at the previous balance in this column. Let's start off with IF, and then IF again. For the first logical test, if we find a Y in this row, that's G4, we ask the question: hey, are you equal to "Y"? In double quotes, because that Y is text and text always has to be in double quotes. That's the logical test, true or false, comma. If it comes out true, we want our SUM function looking at the previous balance for this column, comma, minus the out. Now I want to close parentheses. If that Y is not there, meaning it comes out false, comma, I just want the previous balance. For example, right here, since there's no Y, the formula will come out false, and it's not going to calculate the new balance. It's just going to grab the previous value and repeat it. So there we go. Close, Ctrl+Enter.
Now we could point to the fill handle with our angry rabbit and click and drag. But watch this, a cool trick. If I try right now, there's nothing next to it, below it, or on the right of it. But if I highlight the cell right there, now that's touching something. So when I double-click and send it down, it goes all the way down. If I go to the last cell and hit F2, I'm verifying that all the cell references are correct, and they are.
Angry Rabbit (Crosshair) Trick #1
Now let's turn it off once we don't have a row with a date. F2, back-to-back IF functions: IF, and then ISNUMBER. We're checking the date in this column, the B column, as a relative cell reference. Close, comma. That comes out true or false. Right now it's true, with the value of TRUE. Bam, that's what we want to run. Comma at the end. If it's false, double quote, double quote, that zero-length text string to show nothing. Close. Ctrl+Enter. Double-click and send it down, and that is working. If I put a Y here and press Enter, our formula is updating.
Angry Rabbit (Crosshair) Trick #2
Angry Rabbit (Crosshair) Trick #3
Next video: Dynamic Spilled Array Formula
When I started the video, I said I was going to show you the dynamic spilled array formula in this video. But no, I'm not going to do that, because there are a bunch of new concepts and ideas. So we'll leave the single input, single output formulas for Excel Magic Trick 1921. In the next video, 1922, we'll see how to use some cool functions and create a dynamic spilled array formula.
Closing
All right, we'll see you next Excel Magic Trick.
