New Feature: Playlist Center! Pick a topic and let our playlists guide the way.

Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Using IF...THEN...ELSE for intelligent merging

From: Word 2007: Mail Merge in Depth

Video: Using IF...THEN...ELSE for intelligent merging

Almost any mail merge will work better if you use If fields to add some logic to your merge. With If you direct Word to examine the data for the record being merged, then take a specific action based on a value in that data record. For example, if your data source contains address information, you could send one paragraph to your recipients who live in California and a different paragraph to recipients who live in other states. Another use of If is getting rid of unwanted spaces and unwanted punctuations that results from blank fields in address blocks or in the name.

Using IF...THEN...ELSE for intelligent merging

Almost any mail merge will work better if you use If fields to add some logic to your merge. With If you direct Word to examine the data for the record being merged, then take a specific action based on a value in that data record. For example, if your data source contains address information, you could send one paragraph to your recipients who live in California and a different paragraph to recipients who live in other states. Another use of If is getting rid of unwanted spaces and unwanted punctuations that results from blank fields in address blocks or in the name.

At its simplest, an If field works like this. If a condition is met, display the first result. If it's not, display the second result. In our letter, we actually have a paragraph that we want to have appear only for folks who are not in the state of California. You will notice that we have in blue, "We want to make it even easier for out-of-state members to participate. Jeff Jones is handling your housing and transportation, and will contact you directly." And we would like that sentence to appear for the folks who live in Oklahoma and Colorado and Wyoming, but not for our people from California who are not out-of-state.

Let's see how we can handle this with an If. First, I am going to simply remove the formatting and we are going to cut this sentence so that we have it available for our use. We will add a space because we would want a space and we will go to the Mailings tab, to Rules and choose If Then Else. And it says If the Business State and now we have two choices. We can say if it's equal to California, or if it's not equal to California and that choice will determine where we are going to paste our text.

So let's say, for example, that if the state is equal to California, then we are going to do nothing. However, if it's not equal to California-- and I am going to do Ctrl+V to paste our text that we just cut from our letter. So if the state is equal to California, do nothing. Otherwise, insert this text because we can assume that person is out-of-state. We could have also chosen to do this again and sort of in the opposite direction.

We could say if the Business State is not California, do this. Otherwise, do nothing because it is California. That's sort of reverse logic but it's sometimes the way you want to be thinking about how you use If. Let's go ahead and say OK. And you will notice that our field, if I select a field, the text is slightly smaller than our text that we have here. So let's go back to our Home tab and we will notice this is Calibri 12, and at that box that we typed into actually returns 10 point font. That's okay.

Let's just select and format this as Calibri 12 and by formatting the field, it will come in properly. So now when we actually conduct this mail merge, let's go back to the Mailings tab, and we are going to edit individual letters and merge all the records and what we will find is that Crystal, who is in Albuquerque, has this additional paragraph and Guy is in Arizona. He has this additional sentence in the paragraph, okay and Nora. But notice that when we get to Keisha Bird, who lives in California, there is no sentence about Jeff Jones being available to manage for travel.

She doesn't need to Jeff is doing for anybody else. She is in state and that's fine. So as we go through our letters, we will notice that the folks who are in California like Billy don't have that remaining line, but if you are in Charlotte, Wisconsin, Jeff Jones is going to handle your housing and your transportation. If fields are incredibly powerful and once you have mastered how to use If, you are going to find even more reasons that you can use mail merge and fewer reasons that you believe you need to type individual letters that actually go to groups of people.

Show transcript

This video is part of

Image for Word 2007: Mail Merge in Depth
Word 2007: Mail Merge in Depth

22 video lessons · 6287 viewers

Gini Courter
Author

 

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold

Are you sure you want to delete this note?

No

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.