How can this if else statement be simplified?

Printable View