Solved

Mail merge IF Statements

Posted on 2016-11-10
8
25 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
  • 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 48

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
 

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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 48

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 48

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

If you work with Word a lot, you probably use styles. If you use styles a lot, you've probably balled your fist more often than not when working with the ribbon. In Word 2007/2010, one of the things that I find missing when using styles is a quic…
This is written from a 'VBA for MS Word' perspective, but I am sure it applies to most other MS Office components where VBA is used.  One thing that really bugs me is slow code, ESPECIALLY when it's mine!  In programming there are so many ways to…
This video walks the viewer through the process of creating a watermark for their document, customizing it, and saving it for viewing/printing needs.
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …

757 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now