+ Reply to Thread
Results 1 to 12 of 12

transpose X matching headers X duplicate tables (multiple problems)

  1. #1
    Registered User
    Join Date
    02-11-2019
    Location
    toronto, canada
    MS-Off Ver
    2013
    Posts
    64

    transpose X matching headers X duplicate tables (multiple problems)

    Hi Guys,

    For below PLEASE no macro's! I'm not allowed to use them at work

    I got a very, very tricky (for me at least) problem.

    I wrote it very detailed but its rly not complicated and from the excel its extremely easy to see what the problem/solution is!

    There are 3 things I need to do:

    1. Transpose 10+ columns
    2. Take headers or 10+ columns and put beside values in #1
    3. Copy down all rows/columns before #1 and #2

    Essentially 18 columns will become 10.

    The first tab of the attached is called "original" which is the problem.

    Please note:

    1. Yellow highlights will go in the same column (please disregard the header "values" I was just was showing where it goes)
    2. Orange highlights will go in the same column(please disregard the header "attributes" I was just was showing where it goes)
    3. Green highlights will just duplicate is direct relation with #1 and #2
    4. Headers not highlighted and bolded do not move (with the inclusion of "values" and "attributes")

    The second tab labelled "solution" shows this.

    I was going to use =INDEX($B$8:$D$12,1+INT((ROW(A6)-1)/COLUMNS($B$8:$D$12)),MOD(ROW(A6)-1+COLUMNS($B$8:$D$12),COLUMNS($B$8:$D$12))+1) BUT that only takes care of the yellow and even if i copy the orange beside and do the formula twice is doesn't affect the green.

    Plus the data attached is small, the real data is 1000's of lines so the above would still take an hour or hours!

    Thank you!!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365 for MAC
    Posts
    3,105

    Re: transpose X matching headers X duplicate tables (multiple problems)

    Hi
    please check these:

    A2 - H49:
    =INDEX('Original Data'!A$2:A$7,ROUNDUP(MOD(ROW()-2+0.1,COUNTA('Original Data'!A$2:A$7)),0))

    I2 ='Original Data'!K1
    I3 and down: =IF(COUNTIF($I$2:I2,I2) < COUNTA('Original Data'!$K$2:$K$7),Solution!I2,INDEX('Original Data'!$K$1:$R$1,,MATCH(Solution!I2,'Original Data'!$K$1:$R$1,0)+1))

    J2 and down: =INDEX('Original Data'!$K$2:$R$7,ROUNDUP(MOD(ROW()-2+0.1,COUNTA('Original Data'!$K$2:$K$7)),0),ROUNDUP(MOD((ROW()-1.1)/COUNTA('Original Data'!$K$2:$K$7),COUNTA('Original Data'!$K$1:$R$1)),0))
    Attached Files Attached Files
    Last edited by Limor_OP; 01-02-2021 at 06:59 PM.

  3. #3
    Forum Expert
    Join Date
    06-05-2017
    Location
    Brazil
    MS-Off Ver
    Microsoft 365 Version 2404
    Posts
    1,259

    Re: transpose X matching headers X duplicate tables (multiple problems)

    Try in I2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    And in J2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Copy down.

    Happy New Year!

  4. #4
    Registered User
    Join Date
    02-11-2019
    Location
    toronto, canada
    MS-Off Ver
    2013
    Posts
    64

    Re: transpose X matching headers X duplicate tables (multiple problems)

    NO WAY!

    you are AMAZING!

    Two Questions:

    1. why is I2 "='Original Data'!K1" and the rest countif's?
    2. V7 and V8 are getting their values from V1 & V2 from original data. Not sure why but it seems after V6 the data starts getting the values from the beg?

    this is insane how good it is.

    I just posted another problem on the thread if you want to take a look :D

  5. #5
    Registered User
    Join Date
    02-11-2019
    Location
    toronto, canada
    MS-Off Ver
    2013
    Posts
    64

    Re: transpose X matching headers X duplicate tables (multiple problems)

    Also is there a way I can click something and it does it AUTO, since if there are 50 rows and 20 columns it might be hard to drag down 50*20 times perfectly, just as an example

  6. #6
    Registered User
    Join Date
    02-11-2019
    Location
    toronto, canada
    MS-Off Ver
    2013
    Posts
    64

    Re: transpose X matching headers X duplicate tables (multiple problems)

    I cant get it to work past row 80 on larger data, also not sure how to ensure the entire data is completely transposed since there is ALOT of cells and values

    See excel
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365 for MAC
    Posts
    3,105

    Re: transpose X matching headers X duplicate tables (multiple problems)

    Hi,
    In I2 and down you can use this instead, so the formula will be uniform:
    =INDEX('Original Data'!$K$1:$R$1,,ROUNDUP(MOD((ROW()-1.1)/COUNTA('Original Data'!$K$2:$K$7),COUNTA('Original Data'!$K$1:$R$1)),0))

    2. which column are you referring to? not sure what you mean...

  8. #8
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365 for MAC
    Posts
    3,105

    Re: transpose X matching headers X duplicate tables (multiple problems)

    Quote Originally Posted by JPRICH16 View Post
    I cant get it to work past row 80 on larger data.....See excel
    Oh I see you took Estevaoba's solution eventualy ,
    I thought by your 1st question - that you referenced to my file ...so will let him answer your questions...

  9. #9
    Registered User
    Join Date
    02-11-2019
    Location
    toronto, canada
    MS-Off Ver
    2013
    Posts
    64

    Re: transpose X matching headers X duplicate tables (multiple problems)

    Quote Originally Posted by belinda200 View Post
    Hi,
    In I2 and down you can use this instead, so the formula will be uniform:
    =INDEX('Original Data'!$K$1:$R$1,,ROUNDUP(MOD((ROW()-1.1)/COUNTA('Original Data'!$K$2:$K$7),COUNTA('Original Data'!$K$1:$R$1)),0))

    2. which column are you referring to? not sure what you mean...
    Thanks!

    Last question!

    Since there is over 12000 data points which is multiplied by the # of columns, how can i do this and know i have all the data. i.e if i drag the forumlas from 12000 to row 40000 ill still miss alot?

  10. #10
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: transpose X matching headers X duplicate tables (multiple problems)

    Solution!A1:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Fill right into B1:J1. Select A1:H1 and fill down into A2:H7.

    Solution!A8:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Fill right into B8:H8.

    Solution!I2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Solution!J2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Select I2:J2 and fill down into I3:J8.

    Select A8:J8, and fill down until formulas in column J produce errors.

    This is specific to 8 columns of attributes and 6 rows of values. For varying number of attribute columns and value rows, BUT plain data still in 'Original Data'!A:H, better to use 1 additional cell.

    Solution!AAB1:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Solution!A1:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Fill A1 right into B1:J1. Select A1:H1 and fill down into A2:H2.

    Solution!I2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Solution!J2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Select A2:J2 and fill down until formulas in column J produce errors.

  11. #11
    Forum Expert
    Join Date
    06-05-2017
    Location
    Brazil
    MS-Off Ver
    Microsoft 365 Version 2404
    Posts
    1,259

    Re: transpose X matching headers X duplicate tables (multiple problems)

    Quote Originally Posted by JPRICH16 View Post
    I cant get it to work past row 80 on larger data

    See excel
    Value 6 in my original formulas was for your model only, i.e. the number of rows.

    Formula adjusted to your new file, in A7:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    And B7:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  12. #12
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365 for MAC
    Posts
    3,105

    Re: transpose X matching headers X duplicate tables (multiple problems)

    Quote Originally Posted by JPRICH16 View Post
    Last question!

    Since there is over 12000 data points which is multiplied by the # of columns.......
    Here is my formulas applied to the complete file
    Attached Files Attached Files
    Last edited by Limor_OP; 01-03-2021 at 03:45 PM.

+ 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] Transpose rows in column and copy adjacent values and headers multiple times
    By PaulM100 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-29-2020, 09:53 AM
  2. autofilter method of range class failed -header has tables headers and non table headers
    By naveen.acheanz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-16-2016, 08:21 AM
  3. Replies: 4
    Last Post: 05-12-2014, 06:58 PM
  4. [SOLVED] Retrieve Data From Multiple Worksheets By Matching Column Headers And Row IDs
    By Ariff_Chowdhury in forum Excel Programming / VBA / Macros
    Replies: 67
    Last Post: 04-20-2014, 03:18 PM
  5. Capturing headers and data from multiple tables
    By meranamjkr in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-18-2014, 10:24 AM
  6. Replies: 4
    Last Post: 02-08-2014, 02:31 PM
  7. Auto filter multiple columns matching with searched headers
    By gotovamsee in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-08-2011, 03:20 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