Ron Mikhael Surara

Ron Mikhael Surara

Saturday, January 10, 2015

What I Learned in CompSci #28: Logical Operation

Logical Operation

3 Logical Operations

  • =AND(logical 1, logical 2,...)
  • =OR(logical 1, logical 2,...)
  • =NOT(logical)

Truth Table
AND

OR

NOT

IF Function
Returns a value if a condition if TRUE, and another if false
Syntax: =IF(*logical_test*,*value_if_true*,*value_if_false*)

Example

  • Single Range : =IF(AND(A1>0,A1<11),“Valid",“Invalid") 
  • Nested IF (exact value) : =IF(A1=1,“One", IF(A1=0,“Zero",”Invalid”))
  • Nested IF (ranges) : =IF(AND(A1>0,A1<11),“One to Ten", IF(AND(A1>11,A1<21), “Eleven to Twenty",“Invalid"))


Reference: http://moodle.pshs-brc.edu.ph/pluginfile.php/4800/mod_resource/content/0/Logical%20Operation.pdf
http://moodle.pshs-brc.edu.ph/pluginfile.php/4818/mod_resource/content/0/IF.pdf