The SUMIF function is one of the most useful functions in Numbers. You can use it to calculate the total for each category when you have a list of numbers and categories. The best way to use it is to create a second table and use one column in that table as the comparison value.