Download presentation
Presentation is loading. Please wait.
1
Logic Function Review
2
Purpose of using logical functions
To establish pre-defined conditions with pre- defined results in a worksheet. Examples: IF sales > $1000, then commission = 10% of sales, else commission = 5% of sales. IF current balance < $500, then credit approval is TRUE, else credit approval is FALSE. IF current balance < $500 or credit rating is good, then credit approval is TRUE, else credit approval is FALSE. IF credit rating type 1 is good and credit rating type 2 is good, then credit approval is TRUE, else credit approval is FALSE.
3
Current Past Due Balance
Sample sheet for class presentation Accounts Receivable Department - Customer Credit Analysis Customer Name Current Credit Limit First Purchase Date Previous Year's Sales Current Year's Sales Current Past Due Balance D&B Appraisal (1 Best) D&B PAYDEX (100 Best) D&B Risk Class Athletic Gear Corp. $ 9,000 5/15/2001 $ ,382 $ 11,952 $ 4 15 A3 Baltimore O's 30,000 12/19/1998 10,033 7,789 - 1 51 A2 Baseball & More 20,000 6/21/2008 60,009 55,342 5000 2 70 B1 Canadian Ski Club 9/13/2011 35,039 50,921 1,500 43 Concord Pro Shop 10/15/2011 1,925 91 A1 Everything Golf 25,000 10/6/2000 15,221 9,483 2,899 3 76 Lake Pro Shops 45,000 4/17/2005 80,498 81,126 87 Mars Dept. Store 27,000 1/16/2009 35,354 20,666 94 RG Bradley 7/8/2007 90,970 18,343 10,000 21 RX for Sports 15,000 8/14/2010 5,663 3,014 775 59 B2 School Sports Supply 6/3/1999 50,278 32,338 4,000 Ski World 3/4/2000 25,864 28,154 82
4
Overall structure of logical conditions
IF relational condition THEN do something ELSE do something else These types of logical computer decisions are black and white right or wrong – there is no “gray” area.
5
Determining a company’s credit worthiness, true or false?
Example of boolean logical condition Determining a company’s credit worthiness, true or false? IF Dunn & Bradstreet appraisal <= 2 THEN TRUE in evaluation column ELSE FALSE in evaluation column Write the Excel statement:
6
Using Relational Operators
7
Boolean functions To determine if the relational condition is TRUE or FALSE Can be used to compare values, text labels, dates Implemented in Excel by starting a formula and using a relational operator: =B4 * .1 > B5 =B4 < B5
8
Compound Boolean Logical Functions
AND Used to determine if all conditions are TRUE OR Used to determine if any condition is TRUE
9
Determining a company’s credit worthiness, true or false?
Example of compound boolean logical condition Determining a company’s credit worthiness, true or false? IF D&B appraisal <= 2 AND past due balance <= 0 THEN TRUE in evaluation column ELSE FALSE in evaluation column Write the Excel statement:
10
Determining a company’s credit worthiness, true or false?
Example of compound boolean logical condition Determining a company’s credit worthiness, true or false? IF D&B appraisal <= 2 OR past due balance <= 0 THEN TRUE in evaluation column ELSE FALSE in evaluation column Write the Excel statement:
11
More ANDs and ORs Write the Excel statements:
Result is still always either “TRUE” or “FALSE” Create 4 different rules: D&B Appraisal of at least 2 No past due balance D&B PAYDEX of at least 70 D&B risk class of A1 Final rule 1 checks to see if they are all true Final rule 2 checks to see if any of the rules are true. Write the Excel statements:
12
IF Function Review IF function
Boolean logical function that returns different values other than simply TRUE or FALSE depending on the specified condition. Can be single, compound or nested.
13
Determining whether sales are going up or down
Example of single logical condition Determining whether sales are going up or down IF Current year’s sales > previous year’s sales THEN “sales going up” in evaluation column ELSE “sales going down” in evaluation column Write the Excel statement:
14
Determining credit worthiness
Example of compound logical condition Determining credit worthiness IF D&B appraisal is 1 or 2, and D&B PAYDEX is higher than 70 and D&B risk class is A1 THEN “good risk” in evaluation column ELSE “bad risk” in evaluation column Write the Excel statement:
15
Think about more complex conditions…
D&B Appraisal D&B PAYDEX D&B Risk Class Credit worthiness? 1 Anything Good risk 2 > 80 < = 80 A1 not A1 Bad risk >2
16
Determining credit worthiness revisited
Example of nested logical condition Determining credit worthiness revisited IF D&B appraisal is 1 THEN “good risk” in evaluation column ELSE IF D&B appraisal is 2 IF D&B PAYDEX > 80 IF D&B risk class = 1 “bad risk” in evaluation column
17
Nested IF statements are complex
The IF statement for the nested IF looks like this: =IF(G4=1,"good risk",IF(G4=2,IF(H4>80,"good risk",IF(I4=A1,"good risk","bad risk")),"bad risk")) Let’s split it into pieces: =IF(G4=1,"good risk",IF(G4=2,IF(H4>80,"good risk",IF(I4=A1,"good risk","bad risk")),"bad risk"))
18
Practice nested IF on something new!
Let’s say that we want to calculate a “graduated” finance charge based on the following table: Field Condition Finance Charge Past due balance > $5000 12% of total past due > 3000 and <= 5000 10% of total past due > 1000 and <= 3000 8% of total past due <= 1000 2% of total past due
19
Translate specifications into IF/THEN/ELSE
IF past due balance > 5000 THEN finance charge = .12 * past due balance ELSE IF past due balance > 3000 THEN finance charge = .10 * past due balance IF past due balance > 1000 THEN finance charge = .08 * past due balance THEN finance charge = .02 * past due balance
20
Make conditions easier with LOOKUP
Allows you to use tables of data to “look up” values and insert them in another worksheet location, or other worksheet. Lookup tables store data and organize it into categories for comparison. Can be constructed for either an exact match or a range match.
21
Using VLOOKUP for an exact match
Searches a lookup table and based on the value used for comparison, retrieves a matching value from the lookup table. Let’s use the D&B Risk Class for a vertical lookup table. If the D&B Risk Class is A1, A2 or B1, then it is a good risk. Syntax of exact match VLOOKUP: VLOOKUP(comparison value to lookup, table, column of result, FALSE)
22
Using VLOOKUP for a range match
Searches a lookup table and based on the value used for comparison, retrieves a value from the lookup table using >= logic Let’s use the finance charge example from slide #19 Syntax of range match VLOOKUP: VLOOKUP(comparison value to lookup, table, column of result, TRUE)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.