Closed Thread
Results 1 to 5 of 5

textsplit unknown dimension

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    09-15-2022
    Location
    Marseille, France
    MS-Off Ver
    O365 (PC) V 2303
    Posts
    265

    textsplit unknown dimension

    Dear Friends:

    I have a dynamic array, a single row, each cell contained comma-separated values.

    I need to textsplit these cells into columns in a matrix, problem, I dont know the max number of delimiter (comma) a cell can have, this can change dynamically, thus, I dont know the dimensions (rows) of the final array. Any help is appreciated on this matter.

    textsplit, unknow dimension.jpg
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,754

    Re: textsplit unknown dimension

    With Power Query

    let
        Source = Excel.CurrentWorkbook(){[Name="FromArray_1"]}[Content],
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}, {"Column4", type text}}),
        #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Text.Split([Column1],",")),
        #"Added Custom1" = Table.AddColumn(#"Added Custom", "Custom.1", each Text.Split([Column3],",")),
        #"Added Custom2" = Table.AddColumn(#"Added Custom1", "Custom.2", each Text.Split([Column4],",")),
        #"Added Custom3" = Table.AddColumn(#"Added Custom2", "Custom.3", each Table.FromColumns({[Custom],[Custom.1],[Custom.2]})),
        #"Removed Other Columns" = Table.SelectColumns(#"Added Custom3",{"Column2", "Custom.3"}),
        #"Expanded Custom.3" = Table.ExpandTableColumn(#"Removed Other Columns", "Custom.3", {"Column1", "Column2", "Column3"}, {"Column1", "Column2.1", "Column3"}),
        #"Reordered Columns" = Table.ReorderColumns(#"Expanded Custom.3",{"Column1", "Column2", "Column2.1", "Column3"})
    in
        #"Reordered Columns"
    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

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,053

    Re: textsplit unknown dimension

    I have copied this to your existing thread where all the relevant information about your data resides: https://www.excelforum.com/excel-for...ing-table.html

    Please don't open duplicate threads - you should know the rules by now.
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: textsplit unknown dimension

    Change the array-generating formula to:

    =IF(A3:D3="","¦",A3:D3)

    (or similar) and then use:

    =SUBSTITUTE(IFERROR(DROP(REDUCE(0,F3#,LAMBDA(x,y,HSTACK(x,TEXTSPLIT(y,,",")))),,1),""),"¦","")
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,053

    Re: textsplit unknown dimension

    Glenn - I have copied your response as well.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] TEXTSPLIT on multiple columns to array
    By guillaume0314 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-30-2023, 10:37 AM
  2. [SOLVED] Textsplit/Take/Sequence
    By JEC. in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-10-2023, 02:32 PM
  3. [SOLVED] textsplit function not found
    By pedersenn in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-03-2022, 11:01 PM
  4. No textsplit on my mac and windows
    By iwanttoexcelinexcel in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-03-2022, 11:29 PM
  5. [SOLVED] VBA code to total cells, unknown row, unknown number of cells
    By Ellen 2Excel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-08-2018, 06:33 PM
  6. VBA: 2 open workbooks; 1 unknown; activating the unknown one
    By Janis Rainis in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-05-2014, 08:46 AM
  7. Summing across unknown range in unknown cell!
    By agentred in forum Excel Programming / VBA / Macros
    Replies: 24
    Last Post: 10-28-2009, 10:10 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