Absolute Referencing
Absolute referencing is marked by a dollar sign ($). For example, =$A$10 has absolute referencing for both the column and the row value
Relative references (which is what you normally do, e.g. “=A10”) will change anytime the formula is copied and pasted. They are in relation to where the referenced cell is located. For example if you copied “=A10” to the cell to the right it would become “=B10”. With absolute referencing “=$A$10” copied to the cell to the right would remain “=$A$10”. But if you copied $A10 to the cell below, it would change to $A11 because the row value isn’t an absolute reference.
Absolute references will not change when you copy and paste the formula in a different cell. The cell being referenced is always the same.
To easily switch between absolute and relative referencing in the formula bar, highlight the reference you want to change and press the F4 key; for example, if you want to change the absolute reference, $A$10, in your formula to a relative reference, A10, highlight $A$10 in the formula bar and then press the F4 key to make the change.
COUNTIF()
COUNTIF() is a formula and a function. This means the function runs based on criteria set by the formula.
COUNTIF returns a value based on a condition that the data range is evaluated for. The function counts the number of cells that meet the criteria.
Syntax:
=COUNTIF(range, “criterion”)
OR
if you have more than one tab in a Google Sheets spreadsheet:
=COUNTIF(‘tab_name’!range, “criterion”)
Range: A1:A16
Criterion: can be a text string or a number.
Examples:
Use =COUNTIF(A1:A16, “7”) to count only the cells in the range of A1:A7 that contained the number 7.
Output: 3. There were 3 sevens in that range.
Use =COUNTIF(‘raw_data’!G:G, A2) to count all cells in column G of the raw data tab of the spreadsheet that match the value in cell reference A2.
Other Examples:
=COUNTIF(A2:A9, “Taxi”)
=COUNTIF(B2:B9, “>=10”)
=COUNTIF(B2:B9, “>=”&B22)
=COUNTIF(A2:A9, “G*”)
To avoid a divide by 0 error
To do this, click on the cell with the error and then enter this function in the fx box: IFERROR(B4/A4, “Not applicable”)
(You’ll need to enter the correct cells; B4 and A4 are just filler cells for this example.)
Copy this formula to apply it to other cells in the column so other divide by errors are avoided.
N/A
Data in a formula can’t be found by the spreadsheet. (Often this means the data doesn’t exist. This error most often occurs when you use
Functions like VLOOKUP)
VLOOKUP: searches for a certain value in a column to return a corresponding piece of information.
For example, if get an #N/A error and hover over the problematic cell, you may get a message like: “Did not find the value ‘Almond’ in VLOOKUP evaluation. In this case, ‘Almond’ needs to be changed to ‘Almonds’ and then the formula will work.
NAME?
A formula or function name that isn’t understood
NUM!
A formula or function calculation can’t be performed as specified.
For example, we would get a #NUM! error if the end date came before the start date in a DATEDIFF function.
DATEDIFF function
Use to calculate duration, e.g., number of months between the start and end dates of a project.
Syntax:
=DATEDIFF(start_date, end_date, “unit”)
Example:
=DATEDIFF(B6, C6, “M”)
units:
“D”: the number of days between the start & end dates
“M”: the number of whole months between the start & end dates
“Y”: the number of whole years between the start & end dates
“MD”: the number of days between the start & end dates after subtracting whole months.
Example: After subtracting whole years and whole months from my age, how many days old am I?
“YM”: the number of whole months between the start & end dates after subtracting whole years.
Example: After subtracting whole years from my age, how many months old am I?
“YD”: the number of days between the start & end dates, assuming the start & end dates were no more than one year apart.
Example: How many days has it been since my last birthday, given my birthdate and today’s date?
VALUE!
A general error that could indicate a problem with a formula or referenced cells.
REF!
A formula is referencing a cell that is no longer valid or has been deleted.
Spreadsheet tip
Create a tab with just the raw data, and a separate tab with just the data you need.
Common spreadsheet errors
DIV/0!
A formula is trying to divide a value in a cell by 0 (or an empty cell with no value)
=B2/B3, when the cell B3 contains the value 0
(Google Sheets only) Something can’t be interpreted as it has been input. This is also known as a parsing error.
=COUNT(B1:D1 C1:C10) is invalid because the cell ranges aren’t separated by a comma
A formula can’t find the data. The cell being referenced can’t be found.
=VLOOKUP”Apple”, A2:B5, 2, FALSE) Data not found in lookup.
The name of a formula or function used isn’t recognized. The name of a function is misspelled.
=SUMM(A1:A5)
The spreadsheet can’t perform a formula calculation because a cell has an invalid numeric value
=DATEDIF(A4, B4, “M”) is unable to calculate the number of months between two dates because the date in cell A4 falls after the date in cell B4
SQRT(-1) Data doesn’t make sense for the calculation.
A formula is referencing a cell that isn’t valid. A cell used in a formula was in a column that was deleted.
=A1+B1 Referenced cells have been deleted.
A general error indicating a problem with a formula or with referenced cells
There could be problems with spaces or text, or with referenced cells in a formula; you may have additional work to find the source of the problem.
=SUM(A1:A3) Incompatible data types.
=ISERROR
Logical function that checks if a value is an error. Use it to set up conditional formatting in excel or sheets.
Conditional formatting in Microsoft Excel
For Format values where this formula is true, enter =ISERROR(A1).
Click the Format button, select the Fill tab, select yellow (or any other color), and then click OK.
Conditional formatting in Google Sheets
From the main menu, click Format and select Conditional Formatting to open the Conditional format rules pane on the right.
While in the Single Color tab, under Format rules, use the drop-down to select Custom formula is, enter =ISERROR(A1), select yellow (or any other color) for the formatting style, and then click Done.
=AVERAGE()
Use it to calculate average.
Example:
=AVERAGE(B2:E2)
In above example, B2:E2 shows the sales for April, May, June, and July. Above equation tallies the total sales and then divides by 4.
How to calculate change or percent change from June monthly sales to July monthly sales
If E2 is July monthly sales (163330) and D2 is June monthly sales (47002),
=E2-D2/D2
& then change the result column to percentages.
Function
A preset command that automatically performs a specific process or task using the data.
=SUM(value1: value2) *Adds all cells in this range together.
=AVERAGE(value1:value2) *Adds all cell in this range together and then divides by the total number of cells in this range.
Example: AVERAGE(B2:D3)
1) B2+C2+D2=x
2) x/3
=MIN(value1:value2) *Finds the minimum value in the selected cell range.
Example:
=MIN(B2:E4) *Note this range covers an entire table. In this example, sales from 2017, 2018, and 2019 (rows) and each month (column) are considered.
=MAX(value1:value2) *Finds the maximum value in the selected cell range.
Again, like MIN, this range can cover an entire table, e.g., =MAX(B2:E4)
Fill Handle
Little box in the bottom left-hand corner of a cell that you can use to copy a function or formula. Drag it up or down.
Cell reference
column letter & row number used to identify a cell.
Example: A1
Formula
a set of instructions used to perform a calculation using the data in a spreadsheet.
Formula vs Function
Formula: a set of instructions used to perform a calculation using the data in a spreadsheet.
Function: A preset command that automatically performs a specific process or task using the data.
=SUM(value1: value2)
=AVERAGE(value1: value2)
=MIN(value1: value2)
=MAX(value1: value2)
=COUNTIF(value1:value2, “value_seeking”) *value can be a text string or number.
cut, save, and find are also functions.
Relative Reference vs. Absolute Reference
Relative references (cells referenced without a dollar sign, like A2) will change when you copy and paste the function into a different cell. With relative references, the location of the cell that contains the function determines the cells used by the function.
Absolute references (cells fully referenced with a dollar sign, like $A$2) will not change when you copy and paste the function into a different cell. With absolute references, the cells referenced always remain the same.
As an example, if you copy the formula =B4C4 from cell D4 to D5, the formula in D5 adjusts to the right by one column and becomes =B5C5.
If you want to maintain the original cell reference in this example when you copy it, you make the cell reference absolute by preceding the columns (B and C) and row (2) with a dollar sign ($). T
hen, when you copy the formula =$B$4*$C$4 from D4 to D5, the formula stays exactly the same.
Mixed Reference
Mixed reference Excel definition: A mixed reference is made up of both an absolute reference and relative reference.
This means that part of the reference is fixed, either the row or the column, and the other part is relative.
A mixed reference comes in these two common forms:
1) =$A1 ($ in front of column, holding the column constant)
2) =A$1 ($ in front of row, holding the row constant)
Example:
The company secretary has been asked to calculate the annual income tax for several top executives in the company. She has been given their annual income between 2017 and 2019 and their respective tax rate.
To find out their respective annual income tax payable, the calculation is = annual income * tax rate.
In Jonathan’s case, it would be = 259817% for 2017
In Excel expression, it would be =B3E3.
The return value is $441.66.
Since the tax rate is always in column E, column E is to be held constant in the calculation.
=B3*$E3
To calculate the rest (i.e., 2018 and 2019 for Jonathan), copy the formula across the rest of the remaining cells.
By doing this,
2018: =C3 (2018 Salary)*$E3 (17% tax rate; doesn’t change over time)
2019: =D3 (2019 Salary) *$E3 (17% tax rate; doesn’t change over time)
If a mixed reference was not applied in the scenario above, and only a relative reference used, the calculations would not be correct.
They would be,
2018=C3 (2018 Salary) *F3 (No value in this column)
2019: D3 (2019 salary) *G3 (No value in this column)
Paste Values Only
Example:
A B C D E 1 Sales Week1 Week2 Week3 Total/Day 2 Mon 400 300 350 =SUM(A2:D2) 3 Tues 500 200 450 =SUM(A3:D3)
If you try to copy column A & E and paste them, you’ll get a #REF! error for the E column.
A B C D E 5 Sales Total/Day 6 Mon =SUM(_:A6) 7 Tues =SUM(_:A7)
Why do you get the error?
Excel is trying to sum the cells to the left, but there aren’t cells to the left. This happens because it’s using relative reference values.
Solution: Paste Values Only
This will copy the totals from cells E2 and E3 (i.e., 182719 and 202754) and paste them in B6 and B7 without the equation. (If you double click on 182719 and 202754, you’ll just see those values; no formula will show up.)
Hot Keys:
Paste Values Only: Control+Shift+V
vs.
Paste: Control+V
Spreadsheet Hotkeys, PC
Create new workbook
Open workbook
Save workbook
Close workbook
Create new workbook: ctrl+N
Open workbook: ctrl+O
Save workbook: ctrl+S
Close workbook: ctrl+W
Spreadsheet Hotkeys, PC
Undo
Redo
Copy
Cut
Paste
Paste Values Only
Insert link
Bold
Italicize
Underline
Undo: Ctrl+z
Redo: Ctrl+y
Copy: Ctrl+c
Cut: Ctrl+x
Paste: Ctrl+v
Paste Values Only: Ctrl+shift+v
Insert link: ctrl+k
Bold: ctrl+b
Italicize: ctrl+I
Underline: ctrl+u