Numeric Operators In AFC
Arithmetic Operators
The supported numeric operators are shown by example below. The examples also show how operator precedence is taken into account.
Addition (+)
A | B | C | D | E | ||
2 | 3.0 | =(C2 + D2) | 1.0 | 2.0 | ||
3 | 12.0 | =((C3 + D3) + E3) | 5.0 | 4.0 | 3.0 | |
4 | 6.6 | ... | 1.1 | 2.2 | 3.3 |
Subtraction (-)
A | B | C | D | E | ||
6 | 2.0 | =(C6 - D6) | 3.0 | 1.0 | ||
7 | 1.0 | =((C7 - D7) - E7) | 5.0 | 3.0 | 1.0 | |
8 | -4.4 | ... | 1.1 | 2.2 | 3.3 |
Multiplication (*)
A | B | C | D | ||
10 | 35.0 | =(C10 * D10) | 5.0 | 7.0 | |
11 | 0.2 | ... | 0.4 | 0.5 |
Precedence (* before +)
A | B | C | D | E | ||
13 | 7.0 | =(C13 + (D13 * E13)) | 1.0 | 2.0 | 3.0 | |
14 | 9.0 | =((C14 + D14) * E14) | 1.0 | 2.0 | 3.0 |
Division (/)
A | B | C | D | E | ||
16 | 2.5 | =(C16 / D16) | 10.0 | 4.0 | ||
17 | 8.0 | =(C17 - (D17 / E17)) | 10.0 | 4.0 | 2.0 | |
18 | 7.0 | ... | 10.0 | 9.0 | 3.0 | |
19 | 9.666666666666666 | ... | 10.0 | 1.0 | 3.0 |
Division by zero
A | B | C | D | |||
20 | !+Inf/AE | =(C20 / D20) | 1.0 | 0.0 | Excel says: #DIV/0! |
Negation (-)
A | B | C | D | ||
22 | -10.0 | =(-C22) | 10.0 | ||
23 | -2.0 | =((-C23) - (-D23)) | 5.0 | 3.0 | |
24 | -1.0 | ... | -3.0 | -4.0 |
Percentage (%)
A | B | C | D | E | F | ||
26 | 0.15 | =(C26%) | 15.0 | ||||
27 | 5.13 | =((((C27 + D27)%) + E27) + (F27%)) | 3.0 | 4.0 | 5.0 | 6.0 | |
28 | 3.377 | ... | 1.1 | 2.2 | 3.3 | 4.4 |
Exponentiation (^)
A | B | C | D | E | F | G | ||
30 | 256.0 | =(C30 ^ D30) | 2.0 | 8.0 | ||||
31 | 24.0 | =((C31 ^ D31) + (E31 ^ (F31 + G31))) | 2.0 | 3.0 | 2.0 | 1.0 | 3.0 | |
32 | 1240.0 | ... | 4.0 | 5.0 | 6.0 | 2.0 | 1.0 |
Empty cells are 0
A | B | C | D | E | ||
34 | 1.0 | =((C34 + D34) - E34) | 1.0 | |||
35 | 17.0 | ... | 17.0 | |||
36 | -2.0 | ... | 2.0 | 4.0 | ||
37 | 0.0 | =(C37 * D37) | 3.0 |
Comparison Operators
These are operators that return a boolean value, which is either the number 1 (true) or 0 (false) internally, shown by example:
Equal (=)
A | B | C | D | ||
2 | false | =(C2 = D2) | 10.0 | 20.0 | |
3 | false | ... | 50.0 | 40.0 | |
4 | true | ... | 50.0 | 50.0 | |
5 | false | ... | 10.0 | ||
6 | false | ... | 10.0 | ||
7 | false | ... | -10.0 | ||
8 | false | ... | -10.0 |
Not equal (<>)
A | B | C | D | ||
10 | true | =(C10 <> D10) | 10.0 | 20.0 | |
11 | true | ... | 50.0 | 40.0 | |
12 | false | ... | 50.0 | 50.0 | |
13 | true | ... | 10.0 | ||
14 | true | ... | 10.0 | ||
15 | true | ... | -10.0 | ||
16 | true | ... | -10.0 |
Greater than (>)
A | B | C | D | ||
18 | false | =(C18 > D18) | 10.0 | 20.0 | |
19 | true | ... | 50.0 | 40.0 | |
20 | false | ... | 50.0 | 50.0 | |
21 | true | ... | 10.0 | ||
22 | false | ... | 10.0 | ||
23 | false | ... | -10.0 | ||
24 | true | ... | -10.0 |
Less than (<)
A | B | C | D | ||
26 | true | =(C26 < D26) | 10.0 | 20.0 | |
27 | false | ... | 50.0 | 40.0 | |
28 | false | ... | 50.0 | 50.0 | |
29 | false | ... | 10.0 | ||
30 | true | ... | 10.0 | ||
31 | true | ... | -10.0 | ||
32 | false | ... | -10.0 |
Greater or equal (>=)
A | B | C | D | ||
34 | false | =(C34 >= D34) | 10.0 | 20.0 | |
35 | true | ... | 50.0 | 40.0 | |
36 | true | ... | 50.0 | 50.0 | |
37 | true | ... | 10.0 | ||
38 | false | ... | 10.0 | ||
39 | false | ... | -10.0 | ||
40 | true | ... | -10.0 |
Less or equal (<=)
A | B | C | D | ||
42 | true | =(C42 <= D42) | 10.0 | 20.0 | |
43 | false | ... | 50.0 | 40.0 | |
44 | true | ... | 50.0 | 50.0 | |
45 | false | ... | 10.0 | ||
46 | true | ... | 10.0 | ||
47 | true | ... | -10.0 | ||
48 | false | ... | -10.0 |