AFC - Abacus Formula Compiler for Java

Booleans In AFC

Boolean Functions

The supported boolean values and functions, shown by example (note that the functions AND and OR are range functions):

Constant Values
ABC
2true=true
3false=false
4true=C4true
5false...false

SEJ treats booleans as numbers
ABC
7true=(C7 = 0.0)falseExcel says: false
8true=(C8 = 1.0)trueExcel says: false

NOT
ABCD
10false=NOT( C10 )true
11true...false
12false=NOT( (C12 <> D12) )10.020.0
13false...50.040.0
14true...50.050.0
15true=NOT( (C15 = D15) )10.020.0
16true...50.040.0
17false...50.050.0

AND
ABCDEF
19true=AND( C19, D19 )truetrue
20false...truefalse
21false...falsetrue
22false...falsefalse
23true=AND( (C23 = D23), (E23 = F23) )10.010.020.020.0
24false...5.010.020.020.0
25false...5.010.015.020.0
26false...10.010.015.020.0

OR
ABCDEF
28true=OR( C28, D28 )truetrue
29true...truefalse
30true...falsetrue
31false...falsefalse
32true=OR( (C32 = D32), (E32 = F32) )10.010.020.020.0
33true...5.010.020.020.0
34false...5.010.015.020.0
35true...10.010.015.020.0

Combinations, range arguments
ABCDE
37true=OR( AND( C37:D37 ), E37 )truetruetrue
38true...truetruefalse
39true...truefalsetrue
40false...truefalsefalse
41true...falsetruetrue
42false...falsetruefalse
43true...falsefalsetrue
44false...falsefalsefalse
46true=AND( OR( C46:D46 ), E46 )truetruetrue
47false...truetruefalse
48true...truefalsetrue
49false...truefalsefalse
50true...falsetruetrue
51false...falsetruefalse
52false...falsefalsetrue
53false...falsefalsefalse

IF Function

IF is supported for numeric and string return values, shown by example:

Constant condition
AB
2100.0=IF( true, 100.0, 10.0 )
310.0=IF( false, 100.0, 10.0 )

Reference condition
ABC
5100.0=IF( C5, 100.0, 10.0 )true
610.0...false

Return reference
ABCDE
8100.0=IF( C8, D8, E8 )true100.010.0
910.0...false100.010.0

Return expression
ABCDE
11110.0=IF( C11, (D11 + E11), (D11 - E11) )true100.010.0
1290.0...false100.010.0

Return string
ABCDE
14yes=IF( C14, D14, E14 )trueyesno
15no...falseyesno

Comparison condition
ABCD
1710.0=IF( (C17 > D17), 100.0, 10.0 )10.020.0
18100.0...50.040.0
1910.0...50.050.0
2010.0...AB
21100.0...A10.0
2210.0...10.0B
24100.0=IF( (C24 < D24), 100.0, 10.0 )10.020.0
2510.0...50.040.0
2610.0...50.050.0
27100.0...AB
2810.0...A10.0
29100.0...10.0B
3110.0=IF( (C31 >= D31), 100.0, 10.0 )10.020.0
32100.0...50.040.0
33100.0...50.050.0
3410.0...AB
35100.0...A10.0
3610.0...10.0B
38100.0=IF( (C38 <= D38), 100.0, 10.0 )10.020.0
3910.0...50.040.0
40100.0...50.050.0
41100.0...AB
4210.0...A10.0
43100.0...10.0B
4510.0=IF( (C45 = D45), 100.0, 10.0 )10.020.0
4610.0...50.040.0
47100.0...50.050.0
4810.0...AB
4910.0...A10.0
5010.0...10.0B
52100.0=IF( (C52 <> D52), 100.0, 10.0 )10.020.0
53100.0...50.040.0
5410.0...50.050.0
55100.0...AB
56100.0...A10.0
57100.0...10.0B

Boolean operator condition
ABCDEF
5910.0=IF( NOT( (C59 <> D59) ), 100.0, 10.0 )10.020.0
6010.0...50.040.0
61100.0...50.050.0
63100.0=IF( NOT( (C63 = D63) ), 100.0, 10.0 )10.020.0
64100.0...50.040.0
6510.0...50.050.0
67100.0=IF( AND( (C67 = D67), (E67 = F67) ), 100.0, 10.0 )10.010.020.020.0
6810.0...5.010.020.020.0
6910.0...5.010.015.020.0
7010.0...10.010.015.020.0
72100.0=IF( OR( (C72 = D72), (E72 = F72) ), 100.0, 10.0 )10.010.020.020.0
73100.0...5.010.020.020.0
7410.0...5.010.015.020.0
75100.0...10.010.015.020.0
77100.0=IF( OR( AND( C77:D77 ), E77 ), 100.0, 10.0 )truetruetrue
78100.0...truetruefalse
79100.0...truefalsetrue
8010.0...truefalsefalse
81100.0...falsetruetrue
8210.0...falsetruefalse
83100.0...falsefalsetrue
8410.0...falsefalsefalse
86100.0=IF( AND( OR( C86:D86 ), E86 ), 100.0, 10.0 )truetruetrue
8710.0...truetruefalse
88100.0...truefalsetrue
8910.0...truefalsefalse
90100.0...falsetruetrue
9110.0...falsetruefalse
9210.0...falsefalsetrue
9310.0...falsefalsefalse