Professional Documents
Culture Documents
Logic: Boolean Algebra and The "If" Statement
Logic: Boolean Algebra and The "If" Statement
Logic: Boolean Algebra and The "If" Statement
Page 12 - 1
12
7:44
05/05/15
269039198.xls
OVERVIEW
Math operators <, >, =, <=, >=
Dog
3 unit
Fox
4 unit
Result
Christy
1 logic
=Dog<Fox
3 Dog(s) < 4 Fox(s)
IF statements
Result_2 More foxes
row 20
=IF(Result,"More foxes","More dogs")
formula
text
formula
=IF(quantity=1 , "1 Fox" , FIXED(quantity,0,TRUE) & " Foxes")
It could also return the result of a formula within the IF statement or reference a
result from outside of the statement and returned from within the IF statement.
A
1
B
More foxes
C
2 Foxes
Answer
More foxes
The equation using range names:
A
=Dog<Fox
a.
MIN( 1, 2, 3)
returns 2 if the 1 references
a logic result
b. MIN( 1*1, 2, 3)
returns 1 because the logic
result operates on another
number
B
=IF(Result,"More foxes","More dogs")
C
=IF(quantity=1,"1 Fox",FIXED(quantity,0,TRUE)&" Foxes")
=IF ( A, B, C_ )
PARK AND CONCATENATE
An equation can be easily parked and copied without changing the references.
The following example equations use numbers only.
Equation D
2
Press the [F2] edit key. Press the [Home] key to go to the front of the equation. Press the [Space Bar] to insert
a space and turn the equation into plain text. This yields:
=(1+1)
Equation E
4
converts to =(2+2)
Create this equation, = D +E , by concatenation.
=(1+1) +
Add the "+" operator
=(2+2)
now to keep the
process simple or add
it later if you forget.
Justify the range to create a text string on one row.
=(1+1) + =(2+2)
Figure 12-1 Concatenation with Justify command.
Now clean up the text by removing the = operator at mid-string and the space at the beginning of the string.
Equation F
6
Inserting a space or a comma in front of an equation also works well to put a malfunctioning equation on hold.
row 50
row 60
LOGIC
Page 12 - 2
12
Christy
7:44
05/05/15
269039198.xls
E
row 70
LOGIC
Page 12 - 3
12
Christy
7:44
05/05/15
269039198.xls
E
row 90
Figure 12-2 Adding a button to your tool bar in the Customize window.
RANGE NAMES IN EQUATIONS
Dogs
3 unit
Foxes
4 unit
Result
1 logic
Show the equation with its range names, not cell R1C1 references.
1
parked and copied from above
Press the [F2] key to edit the equation in the equation window.
row 100
row 120
LOGIC
Page 12 - 4
12
Christy
7:44
05/05/15
269039198.xls
row 130
THE LOGIC SIEVE, BOOLEAN ALGEBRA, and BOOLEAN OPERATORS
Here we use two Boolean expressions to yield a 1 or a 0 for A, BB, or BC.
If one criteria or the other isn't met (i.e. Number not< 2), then at least
one 0 is returned and B0*B0 or B0*B1 equals B0.
Three methods for creating a logic sieve are used in this example.
You may substitute numbers or formulas for A, B, and C in Example A.
Example A
Number
Input
A
B
C
1
1
1
Number <= 1
Number <= 2
Number <= 3
Choice
row 140
A
A
Example B
A
B
C
Choice
A
B
C
row 160
BOOLEAN TABLE
not A
A xor B
A=B
A<>B
A or B
A nor B
A nand B
A<B
A>B
A and B
1
1
0
0
1
0
1
0
0
0
1
0
0
1
0
0
1
0
0
1
0
1
1
0
1
0
0
0
1
1
1
0
0
0
1
1
0
1
1
1
0
0
0
1
T
T
F
F
T
F
T
F
0
0
1
0
0
1
0
0
1
0
0
1
0
1
1
0
1
0
0
0
1
1
1
0
0
0
1
1
0
1
1
1
0
0
0
1
row 180
LOGIC
Page 12 - 5
12
Christy
7:44
05/05/15
269039198.xls
E
row 190