Solved

Mail merge IF Statements

Posted on 2016-11-10
8
70 Views
Last Modified: 2016-11-11
hi i am trying to do an if statement in mail merge, heres what i am trying to do in non code terms

i have a field called unitprice if this field contains 0 i want to blank it out but if the field desc is not blank i dont want to blank it our i want to keep the 0

how would i do this?

p.s. hope this makes sense
0
Comment
Question by:Jade Laird
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 41882801
You seem to have some typos in your question. I guess that the last few words of your second paragraph: "our i want to keep the 0"  should read "out, I want to keep the field value."

If so, the fields should look like this:
{ If { MAILMERGE unitprice } = 0 "" { MAILMERGE unitprice } }
0
 

Author Comment

by:Jade Laird
ID: 41883410
Yeah sorry for the typos. im not sure that will work, wont i need to consider the field DESC

simpler way to put it i want to always blank out the field unitprice when equals 0 unless field desc is not blank.

wont i need nested if statements.

sorry new to this.
0
 
LVL 51

Expert Comment

by:Rgonzo1971
ID: 41883415
HI,

pls try

 { IF { = { IF {Mergefield desc  } = "" 1 0 } + { IF {Mergefield unitprice } = 0 1 0 } } =  2 ""  { MAILMERGE unitprice }  } 

Open in new window

Regards
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:Jade Laird
ID: 41883439
It doesnt seem to work.

example:

DESC     UNITPRICE
                  0
TSHIRT     0

So from the data above where desc is blank unit price needs to be blank, where desc is not blank unit price needs to keep the value
0
 
LVL 51

Expert Comment

by:Rgonzo1971
ID: 41883448
maybe try
 { IF { = { IF {Mergefield desc  } = "" 1 0 } + { IF {Mergefield unitprice } = "0" 1 0 } } =  2 ""  { MAILMERGE unitprice }  } 

Open in new window

0
 

Author Comment

by:Jade Laird
ID: 41883477
Think i may have solved this by doing


{IF{MERGEFIELD DESC} = "" "" {IF{MERGEFIELD DESC} <> "" {MERGEFIELD UNITPRICE}}}
0
 
LVL 51

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 41883480
pls try
{IF{MERGEFIELD DESC} = "" "" {MERGEFIELD UNITPRICE}} 

Open in new window

0
 

Author Closing Comment

by:Jade Laird
ID: 41883482
Thank you!
0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This tutorial provides instructions on how to properly format your Word document using the inbuilt tools provided. The benefits of using these tools means your documents are more accessible and easily portable to other applications an…
A few years ago I was very much a beginner at VBA, and that very much remains the case today.  I'll do my best to explain things as I go in the hope that other beginners can follow.  If you just want to check out a tool that creates a Select Case fu…
This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question