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.
The IF function is how to test values in spreadsheets. You can use it to simply test a value and show different results. But the key to making complex spreadsheets to learning more about the IF function. You can pass through values when a condition is met, combine conditions with AND and OR functions, and nest IF functions for more than two possible results.
When you filter rows in Numbers, any totals or other footer calculations will still be based on all of the rows, not just the ones visible. You can change that by using functions like SUMIF that match the filter. But then you need to adjust your formulas and filters every time so they are the same. However, you can use a hidden column and a single-cell separate table to make this quick, easy and useful.
When building Numbers spreadsheets it is important to remember that a row in a table is the equivalent to a record in a database. To build a billing system, you can put clients in one table and invoice items such as billable hours in another table. Then you can build a sheet with tables that use functions to populate an invoice. The requires some advanced functions like LOOKUP, INDEX, IF, AND, COUNTIF and more. But once you are done, you can easily add more records and create invoices.