Title: Problem with sorting
Last modified: September 13, 2021

---

# Problem with sorting

 *  Resolved [emyb](https://wordpress.org/support/users/emyb/)
 * (@emyb)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/problem-with-sorting-4/)
 * Hello,
 * I have a problem with your extension,
 * I have a column with numbers when I sort this column, the sorting is not done
   well, it is a column with a range of numbers,
 * From 280 – 350 the next line is 60 – 90, then 80 – 100, when it should be 280–
   350, 80 -100, 60 – 90 or vice versa (see screenshot : [https://zupimages.net/viewer.php?id=21/37/xmya.jpg](https://zupimages.net/viewer.php?id=21/37/xmya.jpg))
 * I hope you understand what I am trying to do
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fproblem-with-sorting-4%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/problem-with-sorting-4/#post-14865428)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * The cause for this is that these are not pure numbers, but ranges that are then
   interpreted as text strings. That’s because the sorting algorithm doesn’t know
   how to handle these: Should it maybe use the first or maybe the second number
   for the sorting? That’s why it falls back to string sorting, where the first 
   digit decides.
 * As an alternative, you could maybe use this approach: [https://wordpress.org/support/topic/date-order-6/](https://wordpress.org/support/topic/date-order-6/)
   
   This outlines the same problem (not with number ranges, but with images), but
   the solution is the same: You add a new hidden column which only has the number
   that shall be used for the sorting.
 * Regards,
    Tobias
 *  Thread Starter [emyb](https://wordpress.org/support/users/emyb/)
 * (@emyb)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/problem-with-sorting-4/#post-14866333)
 * Okay, thank you for your quick response!
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/problem-with-sorting-4/#post-14867370)
 * Hi,
 * no problem, you are very welcome! 🙂 Good to hear that this helped!
 * Best wishes,
    Tobias

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Problem with sorting’ is closed to new replies.

 * ![](https://ps.w.org/tablepress/assets/icon.svg?rev=3192944)
 * [TablePress - Tables in WordPress made easy](https://wordpress.org/plugins/tablepress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tablepress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tablepress/)
 * [Active Topics](https://wordpress.org/support/plugin/tablepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tablepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tablepress/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [4 years, 8 months ago](https://wordpress.org/support/topic/problem-with-sorting-4/#post-14867370)
 * Status: resolved