+ Reply to Thread
Results 1 to 10 of 10

Rearranging a sheet so that rows that have the same value in column D appear together

  1. #1
    Registered User
    Join Date
    12-16-2021
    Location
    Orlando, FL
    MS-Off Ver
    10
    Posts
    19

    Rearranging a sheet so that rows that have the same value in column D appear together

    Hi--I'd like to arrange a sheet so that rows that have the same value in column D appear together after the first occurrence of that value. I don't want it alphabetical. Attaching two sheets--Starting A is a sample of how it is and Result B is how I would like it--obviously at a much larger scale! Appreciate any help!
    Attached Files Attached Files

  2. #2
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Rearranging a sheet so that rows that have the same value in column D appear together

    is that what you want?

    in your output you have redundant one row (duplicate)

    Column1 Column2 Column3 Column4 Column5 Column6 Column7 Column8
    2022
    Latin C010L01 carrots
    24
    1
    1
    1
    2022
    Latin C01L01 carrots
    48
    10
    8
    5
    2022
    Latin C01L03 carrots
    45
    6
    3
    5
    2022
    Latin C010L03 bananas
    18
    1
    1
    1
    2022
    Latin C02L01 bananas
    265
    40
    30
    9
    2022
    Latin C010L04 kiwis
    23
    1
    1
    1
    2022
    Latin C01L02 kiwis
    35
    7
    4
    6
    2022
    Latin C010L02 apples
    29
    3
    2
    1
    2022
    Latin C01L04 apples
    31
    11
    7
    4


    with Power Query

    Please Login or Register  to view this content.
    Last edited by sandy666; 01-11-2023 at 06:50 PM.

  3. #3
    Registered User
    Join Date
    12-16-2021
    Location
    Orlando, FL
    MS-Off Ver
    10
    Posts
    19

    Re: Rearranging a sheet so that rows that have the same value in column D appear together

    The sample was just a simple example to demonstrate the organization.

  4. #4
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Rearranging a sheet so that rows that have the same value in column D appear together

    sure, add more data into source table then refresh green table (right click and refresh or Ctrl+Alt+F5) but if there will be more different words in column4 you'll need to add more conditions

  5. #5
    Registered User
    Join Date
    12-16-2021
    Location
    Orlando, FL
    MS-Off Ver
    10
    Posts
    19

    Re: Rearranging a sheet so that rows that have the same value in column D appear together

    Oh, sorry--my first reply got eaten. The problem is that there are about 20,000 rows and many different possibilities for what the name in Column 4 will be. I just used those as samples to show the organization. I think I need something very general, if it's even possible. I can't list all the conditions.

  6. #6
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Rearranging a sheet so that rows that have the same value in column D appear together

    no problem just add list of your words in column4 in proper order, will be much easier

    edit:
    and post more representative example with list of your words

    something like this

    source table
    Column1 Column2 Column3 Column4 Column5 Column6 Column7 Column8 list
    2022
    Latin C010L01 carrots
    24
    1
    1
    1
    carrots
    2022
    Latin C010L02 apples
    29
    3
    2
    1
    bananas
    2022
    Latin C010L03 bananas
    18
    1
    1
    1
    kiwis
    2022
    Latin C010L04 kiwis
    23
    1
    1
    1
    apples
    2022
    Latin C01L01 carrots
    48
    10
    8
    5
    2022
    Latin C01L02 kiwis
    35
    7
    4
    6
    2022
    Latin C01L03 carrots
    45
    6
    3
    5
    2022
    Latin C01L04 apples
    31
    11
    7
    4
    2022
    Latin C02L01 bananas
    265
    40
    30
    9
    Last edited by sandy666; 01-11-2023 at 07:20 PM.

  7. #7
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Rearranging a sheet so that rows that have the same value in column D appear together

    or try this
    just paste more data into source table, complete the list then go to the green table and refresh
    you are limited to excel sheet capacity only (1,048,576 rows)
    Last edited by sandy666; 01-11-2023 at 08:07 PM.

  8. #8
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Rearranging a sheet so that rows that have the same value in column D appear together

    Quote Originally Posted by kitkat23 View Post
    I can't list all the conditions.
    you can do that, select whole column with words, copy and paste into another place then from the ribbon choose Remove Duplicates then set the order if necessary

  9. #9
    Registered User
    Join Date
    12-16-2021
    Location
    Orlando, FL
    MS-Off Ver
    10
    Posts
    19

    Re: Rearranging a sheet so that rows that have the same value in column D appear together

    Got it! Thank you so much! This answered my query.

  10. #10
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Rearranging a sheet so that rows that have the same value in column D appear together

    You are welcome

    if the problem is solved, hit Add Reputation (bottom left corner next to the post that was helpful)
    and then mark the thread as SOLVED (top above your first post - Thread Tools)

+ 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. Help Rearranging data into rows from 2 columns
    By worth1g in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-04-2022, 05:56 AM
  2. Error message when rearranging rows within table
    By zachsewilo38 in forum Excel General
    Replies: 1
    Last Post: 01-13-2020, 12:43 PM
  3. Rearranging data from multiple rows to columns
    By tessda in forum Excel General
    Replies: 2
    Last Post: 09-17-2011, 12:58 AM
  4. Rearranging the rows in a range
    By foxguy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-28-2010, 07:53 AM
  5. Rearranging the cells of rows into columns
    By shacky in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-12-2010, 03:35 AM
  6. Rearranging columns to rows
    By joshuar in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 01-11-2010, 10:23 AM
  7. [SOLVED] Rearranging columns/rows
    By BernieH in forum Excel General
    Replies: 1
    Last Post: 02-09-2006, 05:20 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