+ Reply to Thread
Results 1 to 4 of 4

IF Then Merge Field

  1. #1
    Registered User
    Join Date
    04-01-2019
    Location
    Manitowoc, Wisconsin, USA
    MS-Off Ver
    365
    Posts
    23

    IF Then Merge Field

    I have a Merge Field "Disposition". The results can be "Prime" or "Outlet".

    If the result is "Prime" I do not want to the Merge Field "Special Price" results to display anything.

    If the result is "Outlet" I want the Merge Field "Special Price" results to be displayed.


    I have not been successful with the attempts I have made.

    I am using Word and Excel 365 and Windows 10 from my laptop.


    Thank you


    Steven

  2. #2
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: IF Then Merge Field

    Use an IF test coded like:
    {IF{MERGEFIELD Disposition}= "Outlet" {MERGEFIELD Special_Price}}
    or:
    {IF«Disposition»= "Outlet" «Special_Price»}

    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 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. Likewise, the chevrons (i.e. '« »') are part of the actual mergefields - which you can insert from the 'Insert Merge Field' dropdown (i.e. you can't type or copy & paste them from this message, either). The spaces represented in the field constructions are all required.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    Registered User
    Join Date
    04-01-2019
    Location
    Manitowoc, Wisconsin, USA
    MS-Off Ver
    365
    Posts
    23

    Re: IF Then Merge Field

    Thank you Paul.

    I will test but first it is time for a cigar.

    Once again you have pulled me from the fire.


    Steven
    Last edited by sstreub; 04-24-2019 at 08:24 PM. Reason: Other

  4. #4
    Registered User
    Join Date
    04-01-2019
    Location
    Manitowoc, Wisconsin, USA
    MS-Off Ver
    365
    Posts
    23

    Re: IF Then Merge Field

    I had to use trial and error as how to write and where I needed to place the code to obtain the results I needed.


    Executes perfectly!


    Thank you Paul


    Steven

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Split merge doc and save in any of the merge field data
    By bmbalamurali in forum Word Formatting & General
    Replies: 5
    Last Post: 03-23-2018, 09:18 PM
  2. [SOLVED] PowerPivot: Merge Month Field and Year Field Into a Date Field
    By mo4391 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 07-17-2015, 11:59 AM
  3. Invalid merge field message although I am using right field names in word document
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-17-2015, 07:59 AM
  4. Can we use OR formula with IF in the merge field....
    By adil.master in forum Word Formatting & General
    Replies: 4
    Last Post: 09-30-2013, 04:19 PM
  5. Using Merge Field in file name?
    By The Boosh! in forum Word Programming / VBA / Macros
    Replies: 5
    Last Post: 04-15-2011, 08:28 AM
  6. joing (merge) tables by key field
    By Alex Kachanov in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 11:05 AM
  7. [SOLVED] Merge an alpha field and a numeric field
    By grams in forum Excel General
    Replies: 3
    Last Post: 08-29-2005, 07:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1