The latest version of Numbers allows you to use regular expressions, also called regex, in formulas. Regex is very powerful if you can master it. You can use them to match patterns in text to perform otherwise difficult or impossible things in your spreadsheets.
If you have a list of names in Numbers it is very difficult to sort by last name unless you have the last name in a separate column. However, you can use a series of formulas to extract the last name and first name, format them properly as Last, First, and then sort them. It will take some extra effort to deal with middle names and initials as well. You can even get rare last names that include spaces to sort properly.