|
Mail Merge geeks
|
View this Thread in Original format
| DJ Mikey Mike |
Anyone got any experience with IF statements in mail merges?
I have an excel spreadsheet, with for arguments sake:
Field 1 = First_Name
Field 2 = Surname
Field 3 = Company
In my mail merge, I want to be able to say 'Dear First Name + Surname'
However, if the first name and surname fields are blank, I want it to say 'Dear Company' instead.
My understanding of this would be to use code like this:
Dear {IF {MERGEFIELD "First_Name"} {MERGEFIELD "Surname"} = "" {MERGEFIELD "Company"} ELSE {MERGEFIELD "First_Name" {MERGEFIELD "Surname"}}
But it's not working properly. The above displays "Dear Surname" if the name fields aren't blank, and just "Dear = " if the name fields are blank.
Could anyone tell me where I've gone wrong with my code? I've never been good with IF / Else statements in general, not just in Word.
Cheers. |
|
|
| Nrg2Nfinit |
perhaps it may be simpler to use basic concatenation with an if statement.
use this
=IF(B3&C3="",D3,B3&" "&C3)
where b3 and c3 are first and last names and d3 is the company name
drag and apply downwards
belland :p |
|
|
| DJ Mikey Mike |
So do the donkey work in the Excel spreadsheet first?
I could do I guess, but I'd still be curious to know how to get IF statements to work in Word.
Bellend* |
|
|
| Nrg2Nfinit |
hrmm that would be my best guess since you are using excel anyways. It simplifies your word document.
good luck |
|
|
| get nyce |
I'd do the work in excel first then move it into mail merge based on the cell.
If(IsBlank(Field1),Field3,(CONCATENATE(Field1," ",Field2))) |
|
|
| Nrg2Nfinit |
| you could have just quoted me smarty pants :p |
|
|
| get nyce |
| quote: | Originally posted by Nrg2Nfinit
you could have just quoted me smarty pants :p |
i wanted to demonstrate my elite excel skills, don't you dare start with pivot tables or conditional formatting ;)
btw snr business analyst |
|
|
| SYSTEM-J |
| Just join a ing IT forum, Mike. |
|
|
|
|