Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-13-2017, 10:16 PM
jriker1 jriker1 is offline if true AND nested or? Windows 10 if true AND nested or? Office 2016
Novice
if true AND nested or?
 
Join Date: Oct 2017
Posts: 3
jriker1 is on a distinguished road
Default if true AND nested or?


Trying to do a mail merge and can't figure this one out. Basically is:

If card = "Yes" AND (Donate = "Yes" or Amount <> "" or merit = "Yes") print "whatever I'm going to print".

So card needs to be yes for starters, and then if any of the conditions in the brackets are true then print otherwise do nothing. How would I do this?

Thanks.

JR
Reply With Quote
  #2  
Old 10-13-2017, 11:24 PM
macropod's Avatar
macropod macropod is offline if true AND nested or? Windows 7 64bit if true AND nested or? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You could use a field coded as:
{IF{={IF{MERGEFIELD Card}= "Yes" 1 0}*(({IF{MERGEFIELD Donate}= "Yes" 1 0}+{IF{MERGEFIELD Merit}= "Yes" 1 0}+{IF{MERGEFIELD Amount \# 0}= 0 0 1})>0)}= 1 "True Text" "False Text"}

Note: The field brace pairs (i.e. '{ }') for the above example are all created in the document itself, via Ctrl-F9 (Cmd-F9 on a Mac); you can't simply type them or copy & paste them from this message. Nor is it practical to add them via any of the standard Word dialogues. The spaces represented in the field constructions are all required.

There is a macro for turning the above into a working field code in the Mailmerge Tips & Tricks 'Sticky' thread at the top of this forum: https://www.msofficeforums.com/mail-...ps-tricks.html
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 10-13-2017, 11:44 PM
macropod's Avatar
macropod macropod is offline if true AND nested or? Windows 7 64bit if true AND nested or? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Cross-posted at: https://answers.microsoft.com/en-us/...5-c6f8276485dc
For cross-posting etiquette, please read: http://www.excelguru.ca/content.php?184
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #4  
Old 10-14-2017, 07:34 AM
jriker1 jriker1 is offline if true AND nested or? Windows 10 if true AND nested or? Office 2016
Novice
if true AND nested or?
 
Join Date: Oct 2017
Posts: 3
jriker1 is on a distinguished road
Default

Thanks macropod. I'll give it a try. Noticed there is an extra end/right squiggly bracket vs the start/left brackets. Have to figure where that is.

Thanks.

JR
Reply With Quote
  #5  
Old 10-14-2017, 08:26 AM
jriker1 jriker1 is offline if true AND nested or? Windows 10 if true AND nested or? Office 2016
Novice
if true AND nested or?
 
Join Date: Oct 2017
Posts: 3
jriker1 is on a distinguished road
Default

Also I'm using ctrl-F9 for all the {} however this passes and this gives an Unknown op code when testing:

Pass:
{IF{IF{MERGEFIELD Card}="Yes" 1 0} = 1 "HI"}

OP Error:
{IF{IF{MERGEFIELD Card}="Yes" 1 0}+{IF{MERGEFIELD Card}="Yes" 1 0} = 1 "HI"}

JR
Reply With Quote
  #6  
Old 10-14-2017, 01:11 PM
macropod's Avatar
macropod macropod is offline if true AND nested or? Windows 7 64bit if true AND nested or? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by jriker1 View Post
Noticed there is an extra end/right squiggly bracket vs the start/left brackets.
No, there isn't - they're exactly balanced.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
if true AND nested or? Converting a 1 or 0 into TRUE or FALSE? ayupchap Mail Merge 1 04-25-2017 02:45 PM
True 4:3 background dimensions a_gunslinger PowerPoint 1 11-28-2016 08:22 PM
if true AND nested or? Search for character border = true ? n00bie-n00b Word VBA 6 10-08-2014 11:54 PM
if true AND nested or? True Title Case for First Row of All Tables Marrick13 Word VBA 14 12-11-2013 09:12 PM
if true AND nested or? Macro not staying true oluc Word VBA 4 11-21-2010 08:10 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:29 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft