+ Reply to Thread
Results 1 to 3 of 3

Switching row labels and data from multiple columns around

  1. #1
    Registered User
    Join Date
    11-19-2020
    Location
    Helsinki, Finland
    MS-Off Ver
    MS 2016 for PC
    Posts
    1

    Switching row labels and data from multiple columns around

    It seems like there could be a relatively easy solution to this, but my knowledge of excel lingo is so poor that I'm having trouble googling relevant stuff.

    I have a table of courses (1,2,3) and teachers (a,b,c,d), which I'd like to dynamically flip (kinda transpose, but not quite) by teacher. A course can have multiple teachers (or none) and a teacher can teach multiple courses. If that's what it takes, I'll be happy to do VBA too.

    Any nudges toward the right direction?

    This is what I have:
    1 c
    2 b c d
    3 a

    This is what I'd like to see dynamically updating:
    a 3
    b 2
    c 1 2
    d 2
    Last edited by phountain; 11-19-2020 at 09:19 AM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,918

    Re: Switching row labels and data from multiple columns around

    With Power Query

    Please Login or Register  to view this content.
    Excel 2016 (Windows) 32 bit
    A
    B
    C
    1
    Value 1 2
    2
    a
    3
    3
    b
    2
    4
    c
    1
    2
    5
    d
    2
    Sheet: Sheet2

    Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

    It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

    - Follow this link to learn how to install Power Query in Excel 2010 / 2013.

    - Follow this link for an introduction to Power Query functionality.

    - Follow this link for a video which demonstrates how to use Power Query code provided.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,101

    Re: Switching row labels and data from multiple columns around

    ... or with a formula:

    in F3, copied down:
    =IFERROR(INDIRECT(TEXT(AGGREGATE(15,6,(ROW($B$3:$D$5)*100+COLUMN($B$3:$D$5))/(($B$3:$D$5<>"")*(COUNTIF($F$2:F2,$B$3:$D$5)=0)),1),"R0C00"),FALSE),"")

    and in G3, copied across and down:
    =IF($F3="","",IFERROR(INDEX($A:$A,MOD(AGGREGATE(15,6,(COLUMN($B$3:$D$3)*1000000)+ROW($B$3:$D$5)/($B$3:$D$5=$F3),COLUMNS($G3:G3)),1000)),""))

    see the sheet, as you may need ; as the separator.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

+ 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] Matrix Table - Consolidate Multiple Columns to One Column with row labels
    By Mundicide in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-15-2017, 12:40 PM
  2. [SOLVED] switching data to be columns
    By newbxceller in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 04-13-2015, 11:36 PM
  3. [SOLVED] Switching columns and rows in select data in chart
    By jh51745 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-04-2013, 06:44 AM
  4. [SOLVED] Switching columns and rows in select data in chart
    By jh51745 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 06-03-2013, 08:42 AM
  5. Replies: 9
    Last Post: 09-18-2012, 09:16 PM
  6. Multiple Columns into one Column for Labels
    By jimmihundreds in forum Excel General
    Replies: 5
    Last Post: 06-24-2010, 01:47 PM
  7. How do I add column A data labels to a scatter of columns B and C?
    By Christina1 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 03-26-2005, 11:06 PM

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