Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Group cells and sort
Is it possible to group rows and have the sheet sorted by the first item in
the group? ie, we have orders with multiple items, and every item is on a separate row, so if we wanted to sort the orders by the first item on the order, is it possible to have that done and maintain the orders together?. ie I would want this: order sku name 1 789 Bob 1 456 Bob 2 456 Sue 3 789 Joe 3 123 Joe 4 456 Jodi Sorted like this: order sku name 2 456 Sue 4 456 Jodi 1 789 Bob 1 456 Bob 3 789 Joe 3 123 Joe |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Group cells and sort
Your example does not seem to show any sort order? In general unless the
data to be sorted has one or more 'keys' to provide the sequencing then you will not be able to do it. If the data is pre-sorted in as much the order it is supplied in, then you might find adding a helper column with a sequence number from 1 to n useful, you can then use that as part of a sort routine within the other column(s) you wish to sort on. -- Cheers Nigel "KNS" wrote in message ... Is it possible to group rows and have the sheet sorted by the first item in the group? ie, we have orders with multiple items, and every item is on a separate row, so if we wanted to sort the orders by the first item on the order, is it possible to have that done and maintain the orders together?. ie I would want this: order sku name 1 789 Bob 1 456 Bob 2 456 Sue 3 789 Joe 3 123 Joe 4 456 Jodi Sorted like this: order sku name 2 456 Sue 4 456 Jodi 1 789 Bob 1 456 Bob 3 789 Joe 3 123 Joe |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Group cells and sort
I think I sort of understand what you're saying, but I'm not sure. My goal is
to sort the orders by the first item in the order, so in this instance if there were two invoices that came through as: Invoice sku name A 3 Joe A 1 Joe B 1 Sue Sorted, Invoice B would be at the top followed by Invoice A in the same order that invoice A was previously so the data would look like: Invoice sku name B 1 Sue A 3 Joe A 1 Joe Because the SKU in Invoice B would come before the first Sku in Invoice A. Does that make sense? "Nigel" wrote: Your example does not seem to show any sort order? In general unless the data to be sorted has one or more 'keys' to provide the sequencing then you will not be able to do it. If the data is pre-sorted in as much the order it is supplied in, then you might find adding a helper column with a sequence number from 1 to n useful, you can then use that as part of a sort routine within the other column(s) you wish to sort on. -- Cheers Nigel "KNS" wrote in message ... Is it possible to group rows and have the sheet sorted by the first item in the group? ie, we have orders with multiple items, and every item is on a separate row, so if we wanted to sort the orders by the first item on the order, is it possible to have that done and maintain the orders together?. ie I would want this: order sku name 1 789 Bob 1 456 Bob 2 456 Sue 3 789 Joe 3 123 Joe 4 456 Jodi Sorted like this: order sku name 2 456 Sue 4 456 Jodi 1 789 Bob 1 456 Bob 3 789 Joe 3 123 Joe |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Group cells and sort
Hi
I understand your goal (?)- each SKU on an order should remain in the sequence they where placed in, and that the FIRST item (presumbly defined only by its position not its actual number) should be used to sort the orders. So my next question is what determines the sort of the each order relative to every other order? Your first example does not show any specific sequence. Is it the latest order to oldest? Numerical sequence? or something else? I think my original solution using a helper column might still be valid eg applied to your lastest example, add a helper coluimn from1 to n (3 in this case) for each row. Invoice sku name helper A 3 Joe 1 A 1 Joe 2 B 1 Sue 3 Sort on Invoice (Descending) and Helper(Ascending) Invoice sku name helper B 1 Sue 3 A 3 Joe 1 A 1 Joe 2 latest invoice appears at top followed by the next etc., the sequence of SKUs on the order will not change. This however does not work for your first example!!! So I am finding your request difficult to interpret. Also are you looking for a VBA solution? -- Cheers Nigel "KNS" wrote in message ... I think I sort of understand what you're saying, but I'm not sure. My goal is to sort the orders by the first item in the order, so in this instance if there were two invoices that came through as: Invoice sku name A 3 Joe A 1 Joe B 1 Sue Sorted, Invoice B would be at the top followed by Invoice A in the same order that invoice A was previously so the data would look like: Invoice sku name B 1 Sue A 3 Joe A 1 Joe Because the SKU in Invoice B would come before the first Sku in Invoice A. Does that make sense? "Nigel" wrote: Your example does not seem to show any sort order? In general unless the data to be sorted has one or more 'keys' to provide the sequencing then you will not be able to do it. If the data is pre-sorted in as much the order it is supplied in, then you might find adding a helper column with a sequence number from 1 to n useful, you can then use that as part of a sort routine within the other column(s) you wish to sort on. -- Cheers Nigel "KNS" wrote in message ... Is it possible to group rows and have the sheet sorted by the first item in the group? ie, we have orders with multiple items, and every item is on a separate row, so if we wanted to sort the orders by the first item on the order, is it possible to have that done and maintain the orders together?. ie I would want this: order sku name 1 789 Bob 1 456 Bob 2 456 Sue 3 789 Joe 3 123 Joe 4 456 Jodi Sorted like this: order sku name 2 456 Sue 4 456 Jodi 1 789 Bob 1 456 Bob 3 789 Joe 3 123 Joe |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Group cells during sort | Excel Discussion (Misc queries) | |||
How do I sort a group of calculated cells in Excel? | Excel Worksheet Functions | |||
Trying to group cells so that I can sort the upper most cell with. | New Users to Excel | |||
How do i sort a group of cells from highest to lowest | Excel Discussion (Misc queries) | |||
How can I group a bunch of cells together, so I can sort by colum. | Excel Worksheet Functions |