When I try to sort my table using column 2 as the basis for sorting in descending order, I get a mixed up hodgepodge of numbers

When I try to sort my table using column 2 as the basis for sorting (in descending order), I get 99 through 52, then 5 , then 42 through 40, then 227 through 131, then 13. What I seek is 227 descending to 0 or at least 1 in regular numeric order. Am I doing something wrong?
(Libre Office 4.2.6-secfix, English, Writer
MAC OS x86-6, English)

First of all be assured sorting works. I sort often on an XP machine and sometimes on MacBookPro using in both cases LibO 4.2.6.2

I don’t know if you are using names for each column and if you have gaps in your table. Therefore what follows should be on the safe side to ensure it works for you as well.

Writer Table:

  • select the entire table
  • Table > sort > key 1 is checked by default > select column 2 > select key type: numeric > select order: descending > click OK

Calc Table:

  • select the entire table
  • Data > sort > sort key 1: select your 2nd column > select descending > click OK

If this doesn’t work, I assume you have a mismatch of formats, this means that some of the number you see are not only looking like number but are in text format. In this case, make sure that all number like looking cell contents are formated as numbers.

I also recommend to read the free of charge manual, which you can download from here: http://www.libreoffice.org/get-help/documentation/

Another check to perform, especially if you are sorting in Calc: Does the column you wish to sort by contain formulas?

If so, after sorting, the cells in the sorted column may end up pointing to different cells than they did before sorting which will then recalculate and the values in the sorted column will no longer be in the desired order.

Cheers,

John

@blindape - Excellent additional comment! Thanks!

@ROSt53
Thanks for the feedback.

While tables in Writer also support the same numeric formats Calc spreadsheets do, they do not apply a number recognition automatically in contrast. Thus input numbers are indeed treated as alphanumeric by default if not explicitly formatted otherwise (I don’t know a way to change that). As distinguished from sorting in spreadsheets (‘Data’ > ‘Sort…’) sorting in text tables (‘Table’ > ‘Sort’) will offer a choice to treat data either ‘Alphanumeric’ or ‘Numeric’. ‘Alphanumeric’ mode will always take the first character as most significant and therefore judge “51” greater than “499”. In ‘Numeric’ mode text table sorting will apply a type conversion into a standard numerical type in advance and therefore judge 499 > 51. This will even remain in effect if the forepart of the cell content being recognisable as numeric is followed by alphabetic characters (with or without space).

(As always with “Smart Features” there are more implications than mortals can imagine.)