Conditional Calculations With Excel Formulas AND Shortcut Keys
Conditional Calculations With Excel Formulas AND Shortcut Keys
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 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:
• Only when a record is found with Region = South AND SalesRep = Gigi AND Product = DAB Item,
will the record be included in calculation.
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
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:
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.
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
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
Page 11 of 11