transcript

excelisfun - Excel Magic Trick 1225: Excel/Word Mail Merge for Customer Accounts Receivable Letter or E-mail

Thumbnail of the video “excelisfun - Excel Magic Trick 1225: Excel/Word Mail Merge for Customer Accounts Receivable Letter or E-mail”
Download Markdown
Community upload. AI output has not been independently verified.

Welcome to Excel Magic Trick number 1,225. Hey, if you want to download this start file for Excel or you want to download the start file for Word, click on the link below the video. Hey, in this video we want to see how to in Word do a mail merge. This is a letter we need to send out to our customers about their balance owed. Over in Excel, I have a table. Field names are at the top, and records are in rows. These are the customer name, address, email, and the balance they owe.

Now, the amazing thing about mail merge is that I can, with one Word document, connect this letter to this database, and it will know to send out a new letter for each one of the records. Actually, when we get over to Word, we're going to filter it over in Word and filter out these zeros.

The cool thing about mail merge is that if I use the Mailings ribbon tab, select Recipients, and tell it to look at this Excel workbook, if I add records or change the data, that Word document mail merge will totally update. However, I'm over here in Excel, and I actually want to convert this to an official Excel table, which is even more like a database. As I add new records to the bottom or take away records or dump a new data set, the Table feature will totally update, and actually it will add the benefit of carrying this formatting down so we don't have to type it in.

Now, click in a single cell, any one cell, and go up to Insert and click on Table, or I'm going to use the keyboard Ctrl+T and Enter. Now I have an Excel table. The mail merge does not need this, and it won't even pick it up when we do mail merge. It'll see the sheet name, but again, if I add new records, the Table feature is more dynamic.

Now I want to go up to the Table Tools and go to Design, and over here, even though this name is not going to show up, if you have an Excel table, you definitely want to name this. So I'm going to type "Customer Balances" and Enter. If you go back up there and look, you can see it says Customer Balances. Right now that's all I'm doing here. I'm going to save this and close the Excel file.

Now we're on the Mailings tab. I first need to connect this letter to that Excel database, so I click Select Recipients, Use an Existing List. I navigate to wherever my table is. I happen to have mine on the desktop in a folder called Mail Merge, and there it is. Double-click, and see, it shows us the sheet name. It doesn't show us the table name, but that's the correct one. Click OK.

Now I can edit the recipient list, and this is awesome, because yes, I could use Sort, Filter, Find Duplicates, and some things down here, but I'm just going to scroll over and go to the Balance Due column, and just like in Excel, there's a little drop-down. At the bottom, I can filter based on an advanced condition. Now it's not really an advanced condition. I just tell it the field, Balance Due, comparison, that just means the comparative operator, and I'm going to say greater than, greater than what? Zero. So field Balance Due, comparison greater than, compared to zero. So anytime the balance due is greater than zero, we will see that record, and just like that, we see that it's filtered over here. This is dynamic. If I change the data, change a few of these numbers to zero, those records will instantly be removed and there'll be fewer letters over here. So I'm going to click OK.

Now the mail merge part. We want the inside address, and we want the first and last name, and we want their balance. All of that data is from the table. Now I'm going to highlight the inside address because I don't want that, and hit Delete. Mail merge is awesome. They have an Address Block, so you don't have to add City, ZIP, etc. I just click the Address Block. Now most databases name their fields or their column headers correctly, names like First Name, Last Name, Address, City, State, ZIP, and that's why it gets it correct here. If it wasn't matching up, then you click the Match Fields, and then you can choose. If it wasn't seeing the first name, you would simply click this, and notice those are all the fields from our Excel table, so you can match any way you want. Click Escape. It got it right, so I'm simply going to click OK.

Now, that is code over here in Word that says go and get the right data from that Excel table, and you can look at the code by right-clicking. By the way, you can always tell it's a field, that means there's some code underneath doing something when you click on it, and it's gray. But we can right-click, Toggle Field Codes, and instantly you can see that's all the code telling this Word letter to go over that database and get all the right address data. Right-click, toggle. It's a toggle. You can also use the keyboard Alt+F9. Notice we have a bunch of code in here, and later we'll have some more code here and here. Right now we have the code for Address Block and for the current date, so I'm going to Alt+F9. That's a toggle. Alt+F9, Alt+F9.

Now we need to come down here to "Dear" and connect "Dear" and then First Name and Last Name to the fields over in the table. So look at this. We go up to Insert, Merge Field, and there are our field names from that Excel table. I'm going to click on First, space, and then Insert Merge Field and Last. If I Alt+F9, I can see clearly there is some code under there to get First and Last. Alt+F9.

