0% found this document useful (0 votes)
15 views

Conditional Calculations With Excel Formulas AND Shortcut Keys

This document discusses how to use conditional logic and formulas in Excel to evaluate criteria and return results. It covers logical tests like AND and OR, functions like SUMIFS, COUNTIFS and AVERAGEIFS that allow multiple criteria, and other functions like IF, IS, and BETWEEN that enable conditional calculations.

Uploaded by

gslidesss123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Conditional Calculations With Excel Formulas AND Shortcut Keys

This document discusses how to use conditional logic and formulas in Excel to evaluate criteria and return results. It covers logical tests like AND and OR, functions like SUMIFS, COUNTIFS and AVERAGEIFS that allow multiple criteria, and other functions like IF, IS, and BETWEEN that enable conditional calculations.

Uploaded by

gslidesss123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Conditional Calculations with Excel Formulas: AND & OR Criteria

Table of Contents
Comparative Operators ............................................................................................................................................................1
Logical Tests ..............................................................................................................................................................................1
AND Logical Test (AND Criteria) ................................................................................................................................................2
AND function ............................................................................................................................................................................2
SUMIFS, COUNTIFS, AVERAGEIFS functions with AND Criteria ................................................................................................3
BETWEEN Logical Test ..............................................................................................................................................................3
OR Logical Test (OR Criteria) .....................................................................................................................................................4
OR function ...............................................................................................................................................................................5
OR Criteria looking at one column using SUMIFS and COUNTIFS ............................................................................................5
Average calculation with OR Criteria: AVERAGE & Array Formula (for 1 or more columns) ...................................................6
IF Function ................................................................................................................................................................................8
IS functions ...............................................................................................................................................................................8
Defined Name Scope ................................................................................................................................................................9
Cumulative List of Keyboards Throughout Class: .....................................................................................................................9

Comparative Operators
= Equal: are two things equal?

<> Not: are two things not equal? Type less than symbol, then greater than symbol.

> Greater than: is the thing on the left greater than the thing on the right?

>= Greater than or equal to: is thing on the left greater than or equal to thing on the right?

< Less than: is the thing on the left less than the thing on the right?

<= Less than or equal to: is the thing on the left less than or equal to the thing on the right?
Logical Tests
1) A Logical Test is a test that evaluates to TRUE or FALSE.
2) Logical Tests have only two possible answers: TRUE or FALSE.
3) Examples of Logical Tests:
Single Logical Tests:
1. 12=12, this evaluates to TRUE

Page 1 of 11
2. “Dog”=”Dog” , this evaluates to TRUE
3. 500>=500, this evaluates to TRUE
4. 11=12, this evaluates to FALSE
5. “Cat”=”Dog” , this evaluates to FALSE
6. 499.99>=500, this evaluates to FALSE Array Formula Logical Tests:
1. A16:A22=E16, this evaluates to {TRUE;TRUE;FALSE;FALSE;TRUE;TRUE;FALSE}
2. (A16:A22=E16)+(B16:B22=F16) ➔
{TRUE;TRUE;FALSE;FALSE;TRUE;TRUE;FALSE}+{TRUE;FALSE;FALSE;TRUE;FALSE;FALSE;FAL
SE}➔ {2;1;0;1;1;1;0} (Plus means OR Logical Test)
3. (A16:A22=E16)*(B16:B22=F16) ➔
{TRUE;TRUE;FALSE;FALSE;TRUE;TRUE;FALSE}*{TRUE;FALSE;FALSE;TRUE;FALSE;FALSE;FAL
SE}➔ {1;0;0;0;0;0;0} (Multiplication means AND Logical Test)

AND Logical Test (AND Criteria)


1) AND Logical Test (using AND Criteria):
• The Goal of an AND Logical Test is to run two or more logical tests and see if ALL logical tests
evaluate to TRUE.
• Think of: “If you take out the garbage AND clean the table, you get desert”. Only if you get two
TRUEs (took out garbage AND cleaned the table) do you get desert.
• For an AND Logical Test with two tests we can get these possible answers:
1. TRUE, FALSE
2. FALSE, TRUE
3. FALSE, FALSE
4. TRUE, TRUE.
• Only #4 example (TRUE, TRUE) will yield a TRUE from the AND Logical Test.
• For an AND Logical Test to evaluate to TRUE, you must get "All Are TRUE".

• Functions that can perform AND Logical Tests:


