Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-24-2020, 03:20 AM
dougdavis22 dougdavis22 is offline Conditional list of names from Excel sheet Windows 10 Conditional list of names from Excel sheet Office 2019
Novice
Conditional list of names from Excel sheet
 
Join Date: Feb 2020
Posts: 5
dougdavis22 is on a distinguished road
Question Conditional list of names from Excel sheet

Hi all. I have a spreadsheet which has a list of people's names and their associated location, for example:

First Name Last Name Location


Fred Bloggs London
Peter Parker London
Joe Bloggs Birmingham
John Smith Birmingham

What I want to do in Word is create a list of names for each location - so the end result would be:

London: Fred Bloggs, Peter Parker
Birmingham: Joe Bloggs, John Smith

Is there a way to do this please? Many thanks, Doug.
Reply With Quote
  #2  
Old 02-24-2020, 03:46 AM
macropod's Avatar
macropod macropod is offline Conditional list of names from Excel sheet Windows 7 64bit Conditional list of names from Excel sheet Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You can use Word's Catalogue/Directory Mailmerge facility for this (the terminology depends on the Word version). To see how to do so with any mailmerge data source supported by Word, check out my Microsoft Word Catalogue/Directory Mailmerge Tutorialin the 'Sticky' threat at the top of this forum:
Microsoft Word Catalogue/Directory Mailmerge Tutorial
The tutorial covers everything from list creation to the insertion & calculation of values in multi-record tables in letters. Do read the tutorial before trying to use the mailmerge document included with it.

Since the tutorial document includes working field codes for all of its examples, most of the hard work has already been done for you - you should be able to do little more than copy/paste the relevant field codes into your own mailmerge main document, substitute/insert your own field names and adjust the formatting to get the results you desire.

Another option would be to use a DATABASE field in a normal ‘letter’ mailmerge main document and a macro to drive the process. An outline of this approach can be found at: Many to one email merge using tables - Microsoft Community
Conversely, if you're using a relational database or, Excel workbook with a separate table with just a single instance of each of the grouping criteria, a DATABASE field in a normal ‘letter’ mailmerge main document could be used without the need for a macro. An outline of this approach can be found at:
Mail Merge - To a Word Table on a Single Page - Microsoft Community
For some working examples, see:
Mail Merge: Using One Excel File with Multiple Sheets
Merge excel list into Word Receipt
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 02-24-2020, 05:01 AM
dougdavis22 dougdavis22 is offline Conditional list of names from Excel sheet Windows 10 Conditional list of names from Excel sheet Office 2019
Novice
Conditional list of names from Excel sheet
 
Join Date: Feb 2020
Posts: 5
dougdavis22 is on a distinguished road
Default

Thanks for pointing me in the right sort of direction Paul. However, I'm not getting quite the result I want. At the moment, the output I'm getting is (using the example data above):

London
Fred Bloggs

London
Peter Parker

Birmingham
Joe Bloggs

Birmingham
John Smith

Why is the location being repeated for every entry? I just want a list of names after each location. Thanks.

This is what I have in the merge doc:

Pasteboard - Uploaded Image
Reply With Quote
  #4  
Old 02-24-2020, 05:27 AM
macropod's Avatar
macropod macropod is offline Conditional list of names from Excel sheet Windows 7 64bit Conditional list of names from Excel sheet Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Without wanting to place too fine a point on it, that field coding is not from my tutorial...

PS: When posting images, etc, kindly attach them to your post here, instead of on 3rd-party sites. You can do so via the paperclip symbol on the 'Go Advanced' tab at the bottom of this screen.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 02-24-2020, 06:44 AM
dougdavis22 dougdavis22 is offline Conditional list of names from Excel sheet Windows 10 Conditional list of names from Excel sheet Office 2019
Novice
Conditional list of names from Excel sheet
 
Join Date: Feb 2020
Posts: 5
dougdavis22 is on a distinguished road
Default

I tried the initial field coding in your tutorial and couldn't get that to work without erroring, so did a bit of Googling and found what I posted previously which got me further.

If I didn't need to try and sort this fairly quickly, I'd spend more time messing around trying to get the right field coding. But I'm really just looking for someone to be kind enough to show me the field coding required to achieve what I need to achieve please. If that's not possible, I'll seek help elsewhere.

Many thanks, Doug.
Reply With Quote
  #6  
Old 02-24-2020, 07:13 AM
dougdavis22 dougdavis22 is offline Conditional list of names from Excel sheet Windows 10 Conditional list of names from Excel sheet Office 2019
Novice
Conditional list of names from Excel sheet
 
Join Date: Feb 2020
Posts: 5
dougdavis22 is on a distinguished road
Default

OK, I've got further using the attached field codes - the only issue I have now is getting the names onto a single line rather than a list with each name on it's own line. Any help please?
Attached Images
File Type: jpg Capture.JPG (102.8 KB, 9 views)
Reply With Quote
  #7  
Old 02-24-2020, 07:34 AM
dougdavis22 dougdavis22 is offline Conditional list of names from Excel sheet Windows 10 Conditional list of names from Excel sheet Office 2019
Novice
Conditional list of names from Excel sheet
 
Join Date: Feb 2020
Posts: 5
dougdavis22 is on a distinguished road
Default

Sorted - Just had to move the trailing "} up onto the last line. Cheers.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional list of names from Excel sheet How do I import list of names from excel to print placecards? jrawls Word 2 08-17-2017 06:53 AM
Adding names to sheet for printing WV8VFD Excel 4 12-01-2013 11:02 PM
Conditional list of names from Excel sheet How to import a list of names into PowerPoint from Excel? CarpetRemnant PowerPoint 4 12-07-2012 11:08 AM
Conditional list of names from Excel sheet link conditional info in word based on excel list stijnvanhoof Mail Merge 1 11-13-2012 01:55 PM
Conditional list of names from Excel sheet create tree list in excel sheet chuikingman Excel 5 06-27-2011 09:38 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:11 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft