Performing fields calculation using conditionals