1. AND function
2. SUMIFS, COUNTIFS, AVERAGEIFS and other similar functions (default behavior when you
use more than one criteria_range and more than on criteria)
3. D Functions: AND Criteria goes on same row.
4. IF function
i. You can use the AND function in the logical_test argument to deliver
a single TRUE or FALSE.
ii. If you are creating array formulas:
1. You can nest multiple IF functions or
2. Multiply Arrays with TRUEs and FALSEs
(Multiplication means AND)

AND function
1) Performs AND Logical Test.
2) Enter 2 or more logical tests into AND function separated by commas.
AND interprets:

Page 2 of 11
1. Any non-zero number and TRUE as TRUE.
2. Zero and FALSE as FALSE.
3) AND function delivers a TRUE only when all logical tests evaluate to TRUE. Example:

SUMIFS, COUNTIFS, AVERAGEIFS functions with AND Criteria


1) If we enter more than one criteria_range argument and more than one criteria argument into SUMIFS,
COUNTIFS or AVERAGEIFS we are performing an AND Logical Test with AND Criteria.
2) Example of AND Logical Test with AND Criteria:
• Each of the functions below have 3 ranges in criteria_range argument (Region, SalesRep,
Product) and 3 criteria in criteria argument (South, Gigi, DAB Item).

• Only when a record is found with Region = South AND SalesRep = Gigi AND Product = DAB Item,
will the record be included in calculation.

BETWEEN Logical Test


1) BETWEEN Logical Test is a form of AND Logical Test that has an upper and lower
limit.
2) Only items that are between the upper and lower limit are included. 3) Example 1:

Page 3 of 11
4) Example 2:
EOMONTH function calculates the end of a given month.
-1 gives end of last month
0 gives end of this month
1 gives end of next month

5) Example 3: Count Number Sales between an Upper and Lower Limit

Count Between Upper & Lower


Limit:

1) COUNTIFS allows you


control over comparative
Operators.
2) FREQUENCY Array
Function dictates the
Comparative Operators
and categories (See Array
Formulas Handout #5).

OR Logical Test (OR Criteria)


1) OR Logical Test (using OR Criteria):
• The Goal of an OR Logical Test is to run two or more logical tests and see if at least one logical
tests evaluate to TRUE.
1. Think of: “If you take out the garbage OR clean the table, you get desert”.
i. If you take out the garbage, you get desert.
ii. If you clean the table, you get desert. iii. If you do neither, you do NOT get
desert.
iv. If you do both, you get desert.
• For an OR Logical Test with two tests we can get these possible answers:
1. TRUE, FALSE

Page 4 of 11
2. FALSE, TRUE
3. FALSE, FALSE 4. TRUE, TRUE.
i. #1, #2 and #4 will yield a TRUE from the OR Logical Test.
ii. #1, #2 and #4 each yield at least one TRUE.
• For an OR Logical Test to evaluate to TRUE, you must get "At Least One TRUE".
• Functions that can perform OR Logical Tests:
1. OR function
2. SUMIFS and COUNTIFS if you do a Function Argument Array Operation in the criteria
argument and the criteria are all in the same column.
i. For SUMIFS and COUNTIFS you can use the SUMPRODUCT function to add the
resultant array and avoid Ctrl + Shift + Enter.
3. D Functions (OR Criteria goes on different rows (lines).
4. IF function
i. You can use the OR function in the logical_test argument to deliver a single
TRUE or FALSE.
ii. If you are creating array formulas
1. Add Arrays with TRUEs and FALSEs (Adding means OR)

OR function
1) Performs OR Logical Test:
2) Enter 2 or more logical tests into OR function separated by commas.
OR interprets:
1. Any non-zero number and TRUE = TRUE.
2. Zero and FALSE = FALSE.
3) OR function delivers a TRUE when at least one of the logical tests evaluate to TRUE. Example:

OR Criteria looking at one column using SUMIFS and COUNTIFS


1) If we put multiple items into the criteria argument of SUMIFS or COUNTIFS we are:
Making a Function Argument Array Operation Performing OR Criteria on a single
column. 2) Example of OR Logical Test with OR Criteria:

Page 5 of 11
Average calculation with OR Criteria: AVERAGE & Array Formula (for 1 or more columns)
5) We can’t use AVERAGEIFS with a Function Argument Array Operation because the Resultant Array
delivers multiple averages that cannot then be used to calculate an average (for an average you must
have just one total in numerator and one count in denominator).
6) To calculate an average based on conditions or criteria, we can use the AVERAGE and IF functions and an
OR Logical Test Array Operation.

7) Example where OR Criteria is looking at one column:

8) How the OR Logical Test Array Operation calculates:


