Hi,
this could be easily done with a macro. Without macro you could do it like this:
1) Store data for mail merge in an Excel Worksheet like
Code:
Column A B C D E
Header Name / Charge / More-Than-One / String / Print
You need the last three columns to accomplish this task. The formulae will have to be
- More-Than-One: is TRUE if name in this row matches name in row above
- String: if there are more than one charge to one name (C2 is TRUE) it concatenates string of row above (D1) with charge of this row (B2), else it shows only charge of this row (B2)
Code:
String: =If(C2;D1&", "&B2;B2)
- Print: is TRUE only in the last row of a name with several charges and in a row with a name with one charge)
Code:
Print: =Or(And(C2;Not(C3));And(Not(C2);Not(C3)))
2) Sort the data table, first criterium: Name. Otherwise the formulae won't work!
3) Now you can do your mail merge in Word if you print only the data sets where the value in the Print-Column is TRUE.
I have tested this in Office97 and it works fine.
Enjoy,
Markus.
Note: please play around with the Excel functions as I do not have an English version of MS Office and had to translate them from my native German. Please excuse also if my English is a bit clumsy. I tried to avoid the translation of "Abfrageoptionen".