You are on page 1of 12

Basic Excel Formulas

Formulas are equations that perform calculations on values in your worksheet. Depending on
how you build a formula in Excel will determine if the answer to your formula automatically
updates, as changes are made. A formula starts with an equal sign (=) and can contain any or all
of the following:
Function: A function is a prewritten formula that takes a value or values, performs an
operation, and returns a value or values. Use functions to simplify and shorten formulas on
a worksheet, especially those that perform lengthy or complex calculations.
A Function is generally comprised of two components:
1) A function name
a) The name of a function indicates the type of math Excel will perform.
2) An argument
a) An ―argument‖ is the values that a function uses to perform operations or calculations.
The type of argument a function uses is specific to the function. Common arguments that
are used within functions include numbers, text, cell references, and names

=AVERAGE(A1:A20)

Equal sign Function Argument


name

References: two types:


1) Relative reference: In a formula, the address of a cell based on the relative position of the
cell that contains the formula and the cell referred to. If you copy the formula, the
reference automatically adjusts. A relative reference takes the form A1.
2) Absolute cell reference: In a formula, the exact address of a cell, regardless of the position
of the cell that contains the formula. An absolute cell reference takes the form $A$1.

Operator: A sign or symbol that specifies the type of calculation to perform within
an expression. There are mathematical, comparison, logical, and reference operators.

Constant: A value that is not calculated and, therefore, does not change. For example, the
number 210, and the text "Quarterly Earnings" are constants.

Calculation operators and precedence


Operators specify the type of calculation that you want to perform on the elements of a
formula. There is a default order in which calculations occur, but you can change this order by
using parentheses.
Types of operators
There are four different types of calculation operators: arithmetic, comparison, text
concatenation, and reference.
Arithmetic operators
To perform basic mathematical operations such as addition, subtraction, or multiplication;
combine numbers; and produce numeric results, use the following arithmetic operators.

Arithmetic operator Meaning Example

+ (plus sign) Addition 3+3

– (minus sign) Subtraction 3–1


Negation –1

* (asterisk) Multiplication 3*3

/ (forward slash) Division 3/3

% (percent sign) Percent 20%

^ (caret) Exponentiation 3^2

Comparison operators
You can compare two values with the following operators. When two values are compared by
using these operators, the result is a logical value either TRUE or FALSE.

Comparison operator Meaning Example

= (equal sign) Equal to A1=B1

> (greater than sign) Greater than A1>B1

< (less than sign) Less than A1<B1

>= (greater than or equal to sign) Greater than or equal to A1>=B1

<= (less than or equal to sign) Less than or equal to A1<=B1

<> (not equal to sign) Not equal to A1<>B1


Reference operators
Combine ranges of cells for calculations with the following operators.

Reference
operator Meaning Example

: (colon) Range operator, which produces one reference to all B5:B15


the cells between two references, including the two
references

, (comma) Union operator, which combines multiple references SUM(B5:B15,D5:D15)


into one reference

The order in which Excel performs operations in formulas


In some cases, the order in which a calculation is performed can affect the return value of the
formula, so it's important to understand how the order is determined and how you can change
the order to obtain desired results.
Calculation order
Formulas calculate values in a specific order. A formula in Excel always begins with an equal
sign (=). The equal sign tells Excel that the succeeding characters constitute a formula.
Following the equal sign are the elements to be calculated (the operands), which are separated
by calculation operators. Excel calculates the formula from left to right, according to a
specific order for each operator in the formula.
Operator precedence
If you combine several operators in a single formula, Excel performs the operations in a specific
order. If a formula contains operators with the same precedence — for example, if a formula
contains both a multiplication and division operator — Excel evaluates the operators from left
to right.
To keep things simple, the ―Order of Operations‖ in a basic Excel formula is as follows:
1) Parenthesis
2) Exponents
3) Multiplication or Division – if both operators appear in the same formula, Excel
evaluates the operators from left to right.
4) Addition or Subtraction – if both operators appear in the same formula, Excel evaluates the
operators from left to right.

