• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Microsoft Excel Tips and Tricks - Computergaga

  • Home
  • Excel Online Courses
  • Excel Functions List
  • Free Downloads
  • Blog
  • Tutorials
  • About
Home / Office / Mail Merge Rule with Multiple Conditions

Mail Merge Rule with Multiple Conditions

Mail Merge can handle conditional rules such as If… Then… Else… to display different text depending on the information in the data source record.

Normally these rules are quite simple tasks such as; if the member joined within the last month, or if they have a family membership.

Sometimes though you may need to use multiple conditions. For example, you may want to check if a member of a club had a Gold, Silver or Bronze membership. The new price of their membership depends on what membership they have.

Begin by inserting a basic If… Then… Else… rule. This gives you a head start with typing the rules by inserting the structure of the condition. It’s easier to expand on this rule, than write one from nothing.

  1. Click on the Rules button in the Write & Insert Fields group of the Mailings tab
Mail Merge rules
  1. Select If… Then… Else… from the list
  2. Build the condition by selecting the Field name and  Comparison operator from the lists and then typing the value you want to check against in the Compare to box
  3. Type the text you want to show if the condition is true in the Insert this text box
Creating an If... Then... Else... Mail Merge rule
  1. Click Ok

The text will show in the document if it matches the condition for the first record from the data source.

To expand on this criteria we need to see the field code. Press Alt + F9 to view the field code. The code will look like below;

{ IF { MERGEFIELD Membership } = “Gold” “66” “” }

To use multiple conditions, you can add more If’s to the code. The example below shows the different amounts being displayed for the different types of membership.

{ IF { MERGEFIELD Membership } = “Gold” “66” { IF { MERGEFIELD Membership } = “Silver” “55” { IF { MERGEFIELD Membership } = “Bronze” “46” } } }

Pressing Alt + F9 at any point will switch between showing the field codes or not.

Related Posts:

  • Import Multiple Excel Files with Multiple Sheets in Excel
    Import Multiple Excel Files with Multiple Sheets in Excel
  • Multiple Condition Lookup Formula in Excel
    Multiple Condition Lookup Formula in Excel
  • Lookup Multiple Values in Excel
    Lookup Multiple Values in Excel

Reader Interactions

Comments

  1. ted hartwell says

    5 February 2013 at 1:29 pm

    this is all well and good but what about the other rules.
    Several sites I visited only explain the if then statement.
    What do the other rules do and how do I properly use them. That was what i was really looking for.

    Reply
  2. Kishor says

    22 August 2013 at 6:41 am

    How to insert another merged field in IF..Then..Else, Please guide.

    Reply
    • computergaga_blog says

      23 August 2013 at 9:02 pm

      Hi Kishor,
      Check out this link for inserting merge fields into an If Then Else statement.

      Reply
      • Emma K says

        27 January 2018 at 2:38 pm

        Link not working 🙁

        Reply
        • computergaga says

          4 February 2018 at 6:44 am

          Thanks Emma. Yes, that link in the comments area was to a page on the office.microsoft website. It is no longer available. Thanks for letting me know.

          Reply
  3. James says

    13 July 2020 at 8:59 pm

    How do I add say two combined conditions? IF A and B then C, otherwise blank?

    Reply
    • Alan Murray says

      23 July 2020 at 7:50 pm

      I’m not sure if doing more complicated conditions is possible James. It could be something that can e done in the VBA side.
      But this is going beyond the requirements of Word, and can probably be added as a column the the data source that you merge with. The Excel spreadsheet or database query. Better to to add the column there than in Word.

      Reply
    • Michael Bracken says

      20 November 2020 at 3:47 pm

      { IF { MERGEFIELD First-Item } = “A” “{ IF { MERGEFIELD Second-Item } = “B” “C” “” }” “”}

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Popular Posts

  • Excel Fixtures and League Table Generator
  • Excel IF Function Contains Text – A Partial Match in a Cell
  • 5 Reasons Why your Excel Formula is Not Calculating
  • Excel Formula to Display the Sheet Name in a Cell
  • 4 Alternatives to Nested IF Formulas
  • How to Create a Reverse FIND Formula
  • Check if a Value is an Even Number
  • How to Hyperlink to a Hidden Worksheet in Excel
  • IF Function in Power Query Including Nested IFS
  • Conditional Formatting Multiple Columns – 3 Examples

Recent Posts

  • SEQUENCE Function in Excel
  • Sort by Drop Down List in Excel
  • Advanced SUM Function Examples – The Power of SUM
  • Display Negative Time in Excel
  • Lookup Multiple Values in Excel
Advanced Excel Success book

Footer

Contact

[email protected]

Useful Links

  • Home
  • Excel Online Courses
  • Tutorials
  • Sitemap
  • Privacy Policy
  • Jobs by Jooble

Course Topics

  • Charts
  • Courses
  • Dashboards
  • Downloads
  • Excel Tips
  • Formulas
  • Mail Merge
  • Office
  • PivotTables
  • Power BI
  • Power Pivot
  • Power Query
  • VBA

Join Our Mailing List

© Copyright 2020 Computergaga · All Rights Reserved ·