how to get the correct sort order. when i tried i get the erroneous one.pls see the attached
how to get the correct sort order. when i tried i get the erroneous one.pls see the attached
Hi,
I used helper column. See the file.
depends on how many vol you have as well
this as a helper will allow you to sort from
vol-1-1 up to
vol-99-999
=LEFT(B2,4)&TEXT(SUBSTITUTE(LEFT(B2,FIND("-",B2,6)-1),"VOL-",""),"00")&"-"&TEXT(MID(B2,FIND("-",B2,5)+1,10),"000")
"Unless otherwise stated all my comments are directed at OP"
Mojito connoisseur and now happily retired
where does code go ?
look here
how to insert code
how to enter array formula
why use -- in sumproduct
recommended reading
wiki Mojito
how to say no convincingly
most important thing you need
Martin Wilson: SPV
and RSMBC
If the VOL numbers increase into the double digits, the problem is compounded because computers sort values from left to right. That is why you will get 20 sorted before 3 and 30 before 4.
To get around this, copy the original data into column B and use Text to columns on column B. Use - as the delimiter. Don't import VOL. Click Finish. Now, sort on column B and add column C as a second sort.
This shows the results after adding volume numbers higher than 10 for demonstration purposes.
A B C 1original H1 H2 2VOL-1-1 1 1 3VOL-1-2 1 2 4VOL-1-3 1 3 5VOL-1-4 1 4 6VOL-1-5 1 5 7VOL-1-6 1 6 8VOL-1-7 1 7 9VOL-1-9 1 9 10VOL-1-49 1 49 11VOL-1-50 1 50 12VOL-2-26 2 26 13VOL-11-1 11 3 14VOL-11-15 11 15 15VOL-11-11 11 30 16VOL-20-18 20 18
<---------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
here it is in your workbook
you need to use the helper column to sort by
select columns a:b sort by column b
I'm not at all suggesting that you can't have your data as you do but if entered into different columns you don't have to rely on formulae to manipulate your data entry so that it can be sorted into the order that you want. How you enter your data will determine how you must process it in order to get what you want out of it.
martindwilson has provided you an efficient formula that will give you a sortable version of your data in a helper column (msg #8)
This formula array entered with Ctrl + Shift + Enter in B2 and then copied down should take care of the data supplied and accommodate any VOL-1 or VOL-10 or VOL-whatever.
Then use as sort column as misrasomendra has done. (Workbook Post #2)
Formula:
Please Login or Register to view this content.
Hope this helps.
Last edited by FlameRetired; 10-27-2014 at 01:09 AM. Reason: clarified
@ FlameRetired how would that sort this ?
VOL-2-1
VOL-1-1
VOL-33-11
VOL-4-11
thanks newdoverman for the suggestion and explanation.have a nice day.
Thank you for the feedback.
Have a nice day too.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks