TranceAddict Forums (www.tranceaddict.com/forums)
- Chill Out Room
-- Mail Merge geeks
Mail Merge geeks
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.
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 
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*
hrmm that would be my best guess since you are using excel anyways. It simplifies your word document.
good luck
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)))
you could have just quoted me smarty pants 
| quote: |
| Originally posted by Nrg2Nfinit you could have just quoted me smarty pants |

Just join a fucking IT forum, Mike.
Powered by: vBulletin
Copyright © 2000-2021, Jelsoft Enterprises Ltd.