+ Reply to Thread
Results 1 to 4 of 4

Working with multiple, related text items

  1. #1
    Registered User
    Join Date
    11-21-2017
    Location
    Hong Kong
    MS-Off Ver
    2013
    Posts
    21

    Working with multiple, related text items

    What is the best way to lay out data with multiple related text fields so that they can be summarized/counted in a pivot table. Example would be a list of travel tours spanning multiple cities (Rome, Milan, Florence, etc.) where I would want a pivot table to count the total instances of each city across all tours.

    Can it be done with separate text entries in the same cell, or should they be spread across separate columns (e.g. City 1, City 2, City 3, in which case, how can the pivot table perform a count spanning multiple columns)? Many thanks!

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Working with multiple, related text items

    To pivot easily, you should normalize your data as far as possible - so each City should only ever appear in one column. Perhaps something like:

    "
    A B C
    1 Tour Name City Number City Name
    2 Italy 2016 1 Rome
    3 Italy 2016 2 Milan
    4 Italy 2016 3 Florence
    5 Italy 2017 1 Florence
    6 Italy 2017 2 Pisa
    7 Europe 2017 1 Rome
    8 Europe 2017 2 Berlin
    9 Europe 2017 3 Paris
    "
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    11-21-2017
    Location
    Hong Kong
    MS-Off Ver
    2013
    Posts
    21

    Re: Working with multiple, related text items

    Thank you. I'm having some trouble conceptualising the layout. Basically each tour has multiple fields with text variables and so many permutations of associated items across the raw data.
    E.g.
    Cities: Rome, Milan, Florence
    Hotels: Hyatt, Sheraton, Hilton
    Guide: Gary, Peter, Mary (more than one guide may be involved in a particular city on a tour)
    Last edited by winkywright; 11-21-2017 at 11:24 AM.

  4. #4
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Working with multiple, related text items

    A good principle though, is to normalize your data so that each field value only appears in one column. It sounds like you may need multiple tables, which you can then join and model, using power pivot. Perhaps something like:

    "
    Tour Name Start Date End Date
    Italy 2016 01/04/2016 14/04/2016
    Italy 2017 03/04/2017 17/04/2017
    Europe 2017 12/07/2017 04/08/2017
    "


    "
    Tour Name Guide
    Italy 2016 Franco
    Italy 2017 Marco
    Europe 2017 Franco
    Europe 2017 Maria
    "


    "
    Tour Name City Number City Name Hotel Name
    Italy 2016 1 Rome Hilton
    Italy 2016 2 Milan Hilton
    Italy 2016 3 Florence Sheraton
    Italy 2017 1 Florence Hyatt
    Italy 2017 2 Pisa Sheraton
    Europe 2017 1 Rome Hilton
    Europe 2017 2 Berlin Hyatt
    Europe 2017 3 Paris Marriott
    "



    Might be easier to advise if you show an example of what you're working with, and what your expected output looks like.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Excel 2010, trying to use CF related to 4 sheets, not working, will vba work?
    By thecdnmole in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-06-2014, 12:06 AM
  2. Replies: 9
    Last Post: 12-21-2013, 11:42 PM
  3. [SOLVED] Comparing dates of related items to determine if charge is necessary
    By spudzer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-22-2013, 04:00 PM
  4. Autofilter related items
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-23-2011, 09:43 AM
  5. reg. sorting of to items and their related fields
    By xpushkar in forum Excel General
    Replies: 7
    Last Post: 07-22-2011, 06:11 AM
  6. Looking up multiple text items
    By Jaap's Barber in forum Excel General
    Replies: 6
    Last Post: 02-07-2010, 11:26 AM
  7. Replies: 2
    Last Post: 10-24-2008, 08:36 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1