+ Reply to Thread
Results 1 to 5 of 5

Moving data from columns to rows based on cell value

  1. #1
    Registered User
    Join Date
    07-23-2019
    Location
    England
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2

    Moving data from columns to rows based on cell value

    Hello all,

    I've just registered as I'm really stumped with this issue. I have a set of data which lists every interaction we've had with our clients, with a separate row for each type of interaction (meeting, email etc.). I've been asked to extract the following data:
    • clients we have met in person
    • clients we have (only) had email interaction with e.g. haven't met in person
    • clients we have on record that we haven't met or emailed

    The last item in the list is where we may have been made aware of a client and made some notes/had a meeting about them, but haven't interacted with them directly.

    I'm really struggling to go from the raw data to getting the data from the list above.

    I thought perhaps if I could get all the 'interaction types' into the same row then I could use some sort of filter or IF function to separate it out? But if anyone has any better ideas then I'd be very grateful! The problem I'm having with doing that would be getting the 'interaction type' data to match the client it's related to, if that makes sense?

    I've attached some example data and a (potential) desired outcome on a separate sheet within the Excel book.

    Thanks in advance!
    Attached Files Attached Files
    Last edited by CaptainPanic; 07-24-2019 at 03:36 AM.

  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: Moving data from columns to rows based on cell value

    I'd suggest you format your source data as a table, then use Power Query (Get & Transform Data) to reshape it a bit:

    Please Login or Register  to view this content.
    Now you can filter clients based on the number of interactions, by type...

    Moving forward, you could add logic to define contact categories, based on counts by type (e.g. No physical contact = clients where Meetings = 0 and Staff Meetings = 0, for example)
    Attached Files Attached Files
    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
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Moving data from columns to rows based on cell value

    Hello and welcome to the forum.

    I would use Power Query for this.

    1) Highlight A1:C18 > Data > From Table > OK
    2) Group By > Advanced > Client and Client ID > New column name: Temp > Operation: All Rows > OK
    3) Add Column > Custom Column > =Table.Column([Temp],"Interaction type") > OK
    4) Click on the box to the right of the Custom header > Extract Values > Colon > OK
    5) Delete the Temp column
    6) Change the name of the Custom column to Interaction (right click on header > Rename)
    7) Select the Interaction column > Transform > Split Column > By Delimiter > Colon > Each occurrence > OK
    7) Home > Close & Load

    See attachment
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    07-23-2019
    Location
    England
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2

    Re: Moving data from columns to rows based on cell value

    Thanks so much to both of you - this is really helpful!

    I didn't even know about Power Query, but it looks like I'll be able to do lots of things with the data set now. Thanks again!

  5. #5
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Moving data from columns to rows based on cell value

    Glad we could help. Thanks for the rep!

+ 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] Moving data from rows to columns based on data
    By xan175 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-03-2018, 02:49 PM
  2. [SOLVED] Moving multiple columns (8 x sets of 3) with data in separate rows into 3 columns
    By Emmax in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 03-03-2016, 01:23 PM
  3. Moving rows to columns based on information in a specific column
    By adamdpayne in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-02-2014, 10:49 AM
  4. [SOLVED] Moving data from Rows to columns and delete repeated rows
    By mikearmanios in forum Excel General
    Replies: 5
    Last Post: 04-20-2014, 06:25 AM
  5. Auto-Converting Cell Value to link & moving rows of data based on cell value
    By Th3Forgotten in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-15-2013, 08:05 AM
  6. Moving cell data from columns to rows in massive file
    By aaroninbna in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 02-22-2012, 09:22 AM
  7. Moving rows of data based on a YES cell entry
    By Karrie in forum Excel General
    Replies: 3
    Last Post: 01-19-2005, 10:34 AM

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