Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-22-2024, 03:00 PM
Ren1975 Ren1975 is offline Help! Multiple conditional statements in mail merge Windows 10 Help! Multiple conditional statements in mail merge Office 2010
Novice
Help! Multiple conditional statements in mail merge
 
Join Date: Mar 2024
Posts: 9
Ren1975 is on a distinguished road
Default Help! Multiple conditional statements in mail merge

Good morning,


I am seeking help with nested if statements in mail merge & am going around in circles trying to figure out.

I need to create a paragraph with the following conditions -

IF (Mergefield Cover Type) is E1 and (Mergefield Overseas) is not blank "Sentence for this cover"

Then the rest of the paragraph needs to return different values depending on one to three conditions at a time (I am attempting to nest it all together) -

IF (Mergefield Waits Apply) = Y "Sentence for waits apply"
or
IF (Mergefield Waits Apply) = Y and (Mergefield Previous Extras) = N "Sentence for previous extras"
or
IF (Mergefield Waits Apply) = Y and (Mergefield Previous Extras) = Y and (Mergefield Upgrade Extras) = Y "Sentence for upgrading waits"

They need to return a blank if they are not true

Any assistance from your logical minds would be greatly appreciated
Renee
Reply With Quote
  #2  
Old 09-22-2024, 06:29 PM
macropod's Avatar
macropod macropod is offline Help! Multiple conditional statements in mail merge Windows 10 Help! Multiple conditional statements in mail merge Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,383
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

From what you describe, your fields should be coded as:

Code:
{IF{MERGEFIELD Cover_Type}= "E1" {IF{MERGEFIELD Overseas}<> "" "Sentence for this cover"}}
and:
Code:
{IF{MERGEFIELD Waits_Apply}= "Y" {IF{MERGEFIELD Previous_Extras}= "Y" "Sentence for upgrading waits" "Sentence for previous extras"} "Sentence for waits apply"}
If your 'Previous Extras' data field can have content other than Y or N, use:
Code:
{IF{MERGEFIELD Waits_Apply}= "Y" {IF{MERGEFIELD Previous_Extras}= "Y" "Sentence for upgrading waits" {IF{MERGEFIELD Previous_Extras}= "N" "Sentence for previous extras" "Sentence for not Y/N"}} "Sentence for waits apply"}
You can omit the "Sentence for not Y/N" if there's not output for that condition.

Note: The field brace pairs (i.e. '{ }') for the above examples are all created in the document itself, via Ctrl-F9 (Cmd-F9 on a Mac or, if you’re using a laptop, you might need to use Ctrl-Fn-F9); 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.

For a macro to convert the above field code representations into working field codes, see Convert Text Representations of Fields to Working Fields in the Mailmerge Tips and Tricks 'Sticky' thread at the top of this page: https://www.msofficeforums.com/mail-...ps-tricks.html
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 09-27-2024, 10:52 AM
Charles Kenyon Charles Kenyon is offline Help! Multiple conditional statements in mail merge Windows 11 Help! Multiple conditional statements in mail merge Office 2021
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,474
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

The following may also assist:
I recommend downloading and saving Paul Edstein's Mailmerge Tips and Tricks. Read it. It will help with more than this problem.
Reply With Quote
  #4  
Old 09-29-2024, 11:24 PM
Ren1975 Ren1975 is offline Help! Multiple conditional statements in mail merge Windows 10 Help! Multiple conditional statements in mail merge Office 2010
Novice
Help! Multiple conditional statements in mail merge
 
Join Date: Mar 2024
Posts: 9
Ren1975 is on a distinguished road
Default

Thank you for your assistance Paul & Charles, all sorted now
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help! Multiple conditional statements in mail merge Mail Merge - Conditional Statements Utang Mail Merge 2 03-11-2024 03:35 AM
Help! Multiple conditional statements in mail merge Multiple Conditional formating within MS Mail Merge from Excel SCOATS Mail Merge 3 06-05-2019 06:55 PM
Help! Multiple conditional statements in mail merge IF Statements for a several ranges of values using Mail Merge Jennifert Mail Merge 2 05-01-2019 09:40 PM
I know nothing about mail merge, but need help with conditional statements briyosa Word 1 03-27-2017 10:17 PM
Help! Multiple conditional statements in mail merge Using multiple IF statements on a mail merge ajh19742000 Mail Merge 1 11-01-2016 06:11 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:37 AM.


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