Docsity

Excel Intermediate: Logical Functions and VLOOKUP, Summaries of Decision Making

Toggle sidebar
bg1
Microsoft Office | Intermediate Excel
Page 1 of 4 MSOfficeNutshell_Excel_LogcalLkup 10 April 2017
LOGICAL AND VLOOKUP FUNCTIONS
LOGICAL FUNCTIONS
Logical functions are used to create decision-making formulas. These functions can test whether or not a
certain condition exists within your spreadsheet and will prompt Excel to take specific actions based on the
results. Table 1 shows Excel’s logical functions. Logical and all other functions are built using arguments
(independent variables or inputs that alter the functions’ results).
Table 1. Logical Functions Used in Excel
Function
Description
Example
AND(logical1,logical2)
Checks whether all arguments are
TRUE, and returns TRUE if all
arguments are TRUE.
=AND(B2,A2)
FALSE()
Returns FALSE
The function takes no arguments.
=FALSE()
IF(logical_test,value_if_true,value_if_false)
Performs a logical test and returns
a value based on the result.
=IF(B8>B7,"Greater",
"Less than")
NOT(logical)
Changes FALSE to TRUE, or
TRUE to FALSE.
=NOT(B3)
OR(logical1,logical2…)
Checks whether any of the
arguments are TRUE, and returns
TRUE or FALSE. Returns FALSE
only if all arguments are FALSE.
=OR(A2=B2,A1=B1)
TRUE()
Returns TRUE
The function takes no arguments.
=TRUE()
IF FUNCTION
The IF function checks the logical condition of a statement and will return one value if true and a different
value if false. The syntax (i.e., the rules that specify how to correctly enter a function) of the IF FUNCTION is
IF(logical test, value if true, value if false)
The value returned may be either a number or text.
o If the value to be returned is text, it must be placed in quotes.
All IF functions include the following three components:
1. The logical test— A logical test is any value that can be determined to be TRUE or FALSE.
Commonly used logical tests include:
A=B A is equal to B
A>B A is greater than B
A<B A is less than B
A>=B A is greater than or equal to B
A<=B A is less than or equal to B
A<>B A is not equal to B
2. The result if the test is TRUE
3. The result if the test is FALSE
pf3
pf4

Partial preview of the text

Download Excel Intermediate: Logical Functions and VLOOKUP and more Summaries Decision Making in PDF only on Docsity!

LOGICAL AND VLOOKUP FUNCTIONS

LOGICAL FUNCTIONS

Logical functions are used to create decision-making formulas. These functions can test whether or not a certain condition exists within your spreadsheet and will prompt Excel to take specific actions based on the results. Table 1 shows Excel’s logical functions. Logical and all other functions are built using arguments (independent variables or inputs that alter the functions’ results). Table 1. Logical Functions Used in Excel Function Description Example AND( logical1,logical2) Checks whether all arguments are TRUE , and returns TRUE if all arguments are TRUE.

=AND(B2,A2)

FALSE() Returns FALSE The function takes no arguments.

=FALSE()

IF(logical_test,value_if_true,value_if_false) Performs a logical test and returns a value based on the result. =IF(B8>B7,"Greater", "Less than") NOT(logical) Changes FALSE to TRUE, or TRUE to FALSE.

=NOT(B3)

OR( logical1 , logical2 …) Checks whether any of the arguments are TRUE, and returns TRUE or FALSE. Returns FALSE only if all arguments are FALSE.

=OR(A2=B2,A1=B1)

TRUE() Returns TRUE The function takes no arguments.

=TRUE()

IF FUNCTION

The IF function checks the logical condition of a statement and will return one value if true and a different value if false. The syntax (i.e., the rules that specify how to correctly enter a function) of the IF FUNCTION is IF( logical test, value if true , value if false)  The value returned may be either a number or text. o If the value to be returned is text , it must be placed in quotes. All IF functions include the following three components:

  1. The logical test — A logical test is any value that can be determined to be TRUE or FALSE. Commonly used logical tests include: A=B A is equal to B A>B A is greater than B A<B A is less than B A>=B A is greater than or equal to B A<=B A is less than or equal to B A<>B A is not equal to B
  2. The result if the test is TRUE
  3. The result if the test is FALSE

