J JE McGimpsey Aug 4, 2004 #3 True. The addition operator (+) and the subtraction operator (-) have the same precedence in XL, so they are evaluated stepwise left to right: =C10+C21+H10-H21 is equivalent to =(C10+C21)+H10-H21 is equivalent to =((C10+C21)+H10)-H21 To achieve your second example, you need to use parentheses. For more, see The order in which Microsoft Excel performs operations in formulas in XL Help.
True. The addition operator (+) and the subtraction operator (-) have the same precedence in XL, so they are evaluated stepwise left to right: =C10+C21+H10-H21 is equivalent to =(C10+C21)+H10-H21 is equivalent to =((C10+C21)+H10)-H21 To achieve your second example, you need to use parentheses. For more, see The order in which Microsoft Excel performs operations in formulas in XL Help.
H hgrove Aug 4, 2004 #4 JE McGimpsey wrote... True. The addition operator (+) and the subtraction operator (-) have the same precedence in XL, so they are evaluated stepwise left to right: Click to expand... Precedence (same for + and -) and associativity (left to right fo both) are not the same thing. =C10+C21+H10-H21 is equivalent to =(C10+C21)+H10-H21 is equivalent to =((C10+C21)+H10)-H21 Click to expand... So far so good. To achieve your second example, you need to use parentheses. Click to expand... ... Not quite. If the OP should be taken literally as wanting (C10+C21)-(H10+H21) as per then adding parentheses to C10+C21+H10-H21 to make C10+C21+(H10-H21) does not good. Replacing the third + with - would suffice. C10+C21-H10-H2
JE McGimpsey wrote... True. The addition operator (+) and the subtraction operator (-) have the same precedence in XL, so they are evaluated stepwise left to right: Click to expand... Precedence (same for + and -) and associativity (left to right fo both) are not the same thing. =C10+C21+H10-H21 is equivalent to =(C10+C21)+H10-H21 is equivalent to =((C10+C21)+H10)-H21 Click to expand... So far so good. To achieve your second example, you need to use parentheses. Click to expand... ... Not quite. If the OP should be taken literally as wanting (C10+C21)-(H10+H21) as per then adding parentheses to C10+C21+H10-H21 to make C10+C21+(H10-H21) does not good. Replacing the third + with - would suffice. C10+C21-H10-H2