# sorting problems

#### Tonto111

##### Board Regular
I have a macro that shows contracts of a certain type (supply, construction, etc.) It then sorts the contracts in order, with the highest number (most recent contract) on top.

However, we recently changed the prefix for our contracts from 670X to 528X, but kept the sequential numbers at the end. For example, an old contract would be 670X-100, while the next contract under the new system would be 528X-101. When you try to sort by descending order, it wants to put these new contracts at the bottom because 528 is less than 670. Any ways to get around this? THANKS

### Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

#### plettieri

##### Well-known Member
You might trying to insert a column and identifying the contracts A for the series that starts with 6.... then B for the series that begin with a 5....

Then do a double sort with this field first then the contract number field second....

This may not be the cleanest way but it should get the job done.

good luck

pll
This message was edited by plettieri on 2002-10-15 14:32
This message was edited by plettieri on 2002-10-15 14:33

#### Mark W.

##### MrExcel MVP
Sort on a column containing the formula...

=RIGHT(A1,LEN(A1)-FIND("-",A1))

...where column A contains your original value.

#### Tonto111

##### Board Regular
I ended up just putting a space in front of the 670, now when I sort in descending order the 528 contracts are on top. Yay
This message was edited by Tonto111 on 2002-10-16 11:08

Replies
13
Views
577
Replies
0
Views
554
Replies
3
Views
297
Replies
25
Views
3K
Replies
0
Views
1K

1,181,643
Messages
5,931,186
Members
436,780
Latest member
doknights

### 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.

### Which adblocker are you using?

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

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