To change the order of evaluation, enclose in parentheses the part of the formula to
be calculated first.
For example, the following formula produces 11 =5+2*3
because Excel calculates multiplication before
addition. The formula multiplies 2 by 3 and then
adds 5 to the result.
In contrast, if you use parentheses to change the =(5+2)*3
syntax, Excel adds 5 and 2 together and then
multiplies the result by 3 to produce 21.

Create a simple formula with constants and calculation operators


1) Click the cell in which you want to enter the formula.
2) Type = (an equal sign).
3) Enter the formula.
=128+345
(Example1)
(adds those two numbers together)
=(10+20+30)/3
(first add the contents of the parentheses, then
(Example2)
divide the result of the parentheses by the
number 3)

4) Press ENTER.
Create a function manually:
1) Click the cell in which you want to enter the formula.
2) Type = (an equal sign).
3) Type the function name (function names are not case sensitive, they are spelling sensitive:
ex. - SUM, AVERAGE, MAX).
4) Type ( (an open parenthesis).
5) Type the argument.
a) Remember to use a colon to included cells that are adjacent to each other; use a comma
to include nonadjacent cells.
6) Type ) (a closing parenthesis).
7) Press ENTER.
Adds the numbers:
Example1: =SUM(100,200,300)
100+200+300
Adds the cells A12 through C12,
Example2: = SUM(A12:C12)
including A12 and C12
Adds only the cells
Example3: =SUM(A12,A13,C12)
A12+A13+C12

Example4 =SUM(A12:C12,A13) Adds the cells A12 through C12,


and A13
Fill formulas into adjacent cells
1) Select the cell that contains the formula that you want to fill into adjacent cells.
2) Drag the fill handle across the cells that you want to fill.

a) The formula has been displayed


in the answer cell for this
example. Normally you will only
see the answer to the formula.
The goal is to copy the formula
―=SUM(B2:B7)‖ to the next cell.
b) The next cell contains the exact
same number of cells you are
trying to add up.
c) By dragging the fill handle, you can
easily copy a formula from one cell
to another. When you point to the
fill handle, the pointer changes to a
black cross.
3) After dragging, the reference
automatically adjusts.
a) If necessary, choose how you want
to fill the selection, click Auto Fill
Options , and then click the
option that you want.

Delete a formula
1) Click the cell that contains the formula.
2) Press DELETE.
Math and Trigonometry Functions
Several math functions can help expedite analysis. This section highlights on a few.

ABS
When there is a need to get the absolute value of a number, the ABS function is helpful.

ROUND, ROUNDUP, and ROUNDDOWN


There are various options with rounding, depending on the need. The functions’ argument tooltip
specifies how many decimal places or to which nearest integer it should round.

  ROUND – This function helps users to round to the nearest value.


 ROUNDDOWN – This function helps users to round values down to the nearest value based
 on the desired decimal place or integer.
 ROUNDUP - This function helps users to round values up to the nearest value based on the
desired decimal place or integer.

Statistical Functions
When presented with large datasets, it is helpful to sort and summarize the information at hand.

COUNT, COUNTA, and COUNTBLANK


The counting functions are especially helpful with large datasets to identify anomalies and to get
general summary statistics.

  COUNT – This function counts the number of cells that contain numbers.
 COUNTA – This function counts cells containing any type of information, including error values
 and empty text (as shown in the example below, it counts the cell marked “VOID”).
 COUNTBLANK – This function counts only the empty cells within the dataset, with no
information contained in the cells.













AVERAGE, MEDIAN, MIN, and MAX
With large datasets, it is often helpful to run basic summary statistics before doing further
analysis.

  AVERAGE – This function calculates the average value in a dataset.


  MEDIAN – This function calculates the median, middle value, in a dataset.
  MIN – This function returns the lowest value in a dataset.
 MAX – This function returns the largest value in a dataset.

Text Functions
Text functions are helpful when we seek to only get a portion of the information contained within a cell
or we are trying to combine information contained in multiple cells.

LOWER, UPPER, and PROPER


Formatting can be an issue when exporting data. Information may be in upper cases, lower cases, or a
combination of both. To make clean tables and charts can require formatting or use of the following
functions:

  LOWER – This function returns text values in a cell in all lower case.
  UPPER – This function returns text values in a cell in all upper case.
 PROPER – This function returns text values in a cell with the each of the first word
