Mastering Logical Functions in Excel
Learn how to use IF, AND, and OR functions in Excel to make logical decisions within your formulas. Includes nested IF examples and practical exercises. Sources: Excel user guides and online resources.
Mastering Logical Functions in Excel
E N D
Presentation Transcript
Anglicky v odborných předmětech"Support ofteachingtechnicalsubjects in English“ Tutorial: Obchodní akademie Topic: LogicalFunctions Prepared by: Mgr. Zdeněk Hrdina Projekt Anglicky v odborných předmětech, CZ.1.07/1.3.09/04.0002 je spolufinancován Evropským sociálním fondem a státním rozpočtem České republiky.
IF function • Allows to adddecisionmakingintoformulas • IF(condition, yes, no) • condition– anyvalueorexpressionthatcanhavethelogicalvalues TRUE or FALSE • yes – valuereturned by thefunctioniftheconditionevaluates to TRUE • no - valuereturned by thefunctioniftheconditionevaluates to FALSE
Examplesofconditions • comparisonwith a reference: e.g. A1>C3 • comparisonwith a numericvalue: e.g. A1>3 • comparisonwith a text string: e.g. A1="bank" (text stringsneed to beenclosed in quotationmarks) • comparisonwith a dateortime: Wecannot use a simple comparison as in A1="1.1.2010" A1=VALUE("1.1.2011") A1=DATE(2011;1;1) It is possible to use a comparison with a reference to a cell with a date
Nestingmultiple IF functions • Thetypicalusageofthe IF functioniswhenthere are onlytwopossiblesituations (condition met x condition not met) • Ifthere are more possiblesituations (3 and more), itispossible to use nested IF functions (startingwith Excel 2007 youcan use up to 63 nested IF functions)
AND function • Itisusedwhenthere are multipleconditionswhichneed to be met atthesametime • AND(condition1, condition2,…) • condition1 - anyvalueorexpressionthatcanhavethelogicalvalues TRUE or FALSE • up to 255 conditionscanbeused • Theresultofthefunctionis TRUE ifalltheconditions are met atthesametime, ifat least oneconditionevaluates to FALSE, theresultofthefunctionis FALSE
OR function • Itisusedwhenthere are multipleconditions, and itisenoughifonlyoneofthemis met • OR(condition1, condition2,…) • condititon1 - anyvalueorexpressionthatcanhavethelogicalvalues TRUE or FALSE • Theresultofthefunctionis TRUE ifat least oneconditionis met, if no conditionis met, theresultofthefunctionis FALSE
Combining IF, AND, OR • Example 1: weneed to determinewhetherthevalue in cell A1 is in the interval from 10 to 20 Example 2:if the value in cell A1 is equal to Praha or Brno, the result should be “city”, otherwise “town”
Exercise • Solvethegiventask. • zadání.xlsx
Sources • BARILLA, Jiří, Pavel SIMR a Květuše SÝKOROVÁ. Microsoft Excel 2010: Podrobná uživatelská příručka. Brno: ComputerPress, 2010. ISBN 978-80-251-3077-3. • WALKENBACH, John. Microsoft Excel - vzorce a funkce. Praha: Mobil Media a.s., 2001. ISBN 80-86593-01-0. • Microsoft Office. MS EXCEL Funkce - Logické [online]. 2010-01-01 [2011-12-30]. <http://office.lasakovi.com/excel/funkce/ms-excel-funkce-logicke/>