1. =AVERAGE(IF((A2:A6=D2)+(A2:A6=D3),B2:B6))
2. =AVERAGE(IF(({TRUE;FALSE;FALSE;TRUE;FALSE})+(A2:A6=D3),B2:B6))
3. =AVERAGE(IF(({TRUE;FALSE;FALSE;TRUE;FALSE})+({FALSE;TRUE;FALSE;FALSE;FALSE}),B2:B6))
i. Any math operation on TRUEs and FALSEs convert them to 1s and 0s.
4. =AVERAGE(IF({1;1;0;1;0},B2:B6))
i. Notice that we only get 0s or 1s because the question is asked of one column. ii.
The Resultant Array of 1s and 0s sits in the logical_test argument of the IF
function. The logical_test argument interprets any non-zero number as TRUE
and 0 as FALSE.
5. =AVERAGE({6279;9428;FALSE;6270;FALSE})
i. FALSE values “filter” out numbers we don’t want in AVERAGE function.
6. 7325.66666666667

9) Example where OR Criteria is looking at two columns (we have to worry about Double Counting):

Page 6 of 11
Page 7 of 11
IF Function
1) Use IF function to put one of two things into a cell or formulas:
• Two things can be:
1. Two Numbers.
2. Two Words (Text).
3. Two Formulas.
4. Two anything.
5. logical_test argument is where you put your Logical Test.
i. logical_test interprets:
1. Any non-zero number and TRUE as TRUE.
2. Zero and FALSE as FALSE. ii. logical_test can
contain:
1. Single logical test like: A1>=B3
2. An array operation like: A16:A22=E16
3. AND function
4. OR function
5. ISNUMBER function
6. ISTEXT function
7. Any other Logical Function
8. Cell references with TRUEs or FALSES or Numbers
9. Numbers
• value_if_true argument is what will go in cell if Logical Formula gets a TRUE.
• value_if_false argument is what will go in cell if Logical Formula gets a FALSE.
2) Rule for using IF when you have more than 2 things to put into a cell:
• As long as there are still more than 1 possibility left, keep adding more IFs to the value_if_false
argument.
• When there is only one option left, just put the last option into the value_if_false argument.
• At the end, keep typing "close parenthesis until you see the black one.

IS functions
1) IS Functions allow you to ask a question and get a TRUE or FALSE answer.
2) Types of questions that you ask with IS Functions:
• Is the value a Number?
• Is the value Text?
• Is the value a formula?
3) List of ISFUNCTIONS:
• ISNUMBER(value) Value refers to a number.
• ISTEXT(value) Value refers to text.
• ISBLANK(value) Value refers to an empty cell.
• ISERROR(value) Value refers to any error value.
• ISNA(value) Value refers to the #N/A error value.
• ISERR(value) Value refers to any error value except #N/A.
• ISNONTEXT(value) Value refers to any item that is not text.

Page 8 of 11
• ISLOGICAL(value) Value refers to a logical value.
• ISFORMULA(value) Value refers to a formula

Defined Name Scope


1) If you use the same name for a Defined Name on a different sheet, then:
• The first name used has a “Workbook Scope” and can be used and accessed on any sheet
• Any subsequent names used have a “Worksheet Scope” and can be accessed and used on
the sheet that they were created (If you want to use the Worksheet Defined Name on different sheet you
can place a sheet reference in from of it like: OR!COGS) 2) Example:

Cumulative List of Keyboards Throughout Class:


1) Esc Key:
i. Closes Backstage View (like Print Preview).
ii. Closes most dialog boxes.
iii. If you are in Edit mode in a Cell, Esc will revert back to what you had in the cell before you put the Cell
in Edit mode.
2) F2 Key = Puts formula in Edit Mode and shows the rainbow colored Range Finder.
3) SUM Function: Alt + =
4) Ctrl + Shift + Arrow = Highlight column (Current Region). 5) Ctrl + Backspace = Jumps back to Active Cell 6) Ctrl
+ Z = Undo.
7) Ctrl + Y = Undo the Undo.
8) Ctrl + C = Copy.

