Word Mail Merge with IF and AND

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Notelteirs

Thread Starter
Joined
Nov 25, 2010
Messages
2
Hi,

I would like to set up a word mail merge the following:

If field OPTION1, OPTION2 and OPTION3 are al three empty, I would like to show the text "no options available" in any other case I would like to display these options.

I was thinking it would be something like this.
{IF<<OPTION1>>AND<<OPTION2>>AND<<OPTION3>>="" "No options available" <<OPTION1>><<OPTION2>><<OPTION3>>}

Unfortunately that doesn't work.
The problem is likely the AND selector. I haven't found any documentation of how to use AND selection in Word.

Any ideas? Help would be greatly appreciated.
 
Joined
May 8, 2009
Messages
51
I've nested IF statements together to show "No options available" if all three are blank.

I'm assuming you know this, but make sure you're using Ctrl+F9 to enter the curly brackets (you won't be able to just cut and paste what I'm shown you here):

{ IF {MERGEFIELD OPTION1}<>"" "{MERGEFIELD OPTION1}{MERGEFIELD OPTION2}{MERGEFIELD OPTION3}" "{ IF {MERGEFIELD OPTION2}<>"" "{MERGEFIELD OPTION1}{MERGEFIELD OPTION2}{MERGEFIELD OPTION3}" "{ IF {MERGEFIELD OPTION3}<>"" "{MERGEFIELD OPTION1}{MERGEFIELD OPTION2}{MERGEFIELD OPTION3}" "No options available."}"}" }


I hope I've copied that correctly. The logic behind it is:


If Option 1 isn't blank, show me Options 1, 2 and 3.
Otherwise, if Option 2 isn't blank, show me Options 1, 2 and 3.
Otherwise, if Option 3 isn't blank, show me Options 1, 2 and 3.
Otherwise, show me "No options available".


Hope that helps! I can create a sample for you later if this isn't clear.
 
Joined
May 8, 2009
Messages
51
Actually, here you go. Didn't take me too long to put this together. Just change the data source for the Word file to the attached sample spreadsheet.

Cheers,
 

Attachments

Notelteirs

Thread Starter
Joined
Nov 25, 2010
Messages
2
Thank you so much Stacers!
This works perfectly. You have been an amazing help today!
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top