Logical Functions: Turning Business Rules into Decisions

Logical Functions let you turn a business rule into a spreadsheet decision. You can flag an order for review, decide whether a fee applies, or assign a customer category. The essential skill is translating words such as “at least,” “both,” and “either” into precise tests. IF selects an output, AND and OR combine conditions, and nested IF formulas handle ordered decisions.

Turn a rule into a test

A logical test is an expression that evaluates to TRUE or FALSE. If B2 contains an order value in CAD, B2>=1000 tests whether that value is at least CAD 1,000. The comparison includes exactly CAD 1,000; B2>1000 excludes it.


Common comparison operators are = for equal to, <> for not equal to, > and < for strictly greater or less than, and >= and <= for comparisons that include the boundary.


IF uses the test to choose between two outputs:


=IF(logical_test,value_if_true,value_if_false)


For example, =IF(B2>=1000,"Review","Routine") returns Review when the order reaches the threshold and Routine otherwise. The three arguments are the test, the output when true, and the output when false. Outputs can be text, numbers, cell references, or calculations. Put literal text in double quotation marks; leave numbers and cell references unquoted.


A logical test branches to one result when true and another result when false.


These formulas use English function names and commas between arguments. Some regional settings use semicolons instead. Assume the input cells contain valid values of the stated type.

Combine conditions with AND and OR

Use AND(test1,test2) when every listed condition must be true. Use OR(test1,test2) when at least one condition must be true. Excel's OR includes the case where both conditions are true.


First test

Second test

AND returns

OR returns

TRUE

TRUE

TRUE

TRUE

TRUE

FALSE

FALSE

TRUE

FALSE

TRUE

FALSE

TRUE

FALSE

FALSE

FALSE

FALSE


Suppose a review requires both an order of at least CAD 1,000 and supervisor approval recorded as Yes in C2. The combined test is AND(B2>=1000,C2="Yes"). Place that test inside IF to return useful labels:


=IF(AND(B2>=1000,C2="Yes"),"Review","Routine")


Replacing AND with OR changes the policy: either condition would then be sufficient. AND and OR return logical values; the surrounding IF converts that result into the chosen business output.



Order decisions with nested IF

Nesting means placing one function inside another function's arguments. A nested IF can place another decision in the false branch of an earlier decision.


Suppose customer spending in B2 determines a tier: Gold for at least CAD 3,000, Silver for at least CAD 1,000 but below CAD 3,000, and Basic otherwise.


=IF(B2>=3000,"Gold",IF(B2>=1000,"Silver","Basic"))


First test the Gold threshold. If it is false, the remaining spending is below CAD 3,000, so the next test only needs to check the Silver minimum. Basic is the final fallback.



Check a formula using values below, exactly at, and above each threshold. For combined conditions, also check cases where only one condition is true. When one rule overrides another, put the overriding decision first in the nesting structure.


What to remember

  • IF selects between a true output and a false output.
  • AND requires every condition; OR requires at least one.
  • Comparison operators determine whether boundaries are included.
  • Nested IF formulas must preserve the intended decision priority.

Example: Routing a Wholesale Order

A wholesaler uses logical formulas to route orders. Row 2 contains these valid inputs:


Cell

Meaning

Value

B2

Order value in CAD

940

C2

All items in stock

Yes

D2

Requested delivery time in days

3


Use English function names and commas between arguments.


a) Orders worth at least CAD 700 require a review. Write a formula returning Review or Routine, and determine its output for row 2.


The phrase “at least” includes the threshold, so the logical test is B2>=700. Assign Review to the true output and Routine to the false output:


=IF(B2>=700,"Review","Routine")


Substitute the order value. CAD 940 is greater than or equal to CAD 700, so 940>=700 is ________. IF selects its true output. The result is Review.


b) An order qualifies for expedited handling when all items are in stock and at least one of these conditions holds: its value is at least CAD 1,300, or its requested delivery time is at most 3 days. Write a formula returning Expedite or Standard, and determine its output.


Stock availability is required, so it must be joined to the other requirement with AND. Within that other requirement, either the order-value condition or the delivery-time condition is sufficient, so join those alternatives with OR:


=IF(AND(C2="Yes",OR(B2>=1300,D2<=3)),"Expedite","Standard")


Evaluate each comparison using the supplied inputs:

  • C2="Yes" is ________ because all items are in stock.
  • B2>=1300 is ________ because CAD 940 is below CAD 1,300.
  • D2<=3 is ________ because the requested 3 days equals the allowed maximum of 3 days.

The inner result is OR(FALSE,TRUE), which is TRUE. The complete test is then AND(TRUE,TRUE), which is TRUE. IF returns Expedite. The lower order value does not prevent expedited handling because the delivery-time alternative is satisfied.


c) Assign a routing label based only on order value: Manager for at least CAD 2,800; Team for at least CAD 900 but below CAD 2,800; and Routine below CAD 900. Write a nested IF formula and determine its output.


Test the highest threshold first so that a Manager order is classified before reaching the lower threshold. Place the Team decision in the first IF's false branch:


=IF(B2>=2800,"Manager",IF(B2>=900,"Team","Routine"))


The first test is 940>=2800, which is ________. Follow the false branch to the nested IF. Its test is 940>=900, which is ________, so it returns Team. The final result is Team, consistent with CAD 940 lying between CAD 900 inclusive and CAD 2,800 exclusive.

A subscription spreadsheet stores completed membership duration in months in B2. B2 contains 12. What does the following formula return?


=IF(B2>=12,"Renewal","New")

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

A colleague is documenting the Excel formulas used in a business worksheet. Match each function or formula structure to its role in making a decision.

Match each term
A.

Returns TRUE only when every supplied condition is TRUE.

B.

Chooses between two supplied results according to whether a condition is TRUE or FALSE.

C.

Places one conditional choice inside another to create additional decision levels.

D.

Returns TRUE when at least one supplied condition is TRUE, including when several are TRUE.

IF

Nested IF

OR

AND

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

An online shop waives its delivery fee when an order is worth at least CAD 60 or the customer is a member. The fee is also waived when both conditions hold. B2 contains the numeric order value in CAD, and C2 contains Yes for a member or No otherwise.


Which formula implements this policy for every order?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Extra Practice