+ Reply to Thread
Results 1 to 9 of 9

Transposing Data based on cell contents

  1. #1
    Registered User
    Join Date
    07-27-2017
    Location
    UK
    MS-Off Ver
    2012
    Posts
    43

    Transposing Data based on cell contents

    Hi, really need some help on trying to figure this out. I have some data in multiple rows of varying length and I need to transpose this data from rows into two single columns as shown in the attached. The right hand column will contain all unique names and the left column may be repeated.

    Many thanks

    Capture.JPG
    Attached Files Attached Files

  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: Transposing Data based on cell contents

    Which version of Excel are you using? Your profile says "2012", which doesn't exist...
    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
    07-27-2017
    Location
    UK
    MS-Off Ver
    2012
    Posts
    43

    Re: Transposing Data based on cell contents

    sorry my profile is out of date. Im using excel 2010.

  4. #4
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Transposing Data based on cell contents

    I am sure that there is a better way for my second formula, but you can use:
    In K4 and drag down. Array entered: Ctrl+Shift+Enter instead of regular Enter:
    Please Login or Register  to view this content.
    in J4 and drag down:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-27-2017
    Location
    UK
    MS-Off Ver
    2012
    Posts
    43

    Re: Transposing Data based on cell contents

    That's awesome, looks exactly what I wanted. Will play around with a bit it but many thanks!

  6. #6
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Transposing Data based on cell contents

    Glad to help. Please mak the thread Solved from Thread Tools.

  7. #7
    Registered User
    Join Date
    07-27-2017
    Location
    UK
    MS-Off Ver
    2012
    Posts
    43

    Re: Transposing Data based on cell contents

    sorry just one more thing, how would this work if the data is on another sheet please? Simply substituting in references doesn't seem to work?

  8. #8
    Registered User
    Join Date
    07-27-2017
    Location
    UK
    MS-Off Ver
    2012
    Posts
    43

    Re: Transposing Data based on cell contents

    Hello, Im just revisiting this and realised that if you have any duplicate names it doesn't capture them? See attached Test4.xlsx
    Attached Files Attached Files

  9. #9
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,723

    Re: Transposing Data based on cell contents

    I've used two helper columns in Sheet1, G and H. This formula in G4:

    =COUNTA(C4:F4)

    just counts the number of entries that you have for each ID, and this one in H4:

    =IF(G4="","",G4+H3)

    just gives a cumulative sum of those names. Notice that I've put zero in H3. Both formula can be copied down to the bottom of your table.

    Then in a separate sheet (After), with headings in row 1, I've used this formula in A2:

    =IF(ROWS($1:1)>MAX(Sheet1!H:H),"",INDEX(Sheet1!B:B,MATCH(ROWS($1:1)-1,Sheet1!H:H)+1))

    and this one in B2:

    =IF(A2="","",INDEX(Sheet1!C:F,MATCH(ROWS($1:1)-1,Sheet1!H:H)+1,ROWS($1:1)-INDEX(Sheet1!H:H,MATCH(ROWS($1:1)-1,Sheet1!H:H))))

    These can be copied down as far as you need to (I've copied to row 45 in the attached file).

    Hope this helps.

    Pete
    Attached Files Attached Files

+ 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. Data Validation based on Cell Contents
    By mowens74 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-12-2018, 05:27 AM
  2. Data Validation based on Cell Contents
    By mowens74 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-12-2018, 05:27 AM
  3. Transposing Columns to Row based on Cell Contents
    By Firestone in forum Excel General
    Replies: 2
    Last Post: 07-09-2015, 04:50 PM
  4. Replies: 3
    Last Post: 06-29-2015, 03:03 PM
  5. Replies: 3
    Last Post: 10-09-2014, 02:51 AM
  6. [SOLVED] Summing data based on several cell contents
    By JEB in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 06-05-2014, 07:33 AM
  7. Analyzing cell contents, inserting a number of rows, and transposing
    By james_black in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-15-2010, 11:28 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