+ Reply to Thread
Results 1 to 8 of 8

Re-Positioning cells position to match header?

  1. #1
    Registered User
    Join Date
    12-20-2018
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    4

    Re-Positioning cells position to match header?

    Hi All, May i ask if it is possible to rearrange cells to be in the same column as header if their text matches?

    For example:
    question.PNG

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Re-Positioning cells position to match header?

    Hi,

    Almost certainly yes, either using functions to create a second table or VBA

    However this is clearly a much simplified example and probably doesn't represent the size of your actual data. We often find that when we give an answer to what is a trivial non representative example when the solution is used with the real world data it doesn't work because of factors like string length and other stuff which is important but hasn't been mentioned.

    Therefore upload your real workbook (or at least a cut down copy), and manually add the results you expect to see. Clearly identify which is original data and which are the results and in a note clearly explain how you have arrived at your results.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    12-20-2018
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    4

    Re: Re-Positioning cells position to match header?

    I have attached my CSV in the zip file.

    What i am aiming to achieve with this dataset is to reorganize the cells in every row to match its header.
    However, this is my first time working with such big datasets with about 1,000+ Columns and 20,000+ Rows and I have no idea how to work around with it

    The header values are ALL the unique values that i have identified based on the data on every row!

    Every row has exactly 20 Cells/Columns worth of values!
    Attached Files Attached Files
    Last edited by Purpies; 12-20-2018 at 05:42 AM.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Re-Positioning cells position to match header?

    Please attach the .xlsx file - this can be a cut-down version of the original, as we do not need to see all of the data (100 rows will do). This can probably be done with Power Query.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Registered User
    Join Date
    12-20-2018
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    4

    Re: Re-Positioning cells position to match header?

    Here is my sample data with 100 rows of data
    Attached Files Attached Files

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Re-Positioning cells position to match header?

    I am attaching a sample file. It uses the following M code in PQ:

    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    12-20-2018
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    4

    Re: Re-Positioning cells position to match header?

    Thank you so much for the help, Really appreciate it.

    However, may i know what exactly does this (#Pivoted Column) power query in the M code does?
    Last edited by AliGW; 12-20-2018 at 12:06 PM.

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Re-Positioning cells position to match header?

    It pivots the column - swivels it around 90 degrees. If you open my sample file you will see the table that it has produced from your original data.

+ 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. VBA: Picture in Word-Header? Position?
    By Tycro in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-18-2017, 04:25 AM
  2. Match Cells with coloum header and then copy the same row
    By SKVTS in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-17-2015, 12:43 PM
  3. [SOLVED] weighted average formula for cells that do NOT match a header label
    By macrorookie in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-12-2014, 10:27 AM
  4. Header to Match Worksheet Cell or Cells?
    By mycon73 in forum Excel General
    Replies: 2
    Last Post: 03-03-2011, 09:48 PM
  5. Looking up column header value based on color and position in row
    By waylyn in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-16-2009, 11:31 PM
  6. [SOLVED] Header/Footer horizontal margins/text positioning
    By akhergert in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-08-2005, 05:30 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