Finally, we're going to need, and by the way, I have my nonprinting characters turned on. Home, that button right there is so important in Word, because I need very carefully, and I Control and zoom in, I need very carefully to get my merged code there to go right before the period but after the space. Notice if I didn't have nonprinting characters turned on, I wouldn't be sure exactly what is there.

All right, so you're ready. Now I'm going to go up to Mailings, Insert Merge Field, and Balance Due. Now we have, and I'm going to Control and roll to zoom out, now we have our letter. We can go up to Preview Results and look at that. Isn't that totally amazing? There's the person's name, there's the address, and there's the amount. As I click the forward button, new customer, new names, and new amounts, all the way to the end, there are seven records.

Now there's a problem here, and it's the number formatting. When we did mail merge and connected it to a field over in that Excel table, or actually any database, that's a number, there's always a problem in mail merge. So we actually have to do number formatting over here in Word. If you ever forget how to do this, because it's hard to remember exactly the right code to put in here, just go over to Google and type "Word mail merge currency format" or "Word mail merge percentage format," and there are tons of links that will help you figure out how to do this.

All right, now I'm going to right-click, Toggle Field Codes. There it is: Merge Field Balance Due. You need to come right to the end, and we need to type what's called a switch, backslash, and then pound sign. That means whatever comes after is going to be the number formatting. Then I'm going to type a space, and I'm going to put a dollar sign. That means show dollar sign, comma for a comma separator for the thousands, and then pound, decimal, 0, 0. Now if you know custom number formatting over in Excel, it works pretty similarly here. We just had to know to put that little switch.

Now when we right-click and toggle back, it's not quite right. I'm going to come up to Preview and click it once, and then click it again, and now we have our format. If I go back through the records, I can see each record has the right number formatting.

Now we can go and finish the merge. If I click the drop-down, I'm going to say Print, and it will ask me all current record or particular number. Click OK, and it prints. I'm going to click Escape because I don't want to print.

If you want to email them instead, watch this. This is amazing. It requires that we have an email field over in our Excel table, right? And sure enough, when I click Send Email Messages, it looks over to the database. It knows that there's a field called Email. If it didn't get it right, there's a drop-down with all of our fields. Now we can type a subject line, something like "Past Due Balances." You can choose to put it as an attachment, plain text, or HTML. You can select All, Current, or From and To. If you click OK, it'll email it. Please don't do it, because those emails in the database are not real, but that's amazing.

Now there's one big caveat for the email part of this: if you don't have Outlook on your computer, it will not work. In most cases, people have the full Office, and that's how it's meant to work. We're using Excel, Word mail merge, and then Outlook.

All right, I'm going to click Cancel. That is quite amazing. Now I want to save this, Control+S, because I want to test it. Notice right now we have seven letters because there are seven records over in our Excel table that have balances greater than zero. So I'm going to save and close this, and then open the Excel table. I'm going to change some of the data. These two customers right here, I'm highlighting them both, typing zero in the active cell, Control+Enter to populate that zero into both cells. Notice 1, 2, 3, 4, 5. Control+S. Now there'll be only five letters in our mail merge.

Now watch this. When I open up this Word document, it will automatically run the mail merge. It's asking if I want to, and I'm going to say yes. Now I go up to Mailings, and sure enough, if I go 1, 2, 3, 4, 5, boom, there it is, only five letters.

Now let's do another test. Let's add some new records and see if our mail merge will pick it up. It should be, it's pretty amazing. I'm going to click save back over in Excel. Now this is an official Excel table using the Excel table features, so it's like a real database. When I come to the last record and hit Tab, it adds a new record. Now I'm going to type "June," Tab, "Chin," Tab, "1400 12 Street," Tab. Now I'm in Excel, so when I type an S, it's looking above. This is called AutoComplete. When I hit Tab, it adds "Seattle," W, Tab, it looks above and it adds it. 98122. Actually, when I made this data set up, this has the raw long zip code. Those are not real zip codes, but you get the idea. I have my email and Tab, and the balance is 5,945 bucks. Control+Enter. Now that's a new record. Control+S. There are six of them here. So when I close this after saving it and run my mail merge, double-clicking that Word document, clicking yes, when I come up to my Mailings and Preview, you've got to be kidding me. There's the 6th, June. That's pretty amazing, using Excel and Word to do mail merge.

All right, we'll see you next trick.