Title: numerical sorting
Last modified: November 24, 2022

---

# numerical sorting

 *  Resolved [coopeh1](https://wordpress.org/support/users/coopeh1/)
 * (@coopeh1)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/numerical-sorting-4/)
 * I have a table with names and addresses. The address is made up of two columns
   within the table. One column (No.) lists the street number. The 2nd column lists
   the street name (StreetName). Because the street number column values are actually
   text the column does not sort as expected. example: 101 lists before 30.
    How
   do I make the street number column values numerical? Also how do I indicate a
   specific sort order of the two columns? Street name first then street number.
   I have tried to read the related articles but would appreciate some help.
 * Thanks

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

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/numerical-sorting-4/#post-16233204)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * This indicates that your column is not actually fully numeric. Can you please
   post a link to the page with the table where this problem happens, so that I 
   can take a direct look? Thanks!
 * Regards,
    Tobias
 *  Thread Starter [coopeh1](https://wordpress.org/support/users/coopeh1/)
 * (@coopeh1)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/numerical-sorting-4/#post-16234295)
 * [https://www.pineridgeingravenhurst.com/?page_id=15714&preview=true](https://www.pineridgeingravenhurst.com/?page_id=15714&preview=true)
 * p/w resident
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/numerical-sorting-4/#post-16234407)
 * Hi,
 * thanks for the link.
 * I’m a bit confused though. I don’t see any sorting problems with the street numbers.
   What do I need to do in order to reproduce the issue?
 * Regards,
    Tobias
 *  Thread Starter [coopeh1](https://wordpress.org/support/users/coopeh1/)
 * (@coopeh1)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/numerical-sorting-4/#post-16234471)
 * I would like to sort the table by two columns: first by street name; then second
   sort by street number (2nd sort of the previous sort) so that the list looks 
   like the following:
 * 1 Spruce Rd
    2 Spruce Rd 3 Spruce Rd 5 Spruce Rd 11 Spruce Rd 127 Spruce Rd 2011
   Spruce Rd Not like the following:
 * 1 Spruce Rd
    11 Spruce Rd 127 Spruce Rd 2 Spruce Rd 2011 Spruce Rd 3 Spruce Rd
   5 Spruce Rd
 * Thanks for your help
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/numerical-sorting-4/#post-16234752)
 * Hi,
 * to achieve that, you can first sort by “StreetName” (by clicking on that) and
   then, while holding down the “Shift” key, click on “No.”.
 * To automatically get that sort order when the page with the table is opened, 
   you can add this to the “Custom Commands” text field on the table’s “Edit” screen:
 *     ```
       "order": [ [ 2, "asc" ], [ 1, "asc" ] ]
       ```
   
 * Regards,
    Tobias

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

The topic ‘numerical 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/)

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