Sorting numeric values similar to 1.1.1

  • Thread starter Thread starter Michel Dion
  • Start date Start date
M

Michel Dion

Does someone know how to properly sort numeric values that
look like this: 1.1.1, 1.1.2, 1.1.1.3, etc in Word.

I want these numbers to be sorted in the following order:
1.1.1
1.1.1.3
1.1.2

I'm not even sure it can be done in Word. Anybody out
there who knows how to do this?

I'm using Office XP.

Thanks.

Michel
 
Here is...
First, you have to "Trick" Word. Second... see the Before and After :)

Initial list:

1.2

1.1.1.1

1.1.4

1.2.1.1.1

1.1.1.1.4

1.3.3.4

1.2.3.3.4



Now go to Table menu - Sort.

Choose Paragraph, and type (here is the catch) - Text.



And you get this:



1.1.1.1

1.1.1.1.4

1.1.4

1.2

1.2.1.1.1

1.2.3.3.4

1.3.3.4




Why did I use text? Just because the list is not nimbers, not date... When
sorting as text, Word will use the ASCII codes of the text. And that will
make perfect sort, since the ASCII code of 2 is greather than the ASCII code
of 1 and so on.
 
Unfortunately this only works if you do not have 1.1.12.1
in your list of values to sort.

In this case, 1.1.12.1 would appear before 1.1.4 in the
list; and this is not what I want.

Michel
 
Hi Michel,

It still can be done:
-- Open the "Options" in the "Table > Sort" dialog,
-- Enter "." in "Separate fields at > Other",
-- Then sort once.
-- Now, "Field 1", "Field 2", "Field 3" will be available in "Sort by", and
the type will be "Number" (or if not, you can change it).

Regards,
Klaus
 
Hi Michel,

It still can be done:
-- Open the "Options" in the "Table > Sort" dialog,
-- Enter "." in "Separate fields at > Other",
-- Then sort once.
-- Now, "Field 1", "Field 2", "Field 3" will be available in "Sort by", and
the type will be "Number" (or if not, you can change it).

Regards,
Klaus

I have been playing with this interesting scheme and have found two
limitations. First, it doesn't work for me if there are more than
three fields, because Word does not keep pre-sort order for fields,
only for columns. Second, it doesn't work for "numbers" with variable
number of fields (e.g. heading numbers) because Word only offers as
many "field" choices as ALL the numbers have.

I have figured out a different scheme that seems to work in rather
general circumstances, at the cost of greater labor.

Copy the column containing the "number" and paste it as a separate
table. Convert this table to text with paragraph separator, and then
convert it to table with period separator. This will split the
"number" into separate columns. Add sufficient empty columns to the
original table and paste the number columns into the empty columns.
Now sort the table normally by the separated number columns. Now you
can delete the extra columns; the original "number" column is still
there. Given the potential for error in this many steps, you may want
to do this on a copy of the original table.

Bob S

test data

hs gn 1.01
sdfh g 1.1.1.4
cvb Cv 1.1.2.23
cvb xcns 1.1.12.1
gn zcv 1.1.1.3
zxfhgz xv 1.1.4
cvbncx zcvn 1
zfh zcv 1.12.23.11
cvbxcv cvb 1.2.111.12
zcfhs f 1.2.111.11
xcv xcvn 2.3.12.45
zcxvb xc 4.12.34.7
 
I had the same constrainst and therefore couldn't use the
other solutions. Your solution will work, at the expense
of additional efforts; but it's nothing compared to
sorting the table manually.

Thanks a lot.

Michel
 
Back
Top