+ Reply to Thread
Results 1 to 6 of 6

Transpose then stack columns

  1. #1
    Registered User
    Join Date
    01-06-2014
    Location
    Columbus, IN
    MS-Off Ver
    2013/O365
    Posts
    41

    Transpose then stack columns

    First question of many to come I'm sure.

    I'm not sure if this is possible with just equations/formulas or if it enters the realm of macros/VBA so I'm putting it in general.

    short of it: I have a table of data (rows are days, columns are rooms, data is usage of the room on that day) that I need to transpose then stack one above the other so they're all in a column. The goal is to have room and day in column A, usage in column B. Transposing via copy/paste transpose is easy but I'd like to get it to where I can add a line of data (a day from the computer logger) and have it all update, which is where I'm stuck.

    The data's usable by itself for comparison to itself, but it does need to be in one big column to add to another table of data from another logger that records various types of usage. (ultimately, I'm comparing the data from the two loggers). I don't want to manually build a table of references because the tables in question are going to end up several hundred rows and 70+columns.

    Brief, totally made up example: trnsps and stack.xlsx
    -Russell

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Transpose then stack columns

    Hi and welcome to the forum

    I have a feeling this is way too simplistic If you already have the data in G, then you couls use this, copied down...
    =INDEX($A$3:$E$7,MATCH(RIGHT(G21,4),$A$3:$A$7,0),MATCH(LEFT(G21,3),$A$3:$E$3,0))
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    01-06-2014
    Location
    Columbus, IN
    MS-Off Ver
    2013/O365
    Posts
    41

    Re: Transpose then stack columns

    Tentatively, yes. looks like it works in the sample. now to get it to work across pages in the actual sheet. Will let you know.

  4. #4
    Registered User
    Join Date
    01-06-2014
    Location
    Columbus, IN
    MS-Off Ver
    2013/O365
    Posts
    41

    Re: Transpose then stack columns

    Works in the sample fine.
    Got it to work in the first cell. (tried putting another value in the cell it looks at and it works)
    Try to fill it down and no dice. Dollar signs are present to hold cell addresses everywhere but what the match formulas are looking for. The cells give "#N/A" and evaluating the formula says the match() formulas are giving the error.

    I actually have the date and time separate, the match() formulas are looking at the cells they're in rather than figuring out the left and right stuff. I got this working in the sample but not the actual.

    I wouldn't think it matters but the sheet I'm working on is looking for the data on another sheet in the same workbook. (yes, sheet references are present)

    Edit: using the function wizard, the match(...) for the row is giving the #N/A. putting the whole match(...) in a row() formula isn't helping. I also tried having it target the room and day before and it works. I dunno.

    Edit 2: ah HA, figured it out. the day was displayed as 2 digit day of the month but only the first row in the bigger table had the day() formula used so only it matched up with where I used the day() formula on the logger data page. (for whatever reason, the rest of the column was still displayed as 2 digits but the formula wasn't there)

    THANKS A BUNCH for a kick in the right direction. OK more like giving me the answer More to come tomorrow I'm sure.
    Last edited by russc2541; 01-08-2014 at 04:22 PM.

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Transpose then stack columns

    Glad you were ablke to get it to work for you, and thanks for the feedback

  6. #6
    Registered User
    Join Date
    01-06-2014
    Location
    Columbus, IN
    MS-Off Ver
    2013/O365
    Posts
    41

    Re: Transpose then stack columns

    It always looks so simple and obvious in hindsight lol
    Last edited by russc2541; 01-10-2014 at 09:15 AM.

+ 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. Trying to Stack Many Columns into 2
    By JustSalsa in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-17-2012, 09:06 AM
  2. [SOLVED] how to stack multiple columns?
    By mrr2 in forum Excel General
    Replies: 9
    Last Post: 05-11-2012, 01:20 PM
  3. [SOLVED] Modify code to transpose a stack of data to rows on to delimit on text hone number field
    By coachtim in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-26-2012, 02:52 PM
  4. [SOLVED] stack columns
    By Wan in forum Excel General
    Replies: 1
    Last Post: 12-26-2005, 01:25 AM
  5. [SOLVED] How can I stack 3-D columns
    By jiggiddi in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 10-15-2005, 12:05 AM

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