Become a part of the TranceAddict community!Frequently Asked Questions - Please read this if you haven'tSearch the forums
TranceAddict Forums > Main Forums > Chill Out Room > Mail Merge geeks
  Last Thread   Next Thread
Share
Author
Thread    Post A Reply
DJ Mikey Mike
Your mum's face



Registered: Jan 2002
Location: I'm at your mums'
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.

Old Post Nov-12-2010 15:54 
Click Here to See the Profile for DJ Mikey Mike Click here to Send DJ Mikey Mike a Private Message Add DJ Mikey Mike to your buddy list Report this Post Reply w/Quote Edit/Delete Message
Nrg2Nfinit
ItaloDiscoAddict



Registered: Sep 2001
Location: Ottawa

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

Old Post Nov-12-2010 16:19 
Click Here to See the Profile for Nrg2Nfinit Click here to Send Nrg2Nfinit a Private Message Add Nrg2Nfinit to your buddy list Report this Post Reply w/Quote Edit/Delete Message
DJ Mikey Mike
Your mum's face



Registered: Jan 2002
Location: I'm at your mums'

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*

Old Post Nov-12-2010 16:21 
Click Here to See the Profile for DJ Mikey Mike Click here to Send DJ Mikey Mike a Private Message Add DJ Mikey Mike to your buddy list Report this Post Reply w/Quote Edit/Delete Message
Nrg2Nfinit
ItaloDiscoAddict



Registered: Sep 2001
Location: Ottawa

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

good luck

Old Post Nov-12-2010 16:23 
Click Here to See the Profile for Nrg2Nfinit Click here to Send Nrg2Nfinit a Private Message Add Nrg2Nfinit to your buddy list Report this Post Reply w/Quote Edit/Delete Message
EarnYourKeep
LIT



Registered: Dec 2001
Location: twentyonetwo

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


___________________
I PUT TRADEMARKS AROUND YO MOTHAFUCKIN EYE
JUST ME N YOU

Old Post Nov-12-2010 16:34 
Click Here to See the Profile for EarnYourKeep Click here to Send EarnYourKeep a Private Message Visit EarnYourKeep's homepage! Add EarnYourKeep to your buddy list Report this Post Reply w/Quote Edit/Delete Message
Nrg2Nfinit
ItaloDiscoAddict



Registered: Sep 2001
Location: Ottawa

you could have just quoted me smarty pants

Old Post Nov-12-2010 16:36 
Click Here to See the Profile for Nrg2Nfinit Click here to Send Nrg2Nfinit a Private Message Add Nrg2Nfinit to your buddy list Report this Post Reply w/Quote Edit/Delete Message
EarnYourKeep
LIT



Registered: Dec 2001
Location: twentyonetwo

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


___________________
I PUT TRADEMARKS AROUND YO MOTHAFUCKIN EYE
JUST ME N YOU

Old Post Nov-12-2010 16:49 
Click Here to See the Profile for EarnYourKeep Click here to Send EarnYourKeep a Private Message Visit EarnYourKeep's homepage! Add EarnYourKeep to your buddy list Report this Post Reply w/Quote Edit/Delete Message
SYSTEM-J
IDKFA.



Registered: Sep 2003
Location: Manchester

Just join a fucking IT forum, Mike.


___________________
Mixes:
> Maximum Elevation [Progressive House]
> DI.FM 26th Anniversary Guest Mix [Progressive House]
> Live @ Dance:Love:Hub London, 11.10.2025
> Higher Peaks [Progressive House]
> Dance:Love:Hub Afterparty (The Return) 23.11.24

Like these sets? Come see me play live at Kibosh in Manchester: https://www.instagram.com/kibosh.mcr/

Old Post Nov-12-2010 16:49  England
Click Here to See the Profile for SYSTEM-J Click here to Send SYSTEM-J a Private Message Visit SYSTEM-J's homepage! Add SYSTEM-J to your buddy list SYSTEM-J is online now Report this Post Reply w/Quote Edit/Delete Message

TranceAddict Forums > Main Forums > Chill Out Room > Mail Merge geeks
Post New Thread    Post A Reply

 
Last Thread   Next Thread
Click here to listen to the sample!Pause playbackProgressive tune needs ID [2003] [0]

Click here to listen to the sample!Pause playbackDepeche Mode - "Only When I Lose Myself" (Lexicon Avenue Remix) [2004]

Show Printable Version | Subscribe to this Thread
Forum Jump:

All times are GMT. The time now is 16:25.

Forum Rules:
You may not post new threads
You may not post replies
You may not edit your posts
HTML code is ON
vB code is ON
[IMG] code is ON
 
Search this Thread:

 
Contact Us - return to tranceaddict

Powered by: Trance Music & vBulletin Forums
Copyright ©2000-2026, Jelsoft Enterprises Ltd.
Privacy Statement / DMCA
Support TA!