How can I use multiple if statements in a calculation