How to do an if statement

S

Serendipity

Using Word 2003. Data in Excel 2003 spreadsheet. Performing mailmerge in
Word. How do I make an if statement that will get the value from any one of
the fields below regardless of whether the other ones are empty or not? I
have a directory which includes who the children in the family are--all
listed on one line--separated by commas--below the name and address
information. I have looked at the KB articles but their examples have only
two fields, and I am not experienced enough to apply their examples to a more
complex senario.

These are the fields in Excel.

«Child_One» «Child_Two_» «Child_Three» «Child_Four»

Thanks for your help.
 
D

Doug Robbins - Word MVP

The easiest thing for you to do would be to add another column to your Excel
spreadsheet in which you concatenate the contents of the Child_One,
Child_Two, Child_Three and Child_Four fields for each record and then just
use that one field in your mailmerge.

--
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
 
S

Serendipity

Thought this worked and then I noticed that if a Child field is blank, I get
commas. How can I separate the names with commas in my statement but not get
them in the result if that field is blank. This is the statement I used.

=CONCATENATE(M2,", ",N2,", ",O2,", ",P2)

Thanks!
 
D

Doug Robbins - Word MVP

Use

=M2&IF(N2<>"", ", "&N2,"")&IF(O2<>"",", "&O2,"")&IF(P2<>"",", "&P2,"")

--
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top