Search code examples
sortingusability

Sort on last name, first name, or both?


I have a dilemma that I've encountered before. What's the best in terms of usability when one displays personal names in a table? Should there be a single column for the name? If so, is "firstname lastname" or "lastname, firstname" preferable? Or would a column for "firstname" and a column for "lastname" be best? I'm thinking in terms of the user's desire to sort the columns. I like having a column for each name component because I can imagine that in some cases the first name will be more important to the user whereas in other cases the last name would be more important.

I would assume that many out there have had this dilemma and am looking for pearls of wisdom based on past experience.


Solution

  • If you don't have the screen real estate to have a column for each part, you can combine them into a single string whose format represents the sorting order. Each click on the column header cycles to the next sort order. For example:

    Default: sort by last, first (ASC)

    Bimbleman, Wally P.
    Zonkenstein, Arnold Q.
    

    1st click: sort by last, first (DESC)

    Zonkenstein, Arnold Q.
    Bimbleman, Wally P.
    

    2nd click: sort by first, middle, last (ASC)

    Arnold Q. Zonkenstein
    Wally P. Bimbleman
    

    3rd click: sort by first, middle, last (DESC)

    Wally P. Bimbleman
    Arnold Q. Zonkenstein
    

    etc...

    Easier to read an entire name this way (vs. having it span across columns), takes up less screen real estate, and frees you from having to decide upon a single format & sort.