+ Reply to Thread
Results 1 to 9 of 9

Transposing a single column to multiple rows

  1. #1
    Registered User
    Join Date
    07-26-2013
    Location
    Massachusetts
    MS-Off Ver
    Excel 2010
    Posts
    47

    Transposing a single column to multiple rows

    I have a large sheet containing data from daily calibrations of an instrument for the last quarter (April 1 to June 30). When imported to Excel (2007) from the .csv file, it has three columns: Date, Time, and Value. Each calibration is between 10 and 22 minutes long, data is collected each minute, and some days have more than one sequence.

    I was wondering if anyone knows a way to automatically transpose the Value column into multiple rows (on a separate sheet), where each new row starts at the beginning of each new calibration. I did it manually, selecting each segment of data and doing copy>paste special>transpose, and it took me quite a while so I’m hoping there’s a quicker way for when a similar report needs to be done, which may be this week for a different instrument.

    I’ve attached an example file, where the first sheet is the data imported from the .csv file and the second sheet is the format I’m hoping to get the data into. I’ve highlighted each calibration sequence in the first sheet with a different color to better define where each starts and stops. Entering the dates and start/stop times into the desired format manually shouldn’t be too bad, so automatically transposing the Values is really all I need to figure out. But of course if there’s an easy way to do the dates and times that would be lovely.

    For an engineering student, I’m pretty useless when it comes to Excel.

    Thanks in advance for any responses! I may be in and out of my office for a while today, but I’ll try to answer any clarification questions in a timely manner.
    Attached Files Attached Files
    Last edited by SaraLynne; 07-29-2013 at 09:43 AM.

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

    Re: Transposing a single column to multiple rows

    You could achieve this in Access using a cross tab query. If you don't have Access available to you, then you could use the built in Query Functionality of MS Query (included in Excel). Click on the link below for a tutorial on MS Query.

    http://www.exceluser.com/explore/msquery1_1.htm

    Here is the SQL statement for MS Query
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by alansidman; 07-29-2013 at 10:30 AM.
    Alan


    Have you debugged your code?
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    07-26-2013
    Location
    Massachusetts
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: Transposing a single column to multiple rows

    Thank you, I’ll look into MS Query and read that tutorial! The modified workbook you’ve posted is almost what I need. I want to compare each calibration minute by minute, so I’d like the first minute of each lined up in one column, the second minute in a second column, and so on. For instance, in the example spreadsheet there are two calibration sequences on April 2nd. I need to get the calibration starting at 14:05 on 4/2 underneath and lined up with the two previous calibrations. I’ll see what I can do after reading the tutorial, thanks again!

  4. #4
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,218

    Re: Transposing a single column to multiple rows

    You could try with formulae, but the workbook might be a bit slow with large amounts of data due to the array formulae required.

    See this workbook
    Attached Files Attached Files
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  5. #5
    Registered User
    Join Date
    07-26-2013
    Location
    Massachusetts
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: Transposing a single column to multiple rows

    Thank you, that's great! I was initially trying to use the index function, but just could not figure it out for the life of me. I'll try to apply it to all of the data now and see how it goes.

  6. #6
    Administrator JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Transposing a single column to multiple rows

    Based on marcol's idea, this version does not use array formulas and should stay pretty robust no matter how big the data set is.
    Attached Files Attached Files
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    “None of us is as good as all of us” - Ray Kroc
    “Actually, I *am* a rocket scientist.” - JB (little ones count!)

  7. #7
    Registered User
    Join Date
    07-26-2013
    Location
    Massachusetts
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: Transposing a single column to multiple rows

    Thank you so much JBeaucaire, that worked perfectly! Using those formulas I was quickly and easily able to format the data the way I need to. Now the next one will be a snap! Thanks again everyone who helped, I really appreciate it

  8. #8
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,218

    Re: Transposing a single column to multiple rows

    Hmm?
    @ Jerry
    Your formula seems to omit the last value in each set, to early for me to workout why ...

    Here's another, longer, version without using CSE arrays.
    Attached Files Attached Files

  9. #9
    Administrator JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Transposing a single column to multiple rows

    Thanks Marcol.

    The formula in B3, then copied across the table should be:

    =IF($A3="", "", IF(E$2<=INT(($D3-$C3)*1440)+1, INDEX('Calibration Data'!$C:$C,MATCH($A3+0.01,'Calibration Data'!$D:$D,0)+E$2-1), ""))
    Attached Files Attached Files
    Last edited by JBeaucaire; 07-30-2013 at 09:42 AM. Reason: Updated workbook

+ 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] Importing CSV file into single column/multiple rows vs. multiple rows/single column
    By bjorgenson@charter.net in forum Excel General
    Replies: 4
    Last Post: 07-03-2012, 08:01 PM
  2. Transposing single column data to multiple rows
    By AudreyWalsh in forum Excel General
    Replies: 5
    Last Post: 01-02-2012, 09:09 PM
  3. Transposing column into multiple rows
    By jdubbie in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 02-17-2010, 07:21 AM
  4. Replies: 1
    Last Post: 10-16-2009, 09:23 AM
  5. Replies: 1
    Last Post: 03-18-2009, 04:18 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