I needed to sort a custom post type by the last word (i.e. last name) in the title and I found this great solution from 2013 that still works:
But if the person goes by a single name, for example Banksy, then it appears at the very top but it should appear with the B names. I don't fully understand how the $orderby_statement code works but need to figure out how to set it so that if no ' ' space is found then use the first letter instead?
Ok, I've updated this function. It now works to correctly alphabetize by last word in title but also even if there is only one word.
function posts_orderby_lastname ($orderby_statement)
{
$orderby_statement = "RIGHT(post_title, LOCATE(' ', CONCAT(REVERSE(post_title), ' ')) - 1) ASC";
return $orderby_statement;
}