+ Reply to Thread
Results 1 to 7 of 7

Using Transpose or macro not sure what one will work

  1. #1
    Registered User
    Join Date
    03-25-2015
    Location
    Cumberland, WI
    MS-Off Ver
    2010- 2014
    Posts
    3

    Using Transpose or macro not sure what one will work

    I have a very long list (column) of data 48735 lines long, the data is currently sorted by time so in my A column my data is sensor 1 min, sensor 2 ave, sensor 1 max, sensor 2 min, sensor 2 ave, sensor 2 max, sensor 3 min, sensor 3 ave, sensor 3 max one reading for each min then repeating for the total length of record time. So I want to take the D column of data and transpose it into 9 separate columns, one for each of the different readings. I have not found a may to do it using the basic transpose function, so maybe I should use a macro, program but I have never written one before so don't know how to start. attached is a picture of the data so you can see what I am working with.
    Attached Images Attached Images
    Last edited by SNOWANDSKATE; 03-25-2015 at 05:31 PM.

  2. #2
    Registered User
    Join Date
    12-11-2014
    Location
    Dallas, TX
    MS-Off Ver
    2010
    Posts
    94

    Re: Using Transpose or macro not sure what one will work

    I think I can help you out. Is there any way I could get you to upload your file? I could work with it a lot easier.
    If I have helped you, please add to my reputation!

  3. #3
    Registered User
    Join Date
    12-11-2014
    Location
    Dallas, TX
    MS-Off Ver
    2010
    Posts
    94

    Re: Using Transpose or macro not sure what one will work

    Let's see what we can do with out the spreadsheet.

    First, insert a column before column E. We're going to use this column to make a list of unique time stamps that are in your list. Put this in E2:

    =IFERROR(INDEX($C$2:$C$48736,MATCH(0,INDEX(COUNTIF($E$1:E1,$C$2:$C$48736),0,0),0)),"")

    Click the bottom right corner of the cell and copy this down as far as it will go until it runs out of values. Next, we're going to create a formula that matches that timestamp to the header in row 1. Put this in F2:

    =INDEX($A$2:$D$48736,MATCH(1,(RIGHT($A$2:$A$48736,8)=F$1)*($C$2:$C$48736=$E2),0),4)

    This is an array formula, so confirm it using CTRL+SHIFT+ENTER. Now, again, grab the bottom right corner of the cell, and copy it across to column N. Now select F1:N1, grab the bottom right corner again, and drag it down to the last line that has a value in column E. This should match the values and give you a new list in the format you need. Let me know if you have any questions!
    Last edited by npatridge; 03-25-2015 at 06:20 PM.

  4. #4
    Registered User
    Join Date
    03-25-2015
    Location
    Cumberland, WI
    MS-Off Ver
    2010- 2014
    Posts
    3

    Re: Using Transpose or macro not sure what one will work

    npatridge I tried using the formulas you suggested and I am not getting the results that I want. Maybe I wasn't clear enough in my first post. I would like to condense my data and time column (C) so that each time has one row. the amp reading are separated out into separate columns.

    ________________C_____________D___________ E__________F______________G
    Row 1______date/time______---------------sensor readings in amps---------------
    Row 2___3/19/2015 14:27____sensor 1 min___sensor 1 ave___sensor 1 max___sensor 2 min...
    row 3____3/19/2015 14:28___sensor 1 min___sensor 1 ave___sensor 1 max___sensor 2 min...
    Last edited by SNOWANDSKATE; 03-26-2015 at 04:08 PM.

  5. #5
    Registered User
    Join Date
    12-11-2014
    Location
    Dallas, TX
    MS-Off Ver
    2010
    Posts
    94

    Re: Using Transpose or macro not sure what one will work

    Hm, I thought that was what I had accomplished. Here is the result of mine with the formulas I posted:

    snip.png

    Is that right?

  6. #6
    Registered User
    Join Date
    03-25-2015
    Location
    Cumberland, WI
    MS-Off Ver
    2010- 2014
    Posts
    3

    Re: Using Transpose or macro not sure what one will work

    Yes that is correct for what ever reason I must copied something over incorrectly. I was able to get it to work also using "INDEX($D$2:$D$48736,ROWS(C$2:C2)*9-9+COLUMNS($C2:C2))". Thank you for your helping looking at my problem for me. I have three more spread sheets with the same type of data do do this for! I have one more question that you might be able to answer. can you split the date and time into two separate columns instead of having them joined together in column E?

    Again Thanks for your help!

  7. #7
    Registered User
    Join Date
    12-11-2014
    Location
    Dallas, TX
    MS-Off Ver
    2010
    Posts
    94

    Re: Using Transpose or macro not sure what one will work

    There are a few answers here. I imagine that Excel has converted your date/time into its date serial format in the background, and that you can change the number format of the column to how you like. However, if it is truly text, you can use the Text to Columns function under Data>Data Tools; set your delimiter to "space." If for some reason neither of those options work, and again, it is definitely text, you can use the following formulas to get everything to the left of the space and the right of the space:

    =LEFT(C2,FIND(" ",C2)-1)
    =RIGHT(C2,LEN(C2)-FIND(" ",C2))

    Have a great evening!

+ 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] Turning rows into columns (transpose won't work)
    By raej in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-09-2013, 02:47 PM
  2. Transpose wont work with Small(IF) formula
    By FrederikBjerre in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-28-2012, 09:02 AM
  3. Replies: 0
    Last Post: 02-04-2012, 05:17 AM
  4. Excel 2007 : Transpose cant work
    By j790137 in forum Excel General
    Replies: 2
    Last Post: 01-27-2012, 07:25 PM
  5. Transpose wont work - too much data
    By wibbleman12 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 12-14-2010, 01:30 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