Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
 
Posts: n/a
Default Using IF with MERGEFIELD

Hi there

I'm having problems trying to do the following:

I have 4 fields, each with a 0 or 1, I want to be able to add these
fields together and base the output on if the total is = 3.

First I started with adding them together:

{ «MG_Q1»+«MG_Q2»+«MG_Q3»+«MG_Q4» }

output: 0+1+1+1

I them made this in to a SUM:

{ =«MG_Q1»+«MG_Q2»+«MG_Q3»+«MG_Q4» }

output: 3

So far so good This gives me the sum of the four fields fine.

Now I need to have an output of YES or NO, depending on if the total
=3, so I put this (based on examples I've seen online):


{ IF{ =«MG_Q1»+«MG_Q2»+«MG_Q3»+«MG_Q4» } } =3 "YES" "NO" }

Using this, I don't get any output at all

I've checked the data source and the fields are non-formatted etc, and
obviously add up OK (as with the second step) but seems I have the IF
clause incorrect.

Any help would be very greatly appreciated.... I'm starting to get
bumps on my head from banging it on the desk!

Many thanks

Stoo

  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
 
Posts: n/a
Default Using IF with MERGEFIELD

Assuming that you used Ctrl + F9 to insert each pair of field delimiters and
that the superfluous } in

{ IF{ =«MG_Q1»+«MG_Q2»+«MG_Q3»+«MG_Q4» } } =3 "YES" "NO" }

is just a typing error in composing your post, all you may need to do is
update the fields in the document.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

wrote in message
oups.com...
Hi there

I'm having problems trying to do the following:

I have 4 fields, each with a 0 or 1, I want to be able to add these
fields together and base the output on if the total is = 3.

First I started with adding them together:

{ «MG_Q1»+«MG_Q2»+«MG_Q3»+«MG_Q4» }

output: 0+1+1+1

I them made this in to a SUM:

{ =«MG_Q1»+«MG_Q2»+«MG_Q3»+«MG_Q4» }

output: 3

So far so good This gives me the sum of the four fields fine.

Now I need to have an output of YES or NO, depending on if the total
=3, so I put this (based on examples I've seen online):


{ IF{ =«MG_Q1»+«MG_Q2»+«MG_Q3»+«MG_Q4» } } =3 "YES" "NO" }

Using this, I don't get any output at all

I've checked the data source and the fields are non-formatted etc, and
obviously add up OK (as with the second step) but seems I have the IF
clause incorrect.

Any help would be very greatly appreciated.... I'm starting to get
bumps on my head from banging it on the desk!

Many thanks

Stoo


  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
 
Posts: n/a
Default Using IF with MERGEFIELD

Many thanks for a speedy reply Doug....

It's sorted thanks It was because I hadn't entered the delimiters
using ctrl+f9 and had typed them in myself... silly huh

Again, thanks...

Stoo


Doug Robbins - Word MVP wrote:
Assuming that you used Ctrl + F9 to insert each pair of field delimiters and
that the superfluous } in

{ IF{ =«MG_Q1»+«MG_Q2»+«MG_Q3»+«MG_Q4» } } =3 "YES" "NO" }

is just a typing error in composing your post, all you may need to do is
update the fields in the document.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

wrote in message
oups.com...
Hi there

I'm having problems trying to do the following:

I have 4 fields, each with a 0 or 1, I want to be able to add these
fields together and base the output on if the total is = 3.

First I started with adding them together:

{ «MG_Q1»+«MG_Q2»+«MG_Q3»+«MG_Q4» }

output: 0+1+1+1

I them made this in to a SUM:

{ =«MG_Q1»+«MG_Q2»+«MG_Q3»+«MG_Q4» }

output: 3

So far so good This gives me the sum of the four fields fine.

Now I need to have an output of YES or NO, depending on if the total
=3, so I put this (based on examples I've seen online):


{ IF{ =«MG_Q1»+«MG_Q2»+«MG_Q3»+«MG_Q4» } } =3 "YES" "NO" }

Using this, I don't get any output at all

I've checked the data source and the fields are non-formatted etc, and
obviously add up OK (as with the second step) but seems I have the IF
clause incorrect.

Any help would be very greatly appreciated.... I'm starting to get
bumps on my head from banging it on the desk!

Many thanks

Stoo


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add a condition in an includepicture with mergefield tinous Mailmerge 14 October 21st 06 09:33 AM
mail merge with 2 different last names to the same address mail merge 2 different last names Mailmerge 1 April 6th 06 07:34 AM
mail merge - different last names? Robb Microsoft Word Help 1 January 24th 06 06:14 AM
How do I do a conditional mail merge into a table tomtraff Mailmerge 5 March 29th 05 05:29 PM
Math In Merge Field(s) Kenny G Mailmerge 3 March 7th 05 06:57 PM


All times are GMT +1. The time now is 08:00 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"