+ Reply to Thread
Results 1 to 5 of 5

Rearrange Cells to Match Other Cells

  1. #1
    Registered User
    Join Date
    10-21-2020
    Location
    United States
    MS-Off Ver
    Office 16
    Posts
    7

    Post Rearrange Cells to Match Other Cells

    (Excel Doc Attached)

    I am trying to rearrange the cells in column B to match the cells in column A, by searching each cell in column A partially based on the cells in column B.

    For Example:

    A1 = 123ABC
    B6 = ABC

    B6 is ABC and A1 has ABC in it's contents.

    What I want to happen, is for the information in B6 to move to B1 because A1 contains some of B6's contents.
    Attached Files Attached Files

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Rearrange Cells to Match Other Cells

    Hi Patric,

    This formula works for your example but may not for a larger sample of data:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    See it in the attached:
    Index Match Right or Mid.xlsx
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    10-21-2020
    Location
    United States
    MS-Off Ver
    Office 16
    Posts
    7

    Re: Rearrange Cells to Match Other Cells

    Sorry that it took me a while to get back with you. It works for the most part, but not with a vast amount of data (Like you thought might happen). See, the sheet that I'm using this formula/code for, has over 40,000 rows of data. When I use the formula you gave me on that many rows, it nearly crashes my computer. To combat this, I made sure to end all other processes on my computer and then try again with a smaller amount of data. Still nearly crashed my computer. So yeah, still in need of help here, thanks though.

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,551

    Re: Rearrange Cells to Match Other Cells

    This might be an instance where adding a helper column reduces the overall computational load.
    In the file attached to post #1:
    Put the following into cell F3 and copy down to cell F5: =SUMPRODUCT(ISNUMBER(SEARCH(B3,A$3:A$5))*(ROW(A$3:A$5)))-2
    Put the following into cell E3 and copy down to cell E5: =INDEX(B$3:B$5,MATCH(ROWS(A$1:A1),F$3:F$5,0))
    Note that column F could be moved and/or hidden for aesthetic purposes.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  5. #5
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,551

    Re: Rearrange Cells to Match Other Cells

    This may work better for column F:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if you have any questions.

+ 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] How to rearrange cells in one row to multiple columns in another sheet
    By resiexfor in forum Excel General
    Replies: 2
    Last Post: 01-22-2020, 08:02 AM
  2. Rearrange cells to group same results, and surrounding cells
    By ryangodammit in forum Excel General
    Replies: 3
    Last Post: 05-29-2014, 08:33 AM
  3. Rearrange Cells in Excel 2007
    By bitedgy in forum Excel General
    Replies: 1
    Last Post: 09-28-2011, 02:20 AM
  4. Rearrange cells
    By boolean in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-20-2011, 07:20 PM
  5. Macro to rearrange cells based on numerical order
    By Mbutler132000 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-18-2010, 11:02 AM
  6. Rearrange cells
    By evaki in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-02-2010, 07:35 AM
  7. [SOLVED] How can I automatically rearrange cells to my specifications?
    By Frederique38 in forum Excel General
    Replies: 3
    Last Post: 02-24-2006, 04:35 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