logic and excel
TRANSCRIPT
![Page 1: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/1.jpg)
Logic and Excel
AND
NOT
OR
IF
![Page 2: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/2.jpg)
Announcements
• We are at the mid point in the semester• Mid semester feedback surveys • Next few weeks will target quantitative
approaches to data analysis, reduction, and decision-making
![Page 3: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/3.jpg)
Logic and Excel
AND
NOT
OR
IF
![Page 4: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/4.jpg)
Poll QuestionI know a lot about logic and its usage in Excel.
A. Strongly agreeB. AgreeC. Don’t agree or disagreeD. DisagreeE. Strongly disagree
![Page 5: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/5.jpg)
Overview
• Logic– IF, AND, NOT, OR– COUNTIF, SUMIF, AVERAGEIF
• Truth Tables
![Page 6: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/6.jpg)
Logic: IF
• Identify conditions and determine actions
• Example: IF it is hot, I will wear beach attire to school. Otherwise, I will wear business casual attire.
IF
![Page 7: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/7.jpg)
Logic: AND
• Identify all conditions being true
• Example: If it is sunny AND hot, I will wear beach attire to school. Otherwise, I will wear business casual attire to school.
AND
![Page 8: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/8.jpg)
Logic: NOT
• Identify conditions not being true
• Example: If it is NOT cold, I will wear beach attire to school. Otherwise, I will wear business casual attire to school.
NOT
![Page 9: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/9.jpg)
Logic: OR
• Identify any condition being true
• Example: If it is sunny OR hot, I will wear beach attire to school. Otherwise, I will wear business casual attire to school.
OR
![Page 10: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/10.jpg)
Excel formulas and functions
• Formulas: equation used [with operators] to calculate a value– Operators: +, -, /, *, ^, >, <, =, >=, <=, <>, &– e.g. =A1+A3
• Functions: preprogrammed shortcuts for calculating equations– e.g. =sum(A1:A3)
![Page 11: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/11.jpg)
Poll QuestionFunctions are preprogrammed shortcuts for calculating equations.
A. TrueB. False
![Page 12: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/12.jpg)
Poll QuestionFormulas are equations used with operators to calculate values.
A. TrueB. False
![Page 13: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/13.jpg)
Practice problems
• How do you use the following with logical statements?– IF– AND– NOT– OR
• What is the difference between functions and formulas?
• What operators are used in Excel?
![Page 14: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/14.jpg)
Excel: IF function
• =IF(condition,value if true,value if false)• =IF(A1>=80,“hot”,“cool”)
![Page 15: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/15.jpg)
Excel logic
• Identify conditions and determine actions
• Example: IF it is hot, I will wear beach attire to school. Otherwise, I will wear business casual attire.
Let’s assume hot is 80 degrees or more
![Page 16: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/16.jpg)
Excel logic
• Identify conditions and determine actions
• Example: IF it is hot, I will wear beach attire to school. Otherwise, I will wear business casual attire.
B4: =IF(B2>=80, “beach attire”, “business casual attire”)
![Page 17: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/17.jpg)
Excel logic
• Identify conditions and determine actions
• Example: IF it is hot, I will wear beach attire to school. Otherwise, I will wear business casual attire.
B4: =IF(B2>=80, “beach attire”, “business casual attire”)
![Page 18: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/18.jpg)
Excel logic
• Identify conditions and determine actions
• Example: IF it is hot, I will wear beach attire to school. Otherwise, I will wear business casual attire.
B4: =IF(B2>=80, “beach attire”, “business casual attire”)
![Page 19: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/19.jpg)
Excel logic
• NOTE: B2>=80 (Hot)
Let’s assume hot is 80 degrees or more
![Page 20: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/20.jpg)
Excel logic
• B2>=80 (Hot)• B2>79 (Hot)• B2<80 (Cold)• B2<=79 (Cold)
Let’s assume hot is 80 degrees or more
![Page 21: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/21.jpg)
Excel logic
• Identify conditions and determine actions
• Example: IF it is hot, I will wear beach attire to school. Otherwise, I will wear business casual attire.
![Page 22: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/22.jpg)
Logic: AND
• Identify all conditions being true
• Example: If it is sunny AND hot, I will wear beach attire to school. Otherwise, I will wear business casual attire to school.
B4: =IF(AND(B3=“Sunny”,B2>=80), “beach attire”, “business casual attire”)
![Page 23: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/23.jpg)
Logic: AND
• Identify all conditions being true
• Example: If it is sunny AND hot, I will wear beach attire to school. Otherwise, I will wear business casual attire to school.
B4: =IF(AND(B3=“Sunny”,B2>=80), “beach attire”, “business casual attire”)
![Page 24: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/24.jpg)
Logic: NOT
• Identify conditions not being true
• Example: If it is NOT cold, I will wear beach attire to school. Otherwise, I will wear business casual attire to school.
B4: =IF(NOT(B2<80), “beach attire”, “business casual attire”)
![Page 25: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/25.jpg)
Logic: NOT
• Identify conditions not being true
• Example: If it is NOT cold, I will wear beach attire to school. Otherwise, I will wear business casual attire to school.
B4: =IF(NOT(B2<80), “beach attire”, “business casual attire”)
![Page 26: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/26.jpg)
Logic: OR
• Identify any condition being true
• Example: If it is sunny OR hot, I will wear beach attire to school. Otherwise, I will wear business casual attire to school.
B4: =IF(OR(B3=“Sunny”,B2>=80), “beach attire”, “business casual attire”)
![Page 27: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/27.jpg)
Logic: OR
• Identify any condition being true
• Example: If it is sunny OR hot, I will wear beach attire to school. Otherwise, I will wear business casual attire to school.
B4: =IF(OR(B3=“Sunny”,B2>=80), “beach attire”, “business casual attire”)
![Page 28: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/28.jpg)
Poll QuestionIf I eat more than 2000 calories, I will work out more. If not, no additional action is needed.
What function(s) can you enter into B4? A. =IF(B2>2000, “Work out more”, “no action needed”)B. =IF(B2>=2000, “Work out more”, “no action needed”)C. =IF(B2<2000, “no action needed”, “Work out more”)D. =IF(B2<=1999, “no action needed”, “Work out more”)E. Not enough information
![Page 29: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/29.jpg)
Poll QuestionIf I eat more calories than I burn, I will work out more. If not, no action is needed.
What function(s) can you enter into B4? A. =IF(B3>=B2, “no action needed”, “Work out more”)B. =IF(B2>B3, “Work out more”, “no action needed”)C. =IF(B3>B2, “no action needed”, “Work out more”)D. A and BE. B and CF. A and C
![Page 30: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/30.jpg)
What constitutes no action/work out more
• If I eat more calories than I burn, I will work out more. If not, no action is needed. – Calories eaten > calories burned [WO]– Calories eaten <= calories burned [NA]
WO=work outNA=no action
![Page 31: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/31.jpg)
What constitutes no action/work out more
• If I eat more calories than I burn, I will work out more. If not, no action is needed. – calories eaten > calories burned [WO]– calories burned < calories eaten [WO]– calories eaten <= calories burned [NA]– calories burned >= calories eaten [NA]
WO=work outNA=no action
![Page 32: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/32.jpg)
v
• If I eat more calories than I burn, I will work out more. If not, no action is needed.
A. B3>=B2 : calories burned >= calories eaten [NA]B. B2>B3 : calories eaten >calories burned [WO]C. B3>B2 : calories burned > calories eaten [NA]
![Page 33: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/33.jpg)
v
• If I eat more calories than I burn, I will work out more. If not, no action is needed.
A. B3>=B2 : calories burned >= calories eaten [NA]B. B2>B3 : calories eaten >calories burned [WO]C. B3>B2 : calories burned > calories eaten [NA]
calories eaten > calories burned [WO]calories burned < calories eaten [WO]calories eaten <= calories burned [NA]calories burned >= calories eaten [NA]
![Page 34: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/34.jpg)
• If I eat more calories than I burn, I will work out more. If not, no action is needed.
A. B3>=B2 : calories burned >= calories eaten [NA]B. B2>B3 : calories eaten >calories burned [WO]C. B3>B2 : calories burned > calories eaten [NA]
calories eaten > calories burned [WO]calories burned < calories eaten [WO]calories eaten <= calories burned [NA]calories burned >= calories eaten [NA]
![Page 35: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/35.jpg)
Poll QuestionIf I eat less than 2000 calories and burn more than 2000 calories, I will eat more. If not, no additional action is needed.
What function should you enter into B4? A. =IF(AND(B2>2000, B3<2000), “eat more”, “no additional action needed”)B. =IF(AND(B2<2000, B3>2000), “eat more”, “no additional action needed”)C. =IF(AND(B2<=2000, B3>=2000), “eat more”, “no additional action
needed”)D. =IF(NOT(B2<2000, B3>2000), “eat more”, “no additional action needed”)E. Cannot determine from information given
![Page 36: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/36.jpg)
Embedded IF
![Page 37: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/37.jpg)
Embedded IF
• Grades– A: 900 or higher– B: 800 to 899– C: 700 to 799– D: 600 to 699– F: 0-599
![Page 38: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/38.jpg)
Embedded IF
=IF(H2>=900,"A",IF(H2>=800,"B",IF(H2>=700,"C",IF(H2>=600,"D","F"))))
![Page 39: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/39.jpg)
Embedded IF
![Page 40: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/40.jpg)
Embedded IF
Or, we can use lookup functions to calculate grades.
![Page 41: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/41.jpg)
Other IF functions
• SUMIF: sum a range if criteria is met• COUNTIF: count a range if criteria is met• AVERAGEIF: average of a range if criteria is
met
![Page 42: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/42.jpg)
AVERAGEIF
![Page 43: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/43.jpg)
AVERAGEIF
Cell C13: =AVERAGEIF(B2:B11,"Teacher A",I2:I11)
![Page 44: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/44.jpg)
AVERAGEIF
Cell C13: =AVERAGEIF(B2:B11,"Teacher A",I2:I11)
What is the function in cell C14?
![Page 45: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/45.jpg)
Poll QuestionWhat is the function used in cell C14 to calculate average total score for teacher B?
A. =AVERAGEIF(I2:I11,"Teacher B", B2:B11) B. =IFAVERAGE(AVERAGEIF(I2:I11,"Teacher B", B2:B11) C. =AVERAGEIF(A2:A11,"Teacher B",I2:I11) D. =IFAVERAGE(B2:B11,"Teacher B",I2:I11)E. =AVERAGEIF(B2:B11,"Teacher B",I2:I11)
![Page 46: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/46.jpg)
COUNTIF
![Page 47: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/47.jpg)
COUNTIF
C16: =COUNTIF(J2:J11,"A")
![Page 48: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/48.jpg)
Poll QuestionIf I used the COUNTIF function to count grades in ICS 101 (A+ to F), how many possible grades exist?
A. 1B. 4C. 5D. 13E. 15
![Page 49: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/49.jpg)
Practice problems• How do the IF, AND, NOT, and OR functions work in Excel?
– What could you use these functions for in your checklist?– Hint: Do any of these functions help you to make a decision?– Example: Return rates and reverse logistics
• Use an embedded IF statement to calculate grades for ICS 101. Check the syllabus for the grade breakdown.– Hint: The embedded IF statement will be longer than the
example in this lecture due to the +/- scale.• What is the arguments list for SUMIF if it uses the same
arguments list as the COUNTIF and AVERAGEIF functions?• How do the COUNTIF, and AVERAGEIF functions work?
– What could you use these functions for in your checklist?– Hint: When do you want to search and conduct one of these
analyses?
![Page 50: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/50.jpg)
![Page 51: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/51.jpg)
XOR: Exclusive OR(Cats OR Dogs) AND NOT (Cats AND Dogs)
![Page 52: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/52.jpg)
Logic Symbols
Expression Meaning¬ x not x
x ∧ y x and yx ∨ y x or y
![Page 53: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/53.jpg)
Compound Logic
x ¬ x
FALSE TRUE
TRUE FALSE
x y x ∧ y
FALSE FALSE FALSE
FALSE TRUE FALSE
TRUE FALSE FALSE
TRUE TRUE TRUE
x y x ∨ y
FALSE FALSE FALSE
FALSE TRUE TRUE
TRUE FALSE TRUE
TRUE TRUE TRUE
![Page 54: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/54.jpg)
Truth TablesA quick way to understand the nature of a function, or to see if
two functions are equivalent (have the same truth values). Show every possible combination of the variables. Here is a truth table for XOR (the exclusive OR)*:
(x ∨ y) ∧ ¬ (x ∧ y)
![Page 55: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/55.jpg)
Truth TablesA quick way to understand the nature of a function, or to see if
two functions are equivalent (have the same truth values). Show every possible combination of the variables. Here is a truth table for XOR (the exclusive OR)*:
x y (x ∨ y) (x ∧ y) ¬ (x ∧ y) (x ∨ y) ∧ ¬ (x ∧ y)
FALSE FALSE
FALSE TRUE
TRUE FALSE
TRUE TRUE
(x ∨ y) ∧ ¬ (x ∧ y)
![Page 56: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/56.jpg)
Truth TablesA quick way to understand the nature of a function, or to see if
two functions are equivalent (have the same truth values). Show every possible combination of the variables. Here is a truth table for XOR (the exclusive OR)*:
x y (x ∨ y) (x ∧ y) ¬ (x ∧ y) (x ∨ y) ∧ ¬ (x ∧ y)
FALSE FALSE FALSE
FALSE TRUE TRUE
TRUE FALSE TRUE
TRUE TRUE TRUE
(x ∨ y) ∧ ¬ (x ∧ y)
![Page 57: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/57.jpg)
Truth TablesA quick way to understand the nature of a function, or to see if
two functions are equivalent (have the same truth values). Show every possible combination of the variables. Here is a truth table for XOR (the exclusive OR)*:
x y (x ∨ y) (x ∧ y) ¬ (x ∧ y) (x ∨ y) ∧ ¬ (x ∧ y)
FALSE FALSE FALSE FALSE
FALSE TRUE TRUE FALSE
TRUE FALSE TRUE FALSE
TRUE TRUE TRUE TRUE
(x ∨ y) ∧ ¬ (x ∧ y)
![Page 58: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/58.jpg)
Truth TablesA quick way to understand the nature of a function, or to see if
two functions are equivalent (have the same truth values). Show every possible combination of the variables. Here is a truth table for XOR (the exclusive OR)*:
x y (x ∨ y) (x ∧ y) ¬ (x ∧ y) (x ∨ y) ∧ ¬ (x ∧ y)
FALSE FALSE FALSE FALSE TRUE
FALSE TRUE TRUE FALSE TRUE
TRUE FALSE TRUE FALSE TRUE
TRUE TRUE TRUE TRUE FALSE
(x ∨ y) ∧ ¬ (x ∧ y)
![Page 59: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/59.jpg)
Truth TablesA quick way to understand the nature of a function, or to see if
two functions are equivalent (have the same truth values). Show every possible combination of the variables. Here is a truth table for XOR (the exclusive OR)*:
x y (x ∨ y) (x ∧ y) ¬ (x ∧ y) (x ∨ y) ∧ ¬ (x ∧ y)
FALSE FALSE FALSE FALSE TRUE FALSE
FALSE TRUE TRUE FALSE TRUE TRUE
TRUE FALSE TRUE FALSE TRUE TRUE
TRUE TRUE TRUE TRUE FALSE FALSE
(x ∨ y) ∧ ¬ (x ∧ y)
![Page 60: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/60.jpg)
Live Practice
On a sheet of paper or on your computing device, draw a truth table for:
(x ∨ y) ∧ (¬ x ∨ ¬ y)
![Page 61: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/61.jpg)
In-class practice
Draw a truth table for:
(x ∨ y) ∧ (¬ x ∨ ¬ y)
x y (x ∨ y) ¬ x ¬ y (¬x ∨ ¬y) (x ∨ y) ∧ (¬ x ∨ ¬ y)
FALSE FALSE
FALSE TRUE
TRUE FALSE
TRUE TRUE
![Page 62: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/62.jpg)
Truth Tables
(x ∨ y) ∧ (¬ x ∨ ¬ y)
x y (x ∨ y) ¬ x ¬ y (¬x ∨ ¬y) (x ∨ y) ∧ (¬ x ∨ ¬ y)
FALSE FALSE FALSE TRUE TRUE TRUE FALSE
FALSE TRUE TRUE TRUE FALSE TRUE TRUE
TRUE FALSE TRUE FALSE TRUE TRUE TRUE
TRUE TRUE TRUE FALSE FALSE FALSE FALSE
![Page 63: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/63.jpg)
x y (x ∨ y) (x ∧ y) ¬ (x ∧ y) (x ∨ y) ∧ ¬ (x ∧ y)
FALSE FALSE FALSE FALSE TRUE FALSE
FALSE TRUE TRUE FALSE TRUE TRUE
TRUE FALSE TRUE FALSE TRUE TRUE
TRUE TRUE TRUE TRUE FALSE FALSE
(x ∨ y) ∧ (¬ x ∨ ¬ y)
(x ∨ y) ∧ ¬ (x ∧ y)
x y (x ∨ y) ¬ x ¬ y (¬x ∨ ¬y) (x ∨ y) ∧ (¬ x ∨ ¬ y)
FALSE FALSE FALSE TRUE TRUE TRUE FALSE
FALSE TRUE TRUE TRUE FALSE TRUE TRUE
TRUE FALSE TRUE FALSE TRUE TRUE TRUE
TRUE TRUE TRUE FALSE FALSE FALSE FALSE
![Page 64: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/64.jpg)
XOR: Exclusive OR(Cats OR Dogs) AND NOT (Cats AND Dogs) = (x ∨ y) ∧ ¬ (x ∧ y)
(Cats OR Dogs) AND (NOT Cats OR NOT Dogs) = (x ∨ y) ∧ (¬ x ∨ ¬ y)
![Page 65: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/65.jpg)
Cats OR Dogs ≠ (Cats OR Dogs) AND NOT (Cats AND Dogs)
![Page 66: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/66.jpg)
Hamilton Library Ground Floor, Courtesy of Sean Mosier
![Page 67: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/67.jpg)
Poll QuestionI find this sign to be ominous.
A. Strongly agreeB. AgreeC. Don’t agree or disagreeD. DisagreeE. Strongly disagree
![Page 68: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/68.jpg)
(Read OR Die) AND NOT (Read AND Die)
![Page 69: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/69.jpg)
Read OR Die
![Page 70: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/70.jpg)
Practice problems
• Given a logical statement can you create a truth table?
• Can you think of other logical statements that could be the equivalent of the exclusive or (XOR)?– Test it by creating a truth table
![Page 71: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/71.jpg)
On-line lecture
• Review logic and truth tables• Apply logic and truth tables to Excel• Practice using Excel.
![Page 72: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/72.jpg)
Reminders
• Reminders: – Plagiarism tutorial 2 will open soon
![Page 73: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/73.jpg)
It is the middle of the semester. Would you like a midterm surprise?
![Page 74: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/74.jpg)
We normally have the midterm exam around this time of the semester.
![Page 75: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/75.jpg)
Since we have an extra week of lecture, my teaching team and I decided to makethis week’s lecture quiz EXTRA CREDIT. The content is still required for the course, but the points you earn will be EC.
![Page 76: Logic and Excel](https://reader031.vdocuments.mx/reader031/viewer/2022013001/61cb0e697472b366eb48bbb9/html5/thumbnails/76.jpg)
Poll QuestionI learned a lot about logic and its usage in Excel.
A. Strongly agreeB. AgreeC. Don’t agree or disagreeD. DisagreeE. Strongly disagree