+ Reply to Thread
Results 1 to 6 of 6

reshuffling over blank cell in a row

Hybrid View

  1. #1
    Registered User
    Join Date
    03-27-2025
    Location
    INDIA
    MS-Off Ver
    365
    Posts
    3

    reshuffling over blank cell in a row

    I wish to move cell data from row, over blank cells and fill the gap to keep them to extreme left

    Refer to aatchament.

    Please help
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,928

    Re: reshuffling over blank cell in a row

    Try this,
    =LET(
       a,TRIMRANGE(A1:E100),
       DROP(REDUCE("",SEQUENCE(ROWS(a)),LAMBDA(x,y,VSTACK(x,TOROW(INDEX(a,y,),1)))),1)
    )
    Attached Files Attached Files

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,440

    Re: reshuffling over blank cell in a row

    Please review your previous thread: https://www.excelforum.com/excel-for...ml#post6019255
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,440

    Re: reshuffling over blank cell in a row

    If there are only two entries on a row, this would work:
    Formula: copy to clipboard
    =WRAPROWS(TOROW(A1:E4,1),2)


    If there are, potentially, any number of entries on a row, windknife's solution would need tweaking.
    PHP Code: 
    =LET(
       
    a,TRIMRANGE(A1:E100),
       
    IFERROR(DROP(REDUCE("",SEQUENCE(ROWS(a)),LAMBDA(x,y,VSTACK(x,TOROW(INDEX(a,y,),1)))),1),"")


  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,440

    Re: reshuffling over blank cell in a row

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

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon (Next to Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  6. #6
    Forum Contributor
    Join Date
    08-19-2024
    Location
    Philippines
    MS-Off Ver
    MS365 for Business
    Posts
    113

    Re: reshuffling over blank cell in a row

    A couple of alternative approaches include:
    =LET(
       a, A1:E4,
       b, ISBLANK(a),
       n, COLUMNS(a),
       i, SEQUENCE(ROWS(a)),
       j, SEQUENCE(, n),
       WRAPROWS(SORTBY(TOCOL(IF(b, "", a)), TOCOL(IF(j, i)), 1, TOCOL(IF(b, n + 1, j)), 1), n)
    )
    And:
    =LET(
       a, BYROW(A1:E4, LAMBDA(r, TEXTJOIN("|",, COUNTA(r), r))),
       n, --TEXTBEFORE(a, "|"),
       m, MAX(n),
       TEXTSPLIT(TEXTAFTER(a & REPT("|", 1 + m - n), "|", SEQUENCE(, m)), "|")
    )
    Adjust the range reference as needed.

+ 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] When one cell equals value of another cell, then third cell displays text of fourth cell?
    By spookymyo in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-12-2021, 02:12 PM
  2. Employee Break Schedule not reshuffling
    By ShawnJun in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-23-2020, 11:47 PM
  3. [SOLVED] cell a function doing math on previous sheet, cell b - cell c result in cell d...
    By dad812 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-08-2018, 08:20 AM
  4. Replies: 7
    Last Post: 02-05-2014, 02:20 AM
  5. Replies: 1
    Last Post: 11-06-2013, 02:56 AM
  6. Replies: 1
    Last Post: 11-03-2012, 09:05 PM
  7. Reshuffling of worksheet names depending on the order of cells in a list + more
    By joshnathan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-05-2012, 09:06 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