Sorting: Prioritizing Group retention over Order

stretch2011

New Member
Joined
Jan 1, 2016
Messages
7
Hello,

Long time reader, first time post. I'm working on a project at work to try and automate some portions of schedule creation for our assets. I work in manufacturing. I'm pretty descent with excel, or at least pretty descent at googling what I want to do. I'm good up until it gets into VBA coding and I think the solution I'm looking for requires it ( I may be wrong).

If any guru's out there want to take a stab at this, or point me in the right direction, I would greatly appreciate it. Requirements are in the mini sheet.

Example.xlsx
ABCDEFGHIJKLMNO
1BeforeAfter
2LocationPart #Due DateAsset #Insert TypeColor TypeLocationPart #Due DateAsset #Insert TypeColor Type
3111$I$N1110/08/20241$I$Y
4111$I$O1110/09/20241$F$V1.) Ordering by number A-Z is not important, Minimilizing change is important.
5111$F$O111$F$M
6111$F$Y111$I$M2.) Grouping Hierarchy
71110/09/20241$F$V111$F$N1st - Location : Locations don’t mix so what happens inside of 1 location doesn’t affect another
8111$F$Q111$I$N2nd- Earliest Due date: Avoid past dues. Some flexibility in this.
9111$F$N111$I$N3rd- Asset # : Changing assets is very tedious, so keeping assets grouped is high priority.
10111$F$M111$F$O3.a- Assets do not need to be A-Z, just grouped together ( ex. all 1's are together)
11111$I$M111$I$O4rd- Color type: Easier to change a color than an asset, but harder than changing insert type
12111$I$N111$F$Q5th- Insert changes
13111$I$X111$I$Q
141110/08/20241$I$Y111$I$U3.) Insert type and color type columns were derived from full part numbers.
15111$I$U111$I$X
16111$I$Q111$F$Y4.) The standard multilevel sort does not work. Gets around 80% of the way there.
172210/03/20242$I$N2309/25/20243$F$NIt will sort the locations, and assets together, but it does not dynamically change
182309/25/20243$F$N233$F$Othe sort order based off of the cell above.
19233$F$O255$F$OSet sort order ex
20244$F$O2509/25/20245$F$N1st (N)
21244$F$V2210/03/20242$I$N2nd (O)
22244$F$U21309/26/202413$F$V3rd (P)
23244$F$Q21310/01/202413$F$O4th €
24244$I$Q21310/01/202413$I$OIf a asset (1) ends on color $O and asset (2) has colors $N,$O, and $P
25244$I$N21310/04/202413$I$Uit will order asset (2) as $N-$O-$P per the standard sort order format.
26244$I$O21310/07/202413$I$MThe prefered result would be to sort asset (2) as $O-$P-$N since the last asset
27244$I$Y21310/18/202413$F$Mended on $O
282509/25/20245$F$N21310/07/202413$I$N
29255$F$O2710/09/20247$F$N5.) Another way of looking at it would be a running sort order that references the above cell to determine the sequence
30266$I$U277$Finside the groups below.
312710/09/20247$F$N266$I$U
32277$F288$F$N6.) Typical row count is 250-350 line items in normal spreadsheet.
33288$F$N288$F$O
34288$F$O299$F$O
35299$F$O21010$F$O
3621010$F$N21010$F$U
3721010$F$U21010$F$N
3821010$F$O21111$F$N
3921111$F$N244$I$N
4021212$F$Q244$F$O
4121313$F$N244$I$O
4221310/01/202413$I$O244$F$U
4321310/01/202413$F$O244$F$V
4421309/26/202413$F$V244$I$Y
4521310/18/202413$F$M244$I$Q
4621313$F$N244$F$Q
4721310/04/202413$I$U21212$F$Q
4821313$I$Q21313$I$Q
4921310/07/202413$I$M21313$F$N
5021310/07/202413$I$N21313$F$N
5121313$I$Y21313$F$U
5221313$F$U21313$I$Y
After
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Forum statistics

Threads
1,222,562
Messages
6,166,811
Members
452,073
Latest member
akinch

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top