Excel Formulas and Functions - For Complete Beginners, Step-By-Step Illustrated Guide To Master Formulas and Functions - William B. Skates
Excel Formulas and Functions - For Complete Beginners, Step-By-Step Illustrated Guide To Master Formulas and Functions - William B. Skates
Skates
All right reserved. No portion of this book may be reproduced, stored in
a retrieval system, or transmitted in any form or by any means –
electronic, mechanical, recording or otherwise – except for brief
quotation in printed reviews without the prior written permission of the
publisher or the author.
Table of Contents
INTRODUCTION
CHAPTER 1: WHAT ARE FORMULAS AND FUNCTIONS?
CHAPTER 4: OPERATORS
CHAPTER 5: ABSOLUTE VS RELATIVE CELL REFERENCES
CHAPTER 6: SUM
CHAPTER 7: IF
CHAPTER 8: AND
CHAPTER 9: LEN
CHAPTER 10: OR
CONCLUSION
Complementary Books
Introduction
For example, here is a very simple problem where A2 contains 5.7 and
B2 contains 6.4. The task is to put the products of these two numbers in
into cell C2. See diagram below.
When this is done it leads to the value of the product appearing in the
cell C2. [The word 'TEXT' and the expression fx = A2*B2, which are
shown in the diagram appear automatically. You can ignore them.]
Another simple example is adding the contents of the cells A2, A3, A4,
and putting the results in A5.
There are a vast number of functions in Excel, which you will become
familiar with as you master the use of this amazing tool. This little book
will look at some of the more important functions.
Chapter 2: Text Formulas
The Excel TEXT formula or function is a most interesting one.
Date format
The Excel TEXT formula or function can be used to bring about
changes of date and number format. Here is an example, suppose we
wanted to change a column of dates in a certain format
and wish to change them into the form mm/dd/yyyy. In order to do this,
we use the Text function.
We can pick any column of 7 cells to put them in, so let's put them in
the column starting at a2. Select a2 and type the function declaration,'
=TEXT(b2,"mm/dd/yyyy") '
If you do this, Excel automatically offers you possible functions to
make your task easier. You are sensible to use them.
Once you filled the function in press enter and you will find the correct
expression in a2.
You can quickly fill in the rest of the column by using the 'handle' at the
side of a2.
Currency
Another possible use of the TEXT function is to convert a column of
numbers
into currency format.
Note the first number is contained in e2. Suppose the new column will
start at f10. Select f10 and type the function declaration, ' =
TEXT(e2,"$##.##") '
Press enter.
Now use the handle and move down to get the remaining conversions.
TEXT can be used in many ways like the two examples shown.
If we look at the structure or syntax of the TEXT function through a
declaration, '=TEXT(e2,"$##.##")', we see the parameters of the
TEXT function are TEXT( value, format_text ). Value, as the contents
of cells, is values; format_text, as the function acts to change the format
of the value.
Chapter 3: Comparison Formulas
You test whether two specific cells match with the IF function [We will
say more about this later]. Begin a formula with =IF( and enter the two
cell locations, with = between them. Put in a comma then enter
relevant text, in quotes, to show if the cells match. Put in another
comma and then the relevant text, in quotes, if there is a non-match.
Press enter
The comparison operators are as they are in arithmetic and they are: >,
< , < , > , =, ≠, however Excel uses <= for < , >= for > and <> for ≠.
Text concatenation may be a new idea for some of you. There is only
one text concatenation operator and that is & [ampersand]. Here is how
it works, suppose you had the string [word], "nice" in a2 and "cat" in b2
Another type of operator, which may be new to you is the type referred
to as a reference operator. Here are the reference operators.
: is the colon operator and refers to all references in a range from one
cell to another including the endpoints.
Example. a2:a4 refers to a2, a3, and a4.
, is the comma operator and joins two ranges together. Here is an
example a2: a4, b2: b4 refers to a2, a3, a4, b2, b3, b4. It is the
equivalent in mathematics of the union operator [ ∪ ].
Finally, we have the single space operator. This is just an empty space.
It produces references to common cells and ranges.
Example. a2:a4 a3:a5 gives a3, a4. Obviously, a3 and a4 are the only
common cells of the ranges a2, a3, a4 and a3, a4, a5. It is the equivalent
in mathematics of the intersection operator [ ∩ ].
When you working with Excel, you must know about what is called
relative vs. absolute cell reference.
The problem is this: if you COPY A FORMULA containing cell
references, generally the CELL REFERENCES CHANGE!
The diagrams below illustrate this.
Now copy these three cells to a1,b1,c1 and look what happens.
In this diagram, we are using relative references. Now copy the cell C2
to D3.
The first diagram is as we got last time because "nice" is actually in the
cell A1 and "cat" is actually in B1. Now let's copy the cell C2 to D3, as
we did before
Now, you can use the 'handle' to complete the use of the function.
Now before leaving the IF function, we will consider another extremely
useful property of this extraordinary function:- NESTING. In this
context, nesting has nothing to do with birds. It is the ability of the IF
function to make itself one of the choices. Here is an example to show
this.
The only row, which had A and B cells both less than 50 was row 4.
Here is another example of the same type. Find the rows in which the C
and D cells are both less than 50 in the table below.
Into cell E2 type the function declaration, ' =AND(C2<50,D2<50) '
then press enter.
Now use the handle to complete the task.
In this case, only rows 3 and 10 had C and D cells where the number
was less than 50.
Structure or Syntax of AND
If we look at the structure or syntax of the AND function through a
declaration, ' =AND(C2<50, D2<50)', we see the parameters of the
AND function are AND( logical test, logical test). The parameters are
two logical tests, the combination of whose results give different
results.
Chapter 9: LEN
The LEN function is one of a large number of Excel functions, which
handle strings [words]. The LEN function has a very simple format =
LEN (string). The function returns the number of letters in a string,
which is often in a cell.
The LEN function is a string function, some other very important string
functions are the LEFT and Right Functions. The LEFT function gets a
substring that contains a given number of left characters from a string.
Similarly, the RIGHT function gets a substring that contains a given
number of right characters from a string.
The following example shows how the LEFT function works.
There are many more string functions in Excel but we will only look at
one more, which is the MID function.
The structure or syntax of the function is MID(string, number1,
number2).
The string is the string or word, which the function is acting on,
number1 is the number of the letter in the string that you start with and
number2 is the number of the letters in the string that you want, starting
with the letter at number1.
Example. Find the rows in which either the A and B cells are less than
50 in the table below.
You may well ask what effect the NOT function has on cells, which
contain data apart from Boolean. The table below gives the results on
some such cells.
It would seem any number except 0 is considered TRUE. Text like 'cat'
is not recognized.
Here is the first example. In the table of data below, we want to add all
grades less than 50, using the functions of Excel.
Into any cell, except those with the data, type the function declaration, '
=SUMIF(D2: D15,"<50", D2: D15) ' then press enter and you get 98.
Interestingly, as the range with the criterion < 50 is the same as the
range we're summing over, we don't need the second D2: D13.
We would get exactly the same result if the function declaration was, '
=SUMIF(D2:D15,"<50") '. Try it and see for yourself.
If the range with the criterion is different from the range we're summing
over this is not true.
Into any cell, except those with the data, type the function declaration, '
=SUMIF(C2:C14,"F",D2:D15) ' then press enter. This time the result is
334.
The only trouble with SUMIF is that it only allows one criterion. If you
want multiple criteria [plural of criterion] then you have to use
SUMIFS. Once again an example will show what this entails.
Example. Find the sum of the grades of males whose school is 'A'.
Into any cell, except those with the data, type the function declaration, '
=SUMIFS(E2:E15,C2:C15,"M", D2:D15,"A") ' then press enter. This
time the result is 259.
Example. Count all the cells with numbers only in the cells below.
Into any cell, except those with the data, type the function declaration, '
=COUNT(M2: M9, N2: N9) ' then press enter. The result is 6, as there
six cells, which contain numbers.
Now let's use COUNTA. Into any cell, except those with the data, type
the function declaration, ' =COUNTA(M2: M9, N2: N9) ' then press
enter. The result is 15, as there fifteen cells, which contain numbers.
Note that the empty cell is not counted, either by COUNT or
COUNTA.
These two functions have a very simple structure or syntax. Their only
parameter is a range.
Chapter 15: AVERAGEIF and
AVERAGEIFs
The AVERAGEIF and AVERAGEIFS functions are very similar to the
SUMIF and SUMIFS functions.
Example. Suppose you wanted to find the average grade of the female
students in the table below.
Into any cell, except those with the data, type the function declaration, '
=AVERAGEIF(C2: C15, "F", E2: E15) ' then press enter. This time the
result is 55.666….
Generally, the declaration is, ' =AVERAGEIF(criterion range,
criterion, average_range) '. The meaning of average_range is the range
you're going to take the average of. AVERAGEIF is for situations
where there is only one criterion.
Example. Suppose you wanted to find the average grade of the male
students who went to school B from the table below.
Into any cell, except those with the data, type the function declaration, '
=AVERAGEIFS(E2:E15,C2:C15,"M", D2:D15,"B") ' then press enter.
This time the result is 60.25
Generally, the declaration is, ' =AVERAGEIFs(average_range,
criterion1 range, criterion1, criterion2 range, criterion2,) '. The meaning
of average_range is the range you're going to take the average of.
AVERAGEIFS is for situations where there is more than one criterion.
Chapter 16: LARGE and SMALL
The LARGE and SMALL functions are very easy to understand and
use. The declaration ' = LARGE(F1: G100, 3)' finds the third largest
number in the range F1: G100.
Example. Find the fifth largest number of the set in the cells below.
Into any cell, except those with the data, type the function declaration, '
=LARGE(J2: K8, 5) ' then press enter. The result is 78.
Example. Find the second smallest number of the set in the cells below.
Into any cell, except those with the data, type the function declaration, '
=SMALL(J2: J15, 2) ' then press enter. The result is 23.
Chapter 17: COUNTIF and
COUNTIFS
Example. Suppose you wanted to find female students were in the table
below.
Into any cell, except those with the data, type the function declaration, '
=COUNTIF(C2: C15, "F") ' then press enter. The result is 6
Into any cell, except those with the data, type the function declaration, '
=COUNTIFS(C2:C15,"M", D2:D15,"B") ' then press enter. This time
the result is 4.
Generally, the declaration is, ' =COUNTIFS( criterion1 range,
criterion1, criterion2 range, criterion2,….) '. COUNTIFS is for
situations where there is more than one criterion.
Chapter 18: VLOOKUP
The next two chapters deal with the VLOOKUP and HLOOKUP
functions. These are very useful but are often misunderstood.
We will need a number of examples to try and make this clear. Here is
the first example.
We have a table of grades from a school.
and we want to put the math grade beside each Family Name in the list
below.
If you don't know how to order data then make sure to read the last
chapter.
Now another example, which will hopefully help cement these ideas.
Before we began it was necessary to make sure that a check was made
that the data in the lookup column was in ascending order. As it was,
there was no problem.
We can easily calculate the week's pay of the employees by typing, '=
B2*C2', into D2 then pressing enter followed by the handle.
Before finishing this function, let us examine the last parameter, which
takes the value FALSE for an exact match and TRUE for an
approximate match.
Leave the function as it is but change Diane to Diana. The table below
shows what happens.
Here is how you could access this simple table using HLOOKUP. The
problem is to find the number of Honda cars in stock, using the
HLOOKUP function, and write it in the cell B6 to the right of the word
Honda in cell A6.
The reason is that the word 'Ford' is contained in the top row of the
table with 20 below it in row 2.
HLOOKUP searches for the word Honda in the top row of the range
A1: E3. Once this is found, the 2 tells HLOOKUP to take the contents
of row 2, which is beneath Honda and put it in B6. The FALSE tells
HLOOKUP that there must be an exact match. An approximate match,
such as HINDA or HONDO would not be acceptable, whereas it might
for TRUE.
Finally, you may recall that VLOOKUP required the left column to be
in ascending order. For HLOOKUP, this is not necessary for a last
parameter value of FALSE. However, it is necessary that the top row of
the range be in ascending order if the last parameter is TRUE.
Suppose the range we are going to look up from is the table below.
and suppose the lookup is based on ID. You can see that the table has
been ordered by Family.
To order this range by ID is very easy.
Here are the steps, after you have selected the range A2: E11.
(1) Click on the DATA tab on your Excel Menu.
We want the results of the female students only with a total over the
three subjects and the results put in descending order, with the highest
total at the top, down to the lowest.
Now we need to sort them via total in descending order. Once again
select the range and go to Sort and Filter.
Select Custom Sort and make sure you pick Total and Largest to
Smallest.
We now have the desired table.
Some of you may have wondered about Filter. What is this? Read on to
find out.
Filter
I will not spend too much time on this. Basically, it is a way of
examining a set of data using constraints but leaving the data set intact.
Here is an example. The data set below is the same one we extracted the
females from before using order. This time we are going to have a look
at the male results in ascending order of Total [smallest to largest], save
the filtered data set elsewhere then restore the data set.
Go to the Sort & Filter tab, as you did before, after clicking on the Data
tab of the Excel menu.
This time click Filter, but NOT the down arrow, after selecting the
whole data set.
You will notice little arrows. Click on the arrow in the Gender column.
Immediately you do, the following window appears.
Fill it in as shown.
Leading to
Finally, close the Gender window and you only have the Male results.
Finally, restoring the original set of data is easy. Just click on the Filter
icon. When you do this the Filter arrows are removed and you have the
original data set restored.
Filtering by Color
While exploring Filter, you may have noticed the option Filter by Cell
Color.
Hitherto, this has been irrelevant, as we have only used Black and
White. However, Excel offers all sorts of color schemes. Two simple
ones for Fill Color and Font Color are shown.
To show the use of Filter by Cell Color, we have colored the data set
we have been using.
Now click on Filter after selecting the data set. This results in the
following.
Now use any little arrow, choose color and finally yellow or red.
If we pick red then we get the filter below.
If you wish to master it you must know the basics of formulas and
functions inside and out.
Before you proceed further with formulas and functions you must
master the material in the book to the extent that you can do the
problems in every chapter.
Once you have mastered the material in this book you are ready for all
the other things that can be done with EXCEL and the VBA
programming language!
Good Luck.
Welcome to the last page reader, I'm happy to see you here I hope you
had a great time reading my book and if you want to support my work,
leaving an honest review will be highly appreciated. Thank you so
much!
Respectfully,
William B. Skates