SUMIF() is great for adding different groups of numbers. See http://openoffice.blogs.com/openoffice/2009/08/using-sumif-in-openoffice-calc-spreadsheets-.html for more info on that function.
But let's say you want to add up one set of numbers in one case, and another if something else is true.
You can use IF to put together two SUMIFs. Here's a basic example.
You're putting together a template. Here's the example.
So you put together a function, IF K2 is PHP, then sum up the revenue for Bob; otherwise sum up the revenue for James.
Here's one with lines from the formula.
So you get this figure if it's PHP
And this if it's anything else.