The Logical Test If TRUE If FALSE =IF(A1>59,”Passed”,”Failed”) NESTED FUNCTIONS Another function can be used as an argument of an IF function as well as other Excel functions. For example, the AVERAGE and SUM functions are nested within the IF function in the example below: =IF(AVERAGE(B2:B5)>100,SUM(E2:E5),0) IF STATEMENTS PRACTICE EXERCISES

Instructions: Use the IF function to complete the following exercises.

  1. Open Excel and create the workbook below:
  2. Construct IF functions using the syntax =IF( logical test, value if true, value if false ) for the following scenarios and place the results in the specified columns. a. IF Statement 1 column– The number of cars sold in October by an individual salesperson is greater than 10 , the salesperson will receive a bonus (TRUE). If the number of cars sold by an individual salesperson is not greater than 10 (FALSE) , then the salesperson will receive no bonus. b. IF Statement 2 column– If the number of cars sold in October by an individual salesperson is greater than or equal to 10 , the salesperson will receive a $200 bonus (TRUE). If the number of cars sold by an individual salesperson is less than 10 (FALSE) , then the salesperson will receive “no bonus.” c. IF Statement 3 column– If the number of cars sold in October by an individual salesperson is greater than or equal to 10 , the salesperson will receive a $500 bonus (TRUE). If the number of cars sold by an individual salesperson is less than 10 (FALSE) , then the salesperson will receive $. The logical test must be answered either “TRUE” or “FALSE” Insert this value if the result is “TRUE” Insert this value if the result is “FALSE”

GUIDELINES FOR CREATING THE LOOKUP TABLE

A lookup table is a range of cells containing a table of values and text from which data can be retrieved. The table should contain the following:  At least two rows , not including headings.  At least two columns, not including headings.  If the values you want to look up are exact values , you can arrange the first column in any logical order.  If the values you want to look up are approximate values , you must arrange the data from the lowest to the highest value and include only the lowest value in the range instead of the complete range. The lowest value is known as the breakpoint. Grading Scale Grades Lookup Table Range Grade Range Grade 90 – 99 A 0 F 80 – 89 B 60 D 70 – 79 C 70 C 60 – 69 D 80 B Below 60 F 90 A

NESTED FUCNTIONS

Similarly to the IF function, you can nest functions as arguments inside the VLOOKUP function. For example, the figure below illustrates shipping amounts based on weight and location (Boston and Chicago). Typing the VLOOKUP function =VLOOKUP(A3,$E$3:$G$5,IF(B3="Boston",2,3)) in cell C3 will find the correct shipping cost for the package in cell A3. “The weight, 14 pounds, is compared to the data in the table array argument, which is $E$3:$G$5. To determine which column of the lookup table to use, an IF function is nested as the column_index_number argument. The nested IF function compares the city stored in cell B 3 to the text Boston. If cell B3 contains Boston, it returns 2 to use the column_index_number to identify the shipping value for a package that is going to Boston. If cell B3 does not contain Boston (i.e., the only other city in this example is Chicago), the column_index_number is 3” (Poatsy et al 2017, 513). Important! “When a nested function is used as an argument, the nested function must return the same type of value that the argument uses. For example, if the argument returns a TRUE or FALSE value, the nested function must return a TRUE or FALSE value”. SOURCES Klein, Mark. Microsoft Excel: Formulas and Functions : Lesson 5: Lookups, Charts, Statistics, and Pivot Tables. 2014. http://www.howtogeek.com/school/microsoft-excel-formulas-and-functions/lesson5/ (accessed November 9, 2016). Poatsy, Mary Anne, Keith Mulbery, Cynthia Krebs, Lynn Hogan, Eric Cameron, Jason Davidson, Linda K. Lau, Rebecca Lawson, and Jerri Williams. Microsoft Office 2016 Volume 1. Exploring Series, series editor Mary Anne Poatsy. Boston, MA: Pearson, 2017.