Welcome to XM magri number 1,133. Hey, if you want to download this workbook file, click on the link below the video. Hey, 1128 to 11131, we were talking about aging of accounts receivable reports. 1133, we're going to do yet another aging of accounts receivable report. Now, in 31, we did a pivot table, but we talked about how when there are duplicates, the pivot table doesn't work, because the pivot table by its very nature does an aggregate calculation. So in this video, we want to see how to use the pivot table to create our report and create a unique identifier if we have to.
Now, in this amended data set, this is a different data set than these other ones. Hey, we have invoice number, which is a unique identifier. So even though there are some duplicates, and what we mean by duplicates is this: deadbeat actually took two invoices out on the very same day, and it's going to be the same number of days late. So that would constitute a duplicate. If we dropped the amount into the sum area, the pivot table would actually sum these instead of listing both of them. So no problem. Now we have an invoice, we have a unique identifier. We will not have that problem after we do our first pivot table with the invoice number. We'll see what to do, how to create a unique identifier when we don't have one in our data set.
All right, now we're going to have to create a couple of formulas. Days late: in these four videos, I actually did the wrong formula. I did the actual number of days until the due date. I did due date minus invoice date, and actually I left an annotation. So the simple formula for days late is not complicated. It's using the TODAY function. Now, TODAY will always give you today's date. I'm shooting this on July 16th, so that's going to deliver July 16th. Tomorrow, when I open the spreadsheet up, it'll deliver July 17th. So we're always going to take TODAY, which is a dynamic date generator, and subtract the due date. That formula will give us the number of days it's been since the due date. Control enter. Now that's number formatting that's been sucked from our input cells there, and we want to get rid of that, so we apply the General format from the drop-down. Now, there's a keyboard shortcut for this. If you do a lot of date and time math, you've got to know Control Shift grave accent, or tilde. The grave accent tilde key on US keyboards is to the left of the number one. So you ready? Control Shift grave accent tilde. There we go. Double-click and send it down.
Now we want our report label that we're going to use in the filter area of the pivot table. We have our lookup table here. Here's the lower number of days for each one of the categories. That's the reporting category. We want to return to this column. So I'm going to use VLOOKUP, looking up days late as the lookup value. The table's first column, second column, F4 to lock that. Comma, the second column, that's this reporting category. That's the thing we want to go and get and bring back to the cell. So I put two to tell VLOOKUP to get the thing from the second column. The fourth argument, range lookup: we don't need it. The default is approximate match, which means it's looking up a number in a range in the first column. So the default is approximate match. We simply leave it out, close parentheses. Control enter, double-click and send it down.
Now we have our unique identifier column for invoice number. But what would we do if we didn't have this? Well, the thing that's causing the problem is this name. It's listed twice. So if you drop it into the row areas, these will get added. So check this out. We're going to actually create a unique identifier ourselves. This is only if you don't have the invoice number. We're going to use a text formula. Hey, I'm going to get the name. Control enter. That's just a relative cell reference. Copy it down. But down here, what I'd like is a dash one, and then here I'd like a dash two. Well, we can get those numbers by counting from this column with an expandable range. Let's click in H8 and hit the F2 key to put it in edit mode. Now we need to join that relative cell reference with the join symbol, Shift 7, and then COUNTIF. Now the range: we're going to do something tricky. We're going to create an expandable range. So I'm going to click in that cell, A8, type Shift colon, comma, and then click on A8 again. There's our formula. The only trick is we want to lock the first A8 with our F4 key. Now as we copy this down, that blue range will expand. That A8 is locked here, but that one is not. Control enter, double-click and send it down. You can see all the ones, but look at that down there. Let's put this in edit mode and see how cool this is. There's that expandable range, that orange range. When I come down to the next cell and hit F2, it has expanded, so it only gets one when it sees the first one, but now it's allowed to count two. That is pretty cool.
Now let's scroll up here. I think in F2 I'm going to add a space and a dash or something. So after the first ampersand, I'm going to put double quotes, space, dash, space, and double quotes, and then a second ampersand. Now we're joining three things: one, text; two, is the dash; and three, COUNTIFS. Control enter, double-click and send it down. That will work.
Let's click in a single cell, and we're actually going to build our first pivot table off the invoice number. Alt N V, Enter. If you're in Excel 2013, that's for 2010 and 2007 it's Alt N V T, Enter. All right, now we want to get our invoice number for our first pivot table. Invoice number is going to go down to Rows, and immediately I'm going to take days late and drag it down to the Values area. Now I want to sort this, so I'm going to click in that C, right-click, sort largest to smallest. All right, so the biggest ones are on top. Now let's continue building our report. We want customer name right after invoice. I don't like the way that's looking. I want to change the design, so I'll go up to Design, Report Layout, and Show in Tabular Form, which will show things in rows. I don't want these totals here, so I'm going to go up to Subtotals and do not show subtotals. Oh, that's looking good. That "sum of" date is no good. I'm going to hit F2 and simply edit this right in the cell and get rid of the "sum of." Right now, if I enter it, it won't let me, because there's already a field named like that, so I'm going to cheat and put a space at the end. Enter. All right, now I want invoice amount down. Actually, I think I can just click it, and it will go right down to the Values area. We have the same problem here. This one I'm going to double-click and open up. I want to get rid of the "sum of," but I'm going to put the extra space in between and then hit Number Format and maybe Currency. Click OK, click OK. That's looking good. Report label down to Filter. Right now it's showing all of them, but that's the trick. Notice here, let's double-click this sheet, 12 here, and call it Pivot PT in parentheses 1. Enter.
Now, the cool thing about this, as we saw in one of our earlier videos, is now we can go to Analyze, Options, and "Show Report Filter Pages" will create an individual report on each individual sheet for each reporting category. Why? Because the filter, whatever field you have in your filter, it will figure out what the unique list is and create a pivot table for each one of them. All right, so you ready? Show Report Filter Pages. It asks us which one; there's only one. So I click OK, and instantly I have my report. There's the report for 1 to 30, 31 to 60, 61 to 90, and even 91 to 365. That's pretty awesome, especially that Show Report Filter Pages.
Let's go back over to 1133. Alt N V, Enter. I'm going to drag unique identifier down to Rows, days late, F2, get rid of the "sum of" there and put a space at the end. We can go to Analyze, Options, Show Report Filter Pages, click OK. You've got to be kidding me. Look at that, the same report. It looks like we might have to change the column width there, but that is amazing. All right, that's a little bit of fun with pivot tables and invoice numbers and unique identifiers and creating aging reports. All right, we'll see you next video.
