Tom
Tom

Reputation: 215

If statement within a mailmerge

I`m trying to create a mail merge for attendence certificates that brings in an attendence value from an excell spreadasheet.

The attendence column in the spreasheet will hold either a two digit numerical value or blank.

I would like it to display the attendence percentage if there is a value, else display nothing.

The logic in the mailmerge is {If { MERGEFIELD Attendance} = "[0-9]*", "{MERGEFIELD Attendance}", ""}

Could anyone tell me where I am going wrong?

Upvotes: 0

Views: 1829

Answers (1)

user1379931
user1379931

Reputation:

Assuming Attendance holds the percentage (e.g. is 03 for 3%), use { IF "{ MERGEFIELD Attendance}" = "??" "{ ={ MERGEFIELD Attendance } }%" }. You can get rid of some of the quotes and spacing in there if you prefer, but AFAICR you need at least one of the spaces around the "=".

i.e. you can't use regex wildcards (not even the Word version of regex wildcards). The only wildcards allowed here AFAIK are "?" and "*", and you can only use "*" at one end of the expression.

Upvotes: 0

Related Questions