Multiple IF comparisons in Word mail merge

I am trying to write an IF statement in a Word mail merge. I need to compare multiple "true" statements on a single field, with one response if any of those statements is true and a different response if all are false. I have tried several nested IF statements and I get the correct deposit amount for the international trips, but nothing for the domestic ones...

Here's what I need. I'm creating confirmation letters for trip reservations. If the trip is international the deposit fee is higher. Unfortunately our horrible database doesn't have a field to designate something as "domestic" or "international", so I'm trying to say: 

 IF the location is Belize, OR Jamaica, OR Nicaragua, OR Yucatan, then the deposit is "this amount." IF the location is NONE of these, then the deposit is "that amount."

Can anyone help?? Thanks in advance!
Answer
Answer

Using Ctrl+F9 to insert each pair of field delimiters { } use

 

{ IF { MERGEFIELD Location } = "Belize" "IntDeposit" { IF { MERGEFIELD Location } = "Jamaica" "IntDeposit" { IF { MERGEFIELD Location } = "Nicaragua" "IntDeposit" { IF { MERGEFIELD Location } = "Yucatan"  "IntDeposit" "DomDeposit" } } } }

 

Replace IntDeposit with the amount for the International Deposit and DomDeposit with the amount for the Domestic Deposit.

 

Use Alt+F9 to toggle off the display of the formfields.

Hope this helps,
Doug Robbins - MVP Office Apps & Services (Word)
dougrobbinsmvp@gmail.com
It's time to replace ‘Diversity, Equity & Inclusion’ with ‘Excellence, Opportunity & Civility’ - V Ramaswamy

21 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated September 3, 2024 Views 13,872 Applies to: