Can't get much simpler but you could try using one line and ignoring the variable sum completely, like so,
average = (number1 + number2)/2;
It is all about clarity. You can have different levels of clarity, which basically relates to how much you need to think about a line of code to figure out what it is doing.
Examples usually split things up to make things clearer, and in general clarity is something to keep in mind while writing code. Making a single line with too complicated a formula can make it much more difficult to fix or change later, particularly if someone else is trying to work with your code.