Page 9 of 11
9) Ctrl + X = Cut.
10) Ctrl + V = Paste.
11) Ctrl + PageDown =expose next sheet to right.
12) Ctrl + PageUp =expose next sheet to left.
13) Ctrl + 1 = Format Cells dialog box, or in a chart it opens Format Chart Element Task Pane.
14) Ctrl + Arrow: jumps to the bottom of the "Current Region", which means it jumps to the last cell that has data,
right before the first empty cell.
15) Ctrl + Home = Go to Cell A1.
16) Ctrl + End = Go to last cell used.
17) Alt keyboards are keys that you hit in succession. Alt keyboards are keyboards you can teach yourself by hitting
the Alt key and looking at the screen tips.
i. Create PivotTable dialog box: Alt, N, V ii.
Page Setup dialog box: Alt, P, S, P iii.
Keyboard to open Sort dialog box: Alt, D, S
18) ENTER = When you are in Edit Mode in a Cell, it will put thing in cell and move selected cell DOWN.
19) CTRL + ENTER = When you are in Edit Mode in a Cell, it will put thing in cell and keep cell selected.
20) TAB = When you are in Edit Mode in a Cell, it will put thing in cell and move selected cell RIGHT.
21) SHIFT + ENTER = When you are in Edit Mode in a Cell, it will put thing in cell and move selected cell UP.
22) SHIFT + TAB = When you are in Edit Mode in a Cell, it will put thing in cell and move selected cell LEFT.
23) Ctrl + T = Create Excel Table (with dynamic ranges) from a Proper Data Set.
i. Keyboard to name Excel Table: Alt, J, T, A
ii. Tab = Enter Raw Data into an Excel Table.
24) Ctrl + Shift + ~ ( ` ) = General Number Formatting Keyboard.
25) Ctrl + ; = Keyboard for hardcoding today's date.
26) Ctrl + Shift + ; = Keyboard for hardcoding current time.
27) Arrow Key = If you are making a formula, Arrow key will “hunt” for Cell Reference.
28) Ctrl + B = Bold the Font
29) Ctrl + * (on Number Pad) or Ctrl + Shift + 8 = Highlight Current Table.
30) Alt + Enter = Add Manual Line Break (Word Wrap)
31) Ctrl + P = Print dialog Backstage View and Print Preview
32) F4 Key = If you are in Edit mode while making a formula AND your cursor is touching a particular Cell Reference,
F4 key will toggle through the different Cell References:
i. A1 = Relative ii. $A$1 = Absolute or
“Locked” iii. A$1 = Mixed with Row Locked
(Relative as you copy across the columns AND
Locked as you copy down the rows)
iv. $A1 = Mixed with Column Locked (Relative as you copy down the rows AND Locked as you across the
columns)
33) Ctrl + Shift + 4 = Apply Currency Number Formatting
34) Tab key = When you are selecting a Function from the Function Drop-down list, you can select the function that
is highlighted in blue by using the Tab key.
35) F9 Key = To evaluate just a single part of formula while you are in edit mode, highlight part of formula and hit
the F9 key.
i. If you are creating an Array Constant in your formula: Hit F9.

Page 10 of 11
ii. If you are evaluating the formula element just to see what that part of the formula looks like,
REMEMBER: to Undo with Ctrl + Z.
36) Alt, E, A, A = Clear All (Content and Formatting)
37) Evaluate Formula One Step at a Time Keyboard: Alt, M, V
38) Keyboard to open Sort dialog box: Alt, D, S
39) Ctrl + Shift + L = Filter (or Alt, D, F, F) = Toggle key for Filter Drop-down Arrows
40) Ctrl + N = Open New File
41) F12 = Save As (Change File Name, Location, File Type)
42) Import Excel Table into Power Query Editor: Alt, A, P, T
43) Ctrl + 1 (When Chart element in selected): Open Task Pane for Chart Element
44) F4 Key = If you are in Edit mode while making a formula AND your cursor is touching a particular Cell Reference,
F4 key will toggle through the different Cell References:
i. A1 = Relative ii. $A$1 =
Absolute or “Locked”
iii. A$1 = Mixed with Row Locked (Relative as you copy across the columns AND Locked as you copy down
the rows)
iv. $A1 = Mixed with Column Locked (Relative as you copy down the rows AND Locked as you across the
columns)
45) Keyboard to open Scenario Manager = Alt, T, E

46) Ctrl + Tab = Toggle between Excel Workbook File Windows


47) Ctrl + Shift + F3 = Create Names From Selection
48) Ctrl + F3 = open Name Manager
49) F3 = Paste Name or List of Names
50) Alt + F4 = Close Active Window
51) Window Key + Up Arrow = Maximize Active Window
52) Ctrl + Shift + Enter = Keystroke to enter Array Formulas that: 1) have a function argument that requires it, or 2)
whether or not you are entering the Resultant Array into multiple cells simultaneously. 53) Ctrl + / = Highlight
current Array

Page 11 of 11

You might also like