TranceAddict Forums

TranceAddict Forums (www.tranceaddict.com/forums)
- Chill Out Room
-- Mail Merge geeks


Posted by DJ Mikey Mike on Nov-12-2010 15:54:

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.


Posted by Nrg2Nfinit on Nov-12-2010 16:19:

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


Posted by DJ Mikey Mike on Nov-12-2010 16:21:

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*


Posted by Nrg2Nfinit on Nov-12-2010 16:23:

hrmm that would be my best guess since you are using excel anyways. It simplifies your word document.

good luck


Posted by EarnYourKeep on Nov-12-2010 16:34:

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


Posted by Nrg2Nfinit on Nov-12-2010 16:36:

you could have just quoted me smarty pants


Posted by EarnYourKeep on Nov-12-2010 16:49:

quote:
Originally posted by Nrg2Nfinit
you could have just quoted me smarty pants


i wanted to demonstrate my elite excel skills, don't you dare start with pivot tables or conditional formatting

btw snr business analyst


Posted by SYSTEM-J on Nov-12-2010 16:49:

Just join a fucking IT forum, Mike.



Powered by: vBulletin
Copyright © 2000-2021, Jelsoft Enterprises Ltd.