+ Reply to Thread
Results 1 to 11 of 11

transpose/convert range of rows and columns to one column, removing blanks

  1. #1
    Registered User
    Join Date
    02-12-2019
    Location
    Houston, United States
    MS-Off Ver
    365 Pro Plus
    Posts
    10

    Question transpose/convert range of rows and columns to one column, removing blanks

    Hi all,

    I've been wracking my brain for days already trying to figure this out. I've searched all over the web and haven't come to an answer there either.

    In the attached sample workbook, I need a formula that works fast and doesn't interrupt workflows that takes all the values of all the cells in a range pf rows and columns, removes the blanks, and outputs a single column with all these values in order, and outputs blanks at the end of the list, not zero's.

    It needs to stay as a formula because all the data that are in these columns and rows are formulas linked to another sheet in the same workbook. The other sheet will be updated with more rows, in which case this range of data will update, and then the formula you guys might help me with will update.

    In the attached sample, i have removed the formulas, but originally every cell from column A to L had formulas, and A to L is the range I need output into a single column N. The formulas go all the way down to row 12,000. So. there should be 144,000 cells in the range that this formula will be working with.

    It doesn't matter how many helper columns I need, but I need it to work fast and update smoothly, so that most likely rules out array formulas since as far as i've seen they take forever to update and sometimes crash my system when looking through 144,000 formulas.

    You guys are probably my last hope. If you guys can't figure this out, I might as well just give up.

    Thank you so much!!
    Attached Files Attached Files

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: transpose/convert range of rows and columns to one column, removing blanks

    Forget using formulas.

    Format range A:L as a table. The table will resize if you add more rows.

    Then use this Power Query (Get & Transform Data) to extract the unique values:

    Please Login or Register  to view this content.
    Choose Load To, and load to a Table, in range M1.

    Now you can simply refresh this query to update your column of distinct values.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 VersionVersion 2501 Win 11
    Posts
    24,434

    Re: transpose/convert range of rows and columns to one column, removing blanks

    Using Power Query, you can load the data from the original spreadsheet and keep the link. Then any updates to the source document will automatically the target document. Load your data to Power Query, Unpivot all columns. Filter the column you have created to remove all nulls. Load and close to your spreadsheet. After making changes to the source document, click on refresh at least twice and the target document will update. If you need additional help on PQ, a good book is "M is for (Data) Monkey," This is a very powerful feature in Excel. It quickly manages reconfiguration of data quickly and easily.
    Attached Files Attached Files
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Registered User
    Join Date
    02-12-2019
    Location
    Houston, United States
    MS-Off Ver
    365 Pro Plus
    Posts
    10

    Re: transpose/convert range of rows and columns to one column, removing blanks

    olly, alansidman, thank you so much for your help. I've used power query only once, and I have no clue how to use it. I need to learn this fast, so I can't read a book about it.

    Plus, my bosses want it to update automatically as you go without even needing to press a button.

    Is there any way to accomplish this?

  5. #5
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: transpose/convert range of rows and columns to one column, removing blanks

    There's a link in my signature, to help you through using the code I gave you.

    With respect to automatically updating - you _could_ write some VBA to catch change events, then refresh the query...

    But clicking "Data > Refresh All" isn't much hardship. Keep it simple.

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 VersionVersion 2501 Win 11
    Posts
    24,434

    Re: transpose/convert range of rows and columns to one column, removing blanks

    Look at this video on how to load the file. Then follow the steps, I have outlined.

    Once you have the results loaded back into your spreadsheet, write a macro to refresh the data (remember you will need to refresh twice) using the On_Open event for the workbook.

    https://www.youtube.com/watch?v=a7E29H5ZUmE

  7. #7
    Registered User
    Join Date
    02-12-2019
    Location
    Houston, United States
    MS-Off Ver
    365 Pro Plus
    Posts
    10

    Re: transpose/convert range of rows and columns to one column, removing blanks

    Oh, thank you so much for the powerquery help haha! Completely missed that. That is awesome btw that you have your own excel help website. I just bookmarked.

    The reason we didn't want to have to refresh is because people accross our work network with just about zero tech experience will be adding to this workbook, and they'll be told to only touch the Master Sheet, not the others. But, if you can press "Data > Refresh All" from any Sheet, then that'll work great!

    Or, actually I just found sfmagazine . com /post-entry/november-2017-excel-split-delimited-data-into-new-rows/ < this site

    I'll reply you again if I can't figure out how to make it automatically update it the way I want, learning from the "IMPROVING THE WORK FLOW" section.


    Thanks soooo much! Y'all are an amazing help guys. Added rep.

  8. #8
    Registered User
    Join Date
    02-12-2019
    Location
    Houston, United States
    MS-Off Ver
    365 Pro Plus
    Posts
    10

    Re: transpose/convert range of rows and columns to one column, removing blanks

    Quote Originally Posted by Olly View Post
    There's a link in my signature, to help you through using the code I gave you.

    With respect to automatically updating - you _could_ write some VBA to catch change events, then refresh the query...

    But clicking "Data > Refresh All" isn't much hardship. Keep it simple.
    Olly, is there a way to do this same code that you created, but have it not sort it alphabetically? I need it to stay in the same order it was in.

    E.G.
    A1
    B1
    C1
    D1
    E1
    F1
    G1
    H1
    I1
    J1
    K1
    L1
    A2
    B2
    C2
    D2
    etc...

    *EDIT* nevermind, just figured out i just had to remove the sorted rows line at the end of the query settings > applied steps :D


    alan, thank you so much but I'd like to use Olly's code, as I want this to be in the same sheet as original data, not a different workbook.

    Thank you!!
    Last edited by loganpmgoa; 02-13-2019 at 01:22 PM.

  9. #9
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: transpose/convert range of rows and columns to one column, removing blanks

    Simply remove the "Sorted Rows" step:

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    02-12-2019
    Location
    Houston, United States
    MS-Off Ver
    365 Pro Plus
    Posts
    10

    Re: transpose/convert range of rows and columns to one column, removing blanks

    Thank you! I actually just figured that out and edited my post right before you replied :D

  11. #11
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 VersionVersion 2501 Win 11
    Posts
    24,434

    Re: transpose/convert range of rows and columns to one column, removing blanks

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks for the Rep!

+ 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. Transpose or Convert column data set to multiple columns-variable!
    By itglaafs in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-31-2017, 01:20 PM
  2. [SOLVED] Copy & Paste Columns to Specific Range while Removing Blanks & Duplicates
    By dondada82 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 04-15-2017, 11:31 AM
  3. [SOLVED] Macro to convert and Transpose a Matrix of 16 Columns and 16 Rows
    By prkhan56 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-10-2017, 08:19 PM
  4. [SOLVED] How to transpose / convert columns and rows into single column?
    By chief_abound in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-09-2015, 08:04 PM
  5. Replies: 12
    Last Post: 05-26-2014, 09:04 PM
  6. Replies: 2
    Last Post: 09-19-2012, 10:58 PM
  7. Formula to convert/transpose columns to rows (and vice versa)
    By markx in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-10-2005, 11:06 AM

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