+ Reply to Thread
Results 1 to 22 of 22

Sort Order with merged, paired, grouped rows.

  1. #1
    Forum Contributor
    Join Date
    06-21-2014
    Location
    Brighton
    MS-Off Ver
    2011
    Posts
    115

    Post Sort Order with merged, paired, grouped rows.

    Hi All.

    Looking for some expert advise as this is a little beyond me!
    I've searched forum after forum but can't find the answer that will work for me.

    I have a list of data that has information in groups of 2 rows.
    I have several columns containing different data (some text, some list dropdown, some images, etc.)
    I need the freedom to be able to sort order by any column depending on the order I need to see the information.

    In my example the first row is the qty being orders, the second row is the barcode number for that SKU.
    In each of the other columns are things like; supplier, delivery date, shipment terms, etc.

    I could split all this information out into one single row but the issue is the columns would become too numerous.

    The reason for this file is to raise purchase orders to suppliers.
    Therefore its critical that when sorting I know the file can't break.
    If it breaks I might get a list of products with mixed up qtys, barcodes, etc, etc.
    You can imagine what a disaster that could be!

    I understand sorting with 'grouped' rows & merged cells may not be possible.
    I understand may be a macro might be what I need (but do I have to write a macros for each & every column!? How do I even go about writing a macro!?)

    I've attached my file & hope someone can help me!
    Hopefully self explanatory when you see the file.

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Sort Order with merged, paired, grouped rows.

    Here it is:

    Excel HATES merged cells. Databases have ONE row per record with no blanks, ONE column per field, and ONE header row. If you want additional data in the header, leave a blank row above the actual header and use as many rows as you like.

    Then you can use Autofilter, pivot tables, and a bunch of other analytical tools without fighting Excel, which is a battle you would lose.
    Last edited by shg; 12-02-2015 at 08:04 PM.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Sort Order with merged, paired, grouped rows.

    Agree. Perhaps consider having an extra column for that "trailing" ro data in E:K. What is the purpose for that extra data anyway?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Contributor
    Join Date
    06-21-2014
    Location
    Brighton
    MS-Off Ver
    2011
    Posts
    115

    Re: Sort Order with merged, paired, grouped rows.

    Noted I could have my 'header' at the top with merged cells, then leave a blank row to which I apply the autofilter.

    That doesn't help me however as the list data also have grouped cells & 'grouped' / 'paired' (whatever you want to call it) rows so that once sorted MUST stay together with their corresponding data in the other row.

    I don't think auto filters are an option in this case.
    I think it's a macro.
    I just don't know how to go about writing such a macro.
    May be pivot tabels are the answer but again I've no experience of these.

    Thanks any way.

  5. #5
    Forum Contributor
    Join Date
    06-21-2014
    Location
    Brighton
    MS-Off Ver
    2011
    Posts
    115

    Re: Sort Order with merged, paired, grouped rows.

    Quote Originally Posted by FDibbins View Post
    Agree. Perhaps consider having an extra column for that "trailing" ro data in E:K. What is the purpose for that extra data anyway?
    The column cell data are for lots of things from order number, item SKU, item name, qty, (with related barcode in below row), supplier, etc, etc.

    I therefore might want to see all my orders by order number or may be by supplier, or may be by product or may be by qty ordered, etc, etc.

    This is the reason for the extra column cell data.

    The reason for x2 rows per product is that E:K are the qty per size with the corresponding barcode number per size.

    I could put everything on one row but then the list would become really long.

    Thanks.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Sort Order with merged, paired, grouped rows.

    I could put everything on one row but then the list would become really long.
    But that's what you should do. That's how Excel is designed to work.

  7. #7
    Forum Contributor
    Join Date
    06-21-2014
    Location
    Brighton
    MS-Off Ver
    2011
    Posts
    115

    Re: Sort Order with merged, paired, grouped rows.

    Quote Originally Posted by shg View Post
    But that's what you should do. That's how Excel is designed to work.
    Appreciate that but there are ways round it. I don't want a big long list on one row.

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Sort Order with merged, paired, grouped rows.

    Go for it.

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Sort Order with merged, paired, grouped rows.

    I dont think it will let you sort merged cells anyway

  10. #10
    Forum Contributor
    Join Date
    06-21-2014
    Location
    Brighton
    MS-Off Ver
    2011
    Posts
    115

    Re: Sort Order with merged, paired, grouped rows.

    Quote Originally Posted by shg View Post
    Go for it.
    I do appreciate any comments and help, I wouldn't be here asking if I didn't need the help (don't bite the hand that feeds you) but you're comments this isn't really helping.
    Telling me you can't sort merged rows is simply telling me what I already know.

    I need help with a macro or something to be able to take the data as I need it to be viewed (as per the file example I gave), to then do some tricks (maybe selecting the data, copying it out onto one row, sort it & then re-building the data as I need it to be viewed).
    Just a long winded idea, may be there are other ways of doing what I'm trying to achieve.

    Thanks any way.

  11. #11
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Sort Order with merged, paired, grouped rows.

    I was thinking about this some more, and maybe tou could have a cell to enter your "sort" criteria, then have another table to extract the data to?

    Can you show some samples of what you might want?

  12. #12
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Sort Order with merged, paired, grouped rows.

    If you're going to create a macro, create one that takes your data in proper database format and generates a report for presentation that looks however you want it to look - merged cells, multi-row headers, whatever suits your fancy.

    Don't confuse data with presentation.

  13. #13
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Sort Order with merged, paired, grouped rows.

    Here is your data with the cells unmerged and the sum adjusted to take care of the changes to the cell contents that I made.
    This is just to show that it can be done without adding columns.
    Attached Files Attached Files
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  14. #14
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Sort Order with merged, paired, grouped rows.

    Nice option Ron

    You could use SUMPRODUCT, too...
    =SUMPRODUCT(--(LEFT(E4:K4,FIND(" ",E4:K4,1)-1)))

  15. #15
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Sort Order with merged, paired, grouped rows.

    @ Ford

    You are of course correct and I think that your formula is preferable as it is shorter and much less involved. With a little explanation, if necessary, it is easy to understand.
    Last edited by newdoverman; 12-03-2015 at 08:26 PM.

  16. #16
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Sort Order with merged, paired, grouped rows.

    Even what I gave as a formula was "ham-fisted" being in a rush. It should have been as follows (I still like Ford's formula)

    Enter this in L4 and fill down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    or
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  17. #17
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Sort Order with merged, paired, grouped rows.

    Ron, I have been trying to play with SP more often of late, and while it may be slower than some of the "more modern" functions, it can still often do things that the others cant

  18. #18
    Forum Contributor
    Join Date
    06-21-2014
    Location
    Brighton
    MS-Off Ver
    2011
    Posts
    115

    Re: Sort Order with merged, paired, grouped rows.

    Quote Originally Posted by shg View Post
    If you're going to create a macro, create one that takes your data in proper database format and generates a report for presentation that looks however you want it to look - merged cells, multi-row headers, whatever suits your fancy.

    Don't confuse data with presentation.
    Very good point, very good idea.

    This form is to be used by a customer to enter their 'orders'
    I could extract that to a hidden data sheet & then use a macro to present the data the way I want.
    Good shout. Might give that a go!

  19. #19
    Forum Contributor
    Join Date
    06-21-2014
    Location
    Brighton
    MS-Off Ver
    2011
    Posts
    115

    Re: Sort Order with merged, paired, grouped rows.

    Quote Originally Posted by newdoverman View Post
    Here is your data with the cells unmerged and the sum adjusted to take care of the changes to the cell contents that I made.
    This is just to show that it can be done without adding columns.
    Thanks.

    This might work well however it's consolidating the qty per size & barcode into one row. Not exactly what I need but the idea is there.

    Might work on something with a combination of your example + "shg"

    Thanks again for the input.

  20. #20
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Sort Order with merged, paired, grouped rows.

    @Ford
    Just got notified of your message (email worse than Post Office )
    SUMPRODUCT is quite useful and as you say can do some things that later functions can't or does it in an easier to understand format than the newer functions. I haven't used my calculation timers to test the comparison of speeds. I suspect that there isn't much difference.

  21. #21
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Sort Order with merged, paired, grouped rows.

    Glad the notification is working again SP probably wont be too much slower on smaller ranges

  22. #22
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Sort Order with merged, paired, grouped rows.

    If I remember, the next time that I have an opportunity to time SUMPRODUCT vs other functions using the same data, I will do so and give you the results.

    The notifications are real sporatic as you can see, it took 24 hours to get notified of your msg.

+ 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] Sort Individual Rows within Grouped Data
    By dshack in forum Excel General
    Replies: 3
    Last Post: 09-15-2013, 12:34 PM
  2. Sort Grouped Rows
    By Unifyzero in forum Excel General
    Replies: 2
    Last Post: 05-23-2013, 05:45 PM
  3. Sort Grouped Rows by Cell in Group
    By hpush in forum Excel General
    Replies: 2
    Last Post: 11-20-2012, 05:48 PM
  4. Replies: 8
    Last Post: 08-15-2012, 02:42 AM
  5. keep rows grouped and sort
    By johnny1 in forum Excel General
    Replies: 4
    Last Post: 07-22-2010, 02:03 PM
  6. How to sort when info is grouped in rows?
    By LaVerne in forum Excel General
    Replies: 5
    Last Post: 06-20-2005, 08:05 PM
  7. How to sort by grouped rows
    By Mike in forum Excel General
    Replies: 2
    Last Post: 04-05-2005, 06:06 PM

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