capitalized.


CONCATENATE
CONCATENATE is helpful to combine information contained in separate cells into one cell. The
function contains arguments referencing the cells containing the information.

The example below shows how the function returns values. In the first example, first name and last
name is combined, but look closely because there isn’t a space. By adding to the argument by
including spaces (“ “), commas (“, “), and other desired punctuation or words (“ of “) the appropriate
desired value can be returned.

LEN and TRIM


LEN is helpful to return the length of a string in a cell. The function contains one argument and that is
the cell of inquiry. Note from the example below that Excel or LibreOffice Calc calculates extra spaces
in the string in the length number. For example, the name Eli is shown as having a length of 5 and
Tina has a length of 6.

One common use of the TRIM function is to remove extra spacing. Following the example above, the
TRIM function is used below to remove the extra spacing, which shortens the length of the cell. The
function contains one argument and that is the cell of inquiry.
Logical Functions
Logical functions are useful when we are seeking to perform conditional actions or calculations.

COUNTIF
This function counts the number of cells that meet a criterion. The two examples below show how
COUNTIF operates. The argument is the range of cells that we want Excel or LibreOffice Calc to
review. The tooltip specifies the criterion, e.g. code 100 and vendor ABC, respectively.

IF
If statements are helpful to return one value if the statement is true and another if the statement is
false. In the example below, we are comparing the payment amount (C2:C7) to the invoice amount
(B2:B7). If the payment amount is greater than the invoice amount, then Excel or LibreOffice Calc
returns a value of “Overpayment.” If the payment amount is not less than the invoice amount, then
Excel or LibreOffice Calc return a value of “Not Overpayment.” Please note the attention to the value
we selected to return if the statement is false because the logic statement is also capturing instances
where the payment amount equals the invoice amount (Rows 3 and 6).

 

Excel Formulas
Basic math
Function or
Used For Format Example
Operator
SUM Add values in a range of cells =SUM(cell range) =SUM(B2:B9)
+ To add individual items =Value1 + Value 2 =B2+C2
- Subtract =Value1 - Value 2 =B2-C2
* Multiply =Value1 * Value2 =B2*C2
/ Divide =Value1 / Value2 =B2/C2
^ Exponents =Value1 ^ Value2 =B2^C2
Average the values in a range
AVERAGE =AVERAGE(cell range) =AVERAGE(B2:B9)
of cells
MEDIAN Median =MEDIAN(cell range) =MEDIAN(B2:B9)
Find the highest value in a
MAX =MAX(cell range) =MAX(B2:B9)
range of cells
Find the smallest value in a
MIN =MIN(cell range) =MIN(B2:B9)
range of cells
Simple formatting tricks
Functions Used For Format Example
Capitalizesthefirstletterinatexts
tringandanyotherlettersintextth
PROPER atfollowanycharacterotherthan =PROPER(cell) =PROPER(A2)
aletter,i.e.aspace.Convertsallo
therletterstolowercase
To change a cell to upper
UPPER =UPPER(cell) =UPPER(A2)
case
LOWER To change a cell to lower case =LOWER(cell) =LOWER(A2)
Removes all blank,
unnecessary spaces at the
start and end of a string
TRIM =TRIM(cell) =TRIM(A1)
including extra spaces, tabs,
and other characters that don’t
print.
Conditional statements
Functions Used For Format Example
=IF(logical test, “result if
Display different information
the test answer is true”,
IF depending on the outcome of =IF(B2>69,”Pass”,”Fail”)
“result if the test answer
a condition test
is false”)
=EXACT(Value1,
EXACT Compare the values =EXACT(B2, C2)
value2)
Putting things together
Functions or
Used For Format Example
Operator
To combine cells with a space =CONCATENATE(text, “ =CONCATENATE(A2, “
CONCATENATE
in-between ”, text) “,B2)
To combine cells with a space
& =text & “ “ & text =A2 & “ “ & B2
in-between (second option)
Counting

Function Used For Format Example


=COUNT(range of cells
=COUNT(A1:A10)
COUNT Count numerical cells to count)
=COUNTA(range of
COUNTA Count cells cells to count) =COUNTA(A1:A10)

You might also like