Professional Documents
Culture Documents
Section 4: Charts
Lesson 4.1: Select data to create a chart
Lesson 4.2: Recommended charts
Lesson 4.3: Explaining all graphs and recommended situations
Lesson 4.4: Combining chart types
Lesson 4.5: Chart elements
Lesson 4.6: Format Axis
Lesson 4.7: Predefined design styles
Lesson 4.8: Change the selected data
Lesson 4.9: 3D charts
1. Title bar: shows the name of the book and sometimes some
additional information (e.g., whether the book is networked with
other people, whether it is being saved).
3. Menu tabs: the tabs are sets of commands, i.e. actions that can be
performed with Excel, which are grouped logically according to
their functionality. Each tab is related to a type of activity.
4. Home tab: is composed of all the groups that are observed, and
from here you can perform the most common actions of Excel.
5. "Alignment" group: each tab is made up of different groups,
containing commands that act similarly. This group is used to act
on the alignment of the cell contents, indentations, height...
6. "Merge & Center" command: the commands are the elements that
perform the actions on the selected cells. This command merges
the selected cells, going from having several cells to only one,
where the content is centered.
7. Formula bar: in Excel you can type either on the selected cell itself
or in the formula bar. When the content is a formula, only the
result will be shown in the cell, while the formula leading to the
result will be shown in the bar.
8. Scroll bar: is used to scroll the sheet up and down (vertical scroll
bar), and the bottom scroll bar to scroll left and right (horizontal
scroll bar).
10. Worksheets: each of the sheets that make up an Excel book. For
example, to avoid having to save 12 different books (Excel files)
for each month of a year, we can create a single book of the year
and create 12 worksheets in that book.
11. Active cell: is the cell we have selected, the one on which the
commands we press are applied or the one we write on if we write
in the formula bar.
Clicking with the right button on the name of the worksheet and then
moving the mouse to where it says "Tab Color" displays a palette of
colors, where we can choose one of the colors that appear here or click
on "More Colors ..." to open an advanced color menu.
Delete worksheets:
At the bottom of the screen, to the right of the page labels and to the
left of the scroll bar is a "+" symbol. Clicking on this symbol creates a
new blank sheet to the right of the selected sheet.
Move/Duplicate worksheets:
To make this easier we can simply click with the left button on the
name of the sheet and drag (without releasing the left button) to where
we want to move the sheet. If we do the same but pressing and keeping
the "Ctrl" key on the keyboard, we will duplicate the sheet.
This can be done from the "Cells" group on the "Home" tab, where we
can insert or delete cells, rows, columns and sheets. To do this it is
necessary to select the cell or range of cells where we want to position
the new cells and press the button of the desired command.
A quicker way to insert cells or ranges is to select where you want the
new cells to be positioned (as before) and press "Ctrl" and "+"
simultaneously on the keyboard. To delete, do exactly the same thing
but pressing "Ctrl" and "-" simultaneously.
Cell size
By default, all columns in Excel come with a width of 8.43, and rows
with a height of 15. In some cases, the size of cells is automatically
modified when we perform actions (increasing the size of text in a cell
increases the height of the row to fit the height of the text), but we can
also change it manually with the "Format" command in the "Cells"
group on the "Home" tab. By pressing this command, we can manually
enter the height or width of the row or column of the selected cell, as
well as “AutoFit” the height or width of the column so that the largest
content of the row or column fits right into the row or column without
leaving empty space.
The "Font" and "Alignment" groups, both on the "Home" tab, are used
to edit the formatting of the cells.
The "Font" group groups the commands to edit cell color, font, size,
style (bold, italic...) etc.
All the font and alignment modification options are accessible from
the normal Excel view in the "Home" tab (the groups shown in the
previous images). However, if you click on the button in the lower
right corner of any of the groups (arrow marked in the previous image)
you can access the cell format menu, from which you can view, by tabs,
each of the groups referring to the format of the cells, for a clearer
view of what we are modifying thanks to the previewer.
Within the "Alignment" group are two of Excel's most useful
visualization commands: "Merge and Center" and "Wrap Text".
When several cells are selected, and this button is pressed, all the
selected cells are merged and become one larger cell.
When you type a text in a cell and it is too long to be shown in the cell
two things can happen: if the cells on the right contain nothing the text
will be shown "invading" the cells on the right, while if the cells on the
right are occupied the text in our cell will be shown only as far as it fits
in the cell.
The "Wrap Text" command automatically adjusts the height of the row
so that the text fits completely in the cell without changing the width
of the column (B2 is wrapped, while C2 is not).
Line Color: to change the default black color to the border color.
More borders: from here we can see all the borders of the selected
cells and edit them in the most precise and faster way. When we
click on it the following menu appears in a new window:
Following the order of the screen, we select the style of the border
(normal, discontinuous, thick, double...), the color and we keep on
clicking in the window where it puts "Text" drawing ourselves the
border with each click.
Lesson 1.5: Content format
The content of a cell can be of different types: numbers, text, dates,
currency, percentage ... By default, the cells come with the format
"General", and if you enter any data that detects as some specific
format automatically changes its format to the detected. For example,
if we select an empty cell that is in "General" format and write a date
in it (12/25/2017), it will automatically become a date type.
The format of the cells can be checked in the "Number" group within
the "Home" tab.
With all this is intended to make understand that the format of a cell,
both the format of form, as the border and the content, does not
influence anything in the use of its content, all format changes are
made solely for visual reasons on the worksheet. Even if a number is
entered as a text format, when performing mathematical operations
on the cell, Excel will perform them correctly.
There is therefore no correct way to apply the formats, each user will
do it in a different way, according to the visual criteria that he
considers.
As in almost all groups, pressing the lower right corner opens the
window with format information, in this case with the tab "Number"
selected, where we can view and manage in an advanced way all the
categories of content offered by Excel:
Lesson 1.6: Custom content format
If we open the window with information about the format as just seen
in the previous section we can see that the last of the categories of
number format is "Custom".
With this category we can create the format of the content as we want,
changing the number of decimals, the form of representation of the
data, the color...
[COLOR] - To define the color of the text from the custom format,
write the name of the color in square brackets.
[GREEN][>=0]#,00;[RED] #,00
This is the group that allows you to copy or cut cells and paste them,
with several alternative options to each of these actions.
If the content of the source cell is a text, then the target cell will have
that same text. If the content of the source cell was a formula with all
the numbers entered manually, then the target cell will also have
exactly the same formula. However, if the source cell is a formula with
references to other cells (from the same sheet or from a different
sheet), the target cell will not refer to the same cells, but to the cells in
the position relative to the offset. Let's see it better with an example:
The source cell is C2, which is a formula that adds cells A1+A2. When
the cell is pasted to position C5, then the formula does not add cells
A1+A2, but A4+A5. This is because we have moved the origin cell 3
rows down, so the cells it refers to also move 3 rows down.
The same thing would happen if we had changed the cell of destination
not only of row but of column, the references would move to the left or
right as many columns as there are difference between the origin and
destination.
Cutting works exactly the same as copying, with the difference that
once the cut cells are pasted, the source cells are deleted. The keyboard
shortcut is the combination of keys "Ctrl" and "x" simultaneously.
Copy format
It works in a similar way to copying, but only copies the format of the
selected cells, not their contents. It doesn't have a keyboard shortcut,
and once the command is pressed the format is pasted in the selected
target cell, there is no need to press any more commands.
The "Copy" command alternatively has the option to copy the selected
cells as an image.
By doing this and using paste in this or another program are pasted
the copied cells (in content and form) in image form, as if we had
made a screenshot, without being able to modify this data in any way
(other than with an image editing program).
In order from left to right and from top to bottom the options are
these:
Paste: pastes the selected cells, the standard option when pasting,
which is done by doing "Crtl" + "v".
Keep Source Column Widths: pastes everything and sets the width
of the column where the target cell is equal to the width of the
column in the original cell.
Transpose: pastes the rows into a column and the columns into a
row. References in cells are also modified in the same way.
Values & Source Formatting: it is like pasting values but keeps the
formatting of the source cells completely.
Selecting a cell or set of cells we can see that the lower right corner is
different from the others. If we click on it and drag to the right or
down, the autofill will start.
The same happens if we do it with a string of text and numbers:
If clicking on the bottom right corner and dragging does not work the
autofill is because it is not in "Fill Series" mode but in "Copy Cells".
This usually happens when you try to make a series with a single cell
initially filled. The quickest way to switch between these two modes is
to hold down the "Ctrl" key while clicking and dragging.
The most accurate way to set to Excel what we want to do when using
the autofill option is to click on the button at the bottom right after
making an autofill.
Copy cells: is like making copy and paste but dragging instead of
using the command.
“Ctrl” + D: copies over the selected cell the contents of the cell on
the right. If a range is selected it will copy to the whole range the
contents of the cell or cells in the leftmost column of the selection.
“Ctrl” + “-“: deletes a cell, row or column. It works the same as the
previous command.
“Shift” + “↓” / “→” / “↑” / “←” (keyboard arrows): the "Shift" key
together with the keyboard arrows allows us to select a range of
cells while moving the active cell position. For example, our active
cell is A1, we press and hold the "Shift" key and press "→", "→",
"↓", "↓" and release "Shift", we will have selected the range of cells
from A1 to C3.
“Ctrl” + “Shift” + “↓” / “→” / “↑” / “←”: This adds up the effects of
the two keyboard shortcuts named above, so it's not hard to figure
out what the result will be: it's the fastest way to select the whole
range of a table. To start, we position ourselves in the upper left
cell of a table, press and hold "Ctrl" and press and hold "Shift";
now we press "↓", so we have moved to the lower cell with data,
selecting also all the cells in between; then we press "→", moving
to the rightmost cell with data, and also selecting all the cells in
between, so we already have the whole table selected (release
"Ctrl" and "Shift").
“Ctrl” + “;”: enters today's date in the active cell. The value is
static, so if we open this same sheet tomorrow will still appear the
date of the original day.
“F9”: updates the sheet. By doing this Excel recalculates all the
formulas in the sheet. The best way to check its operation is to
type in a cell the function "=random()". This function puts a
random number in the cell between 0 and 1 (with decimals), and
the number only changes if the sheet is recalculated (you can force
it by pressing F9).
“F1”: the most important of all named commands, opens the Excel
help. It is impossible to know all the shortcuts and combinations
that exist in Excel, nor to remember all the functionalities,
formulas, formats, etc. This is why it is important to know how to
access the help menu.
All the options to highlight cells work practically the same way, we
select the type of condition that we are going to check, in the new
window we introduce the value that makes the condition be fulfilled
and the format that the cell will have if the condition is fulfilled.
The two slightly different conditions are "A Date Ocurring" (in which
you have to choose the date from a drop-down list) and "Duplicate
Values" (in which you have to choose from the drop-down list whether
to mark duplicate or unique values).
From here we can apply a conditional format that applies the format to
the 10 highest values (the title says 10, but when you enter you can
modify the number), to the 10% higher (you can also modify the 10%
to the percentage you want), to the lower (in number or percentage)
and to those who are above or below the average of the values to which
we are applying the format.
Lesson 2.2: Predefined data bars
This format is used to see at a glance which are the major values of the
selection. When this format is applied to a set of cells, all of them are
filled with bars of one color. The cell with the highest value of all cells
in the selection will be completely occupied by the bar, cells with zero
value (0) have no bar, and intermediate values are filled in proportion
to the maximum value.
This type of conditional formatting is the type we mentioned in the
introduction to the chapter that does not require an initial condition to
apply the format or not to apply it, but always applies it, and does so in
relation to the value of the selected cells.
All types of data bars are the same, changing only the color of the bars,
and solid color (all the bar has the same color) or gradient fill (like the
previous image, the color becomes whitish to the right of the bar).
Lesson 2.3: Predefined color scales
Its operation is very similar to that of data bars. It does not require an
initial condition to apply the formatting if it is fulfilled, but it always
applies the formatting and does so depending on the value of each cell
in relation to the value of the other cells of the selection, with the
difference that this type of formatting uses colors instead of bars to
differentiate the highest values from the lowest.
To apply this type of conditional format we will use the command
"Conditional Formatting", "Color Scales", and select the type we want.
To determine which color to apply to each cell we must select the color
that the cell will have with the upper value, the one that the cell will
have with the lower value, and in some cases the color that the cell will
have with the intermediate value. If we choose only 2 colors it will be
called 2-color scale and if we choose 3 colors it will be a 3-color scale.
Lesson 2.4: Predefined icon sets
The last type of predefined conditional formats is the icon sets, which
work in a very similar way to the two previous ones, the cells to which
they apply are selected and based on their value in relation to the value
of the other cells of the selection one icon or another is applied.
Here we could set as a condition that the cell is larger than the cell on
its left, for example. In this case, if we want to apply the formatting to
a set of cells (that each cell is marked if it is bigger than the one on its
left) we have to take into account that by default when typing the
condition, the cell is locked, so the formatting will refer all the time to
the cell initially marked). If we want to mark the cells larger than the
ones on the left and not have to enter all the conditions one by one we
will have to know how to use the $ symbol, which we will see later in
the chapter on functions.
The first 4 options are the same as the predefined ones, mark
according to the value above or below (or equal to) the average of the
range. The rest of the options are to mark according to the relationship
with the deviation.
In any of the last 5 cases, once we define the condition, all we have to
do is click on "Format" and select all the characteristics that we want
our format to have (content format, text and cell color, borders...).
When accepting, in the "Preview" box we can see what the format will
look like when it is applied.
From the same window that we have opened to detect and modify the
formats we can create a new format on the cells that we have selected,
pressing "New rule" and choosing a condition and a format as we have
just seen that is done to edit.
Lesson 2.7: Create custom conditional formats
We just saw that the last of the types of rules for applying conditional
formats is " use a formula to determine which cells to format ". This
means that we can enter our own rule as a function to mark the cells
that meet the condition. Therefore, these custom formats do not
include bars, color scales, or sets of icons, but are only for highlighting
cells.
=OR($G7>$G$17,$E7>AVERAGE($E$7:$E$15))
What we are seeing is an “OR” logical function, so the format will be
applied if the first condition is met OR the second condition is met,
and those conditions are:
This can be a bit confusing if you don't know about functions yet, but
once you know how to use functions it will be very easy to understand
how this formula works and create your own to meet your needs for
conditional formats beyond the basic options offered by Excel.
Section 3: Data Tables and Filters
As we said in chapter 1, it is very important to organize the data in the
form of ordered tables so that we can quickly recognize what we are
looking at, and emphasize the important parts so that a person who
has not made the table knows where to look, and even ourselves as
well.
Once we press accept the data take the form of the table we have
chosen, and at the top of the program appears a new tab that was not
before, the "Design" tab (this tab only appears when the active cell is a
cell in the table).
In this tab we will look only at the groups "Table Style Options" and
"Table Styles". The first one is used to modify the visual aspect of the
rows and columns, add a row of totals, etc. (the best way to know what
each option is used for is to press them all and see what happens). The
second one is used to change the type of table (the colors) that we
initially choose.
If you still haven't tried applying a table format to a data table, it
would be a good idea to do so before reading the next question:
To give a quick table format you don't need to select the whole sheet,
having the active cell in one of its cells is enough, although if you have
selected the whole sheet think about this question: Have you selected
the whole table with the mouse, having to move the screen down if the
table was long enough, or have you done it with the key combination
"Ctrl" + "Shift" + "↓"? Which of the two ways is faster?
Lesson 3.2: Apply filters to one and several columns
If you are somewhat observant, you will have noticed that, when
applying the table format, a button with a downward arrow has
automatically appeared in all the cells of the titles.
If we first apply a filter to one column and then to another the filters
are added together. For example, if we first filter by color, and we hide
all the purple colors, and then we filter by garment, it could be that
there are garments that do not appear, because when filtering by color
they have already been hidden: if all the socks are purple, when we put
the color filter (hiding the purple ones) and then go to the garment
filter, the last one will no longer show socks, because they are all
already hidden.
The color of the cells can also be used as a filter, if they have one.
Lesson 3.3: Sort table elements
Another option we have when pressing the filter button is to sort the
column data. Depending on whether the column detects text or
numbers, the option to sort from greater to lesser or from A-Z (or vice
versa) will appear, and again we have the option of the color of the
cells (if they have it).
When there is a filter applied over a column the shape of the filter
button changes to what it looks like in the image (the right column is
the one with the filter applied), just as it also changes when the rows
are sorted (the middle column is the one that is sorted).
All the actions of putting a filter, sorting, etc. can also be done from
the "Sort & Filter" command in the "Editing" group of the "Home" tab.
Lesson 3.4: Filter by text
The last of the filter options we still have to see is the one that says
"Text Filters". This displays a menu with several options, of which we
have to select one, although all take us to the same screen, where we
can edit the condition without any problem.
“Or" function: the cells that meet either of the two conditions are
displayed. In the case of the image, if we put ">100" OR "<5000"
no row will be hidden, as all real numbers meet either of the two
conditions.
Lesson 3.5: Advanced filter
To use an advanced filter we have to go to the "Data" tab, group "Sort
& Filter", command "Advanced".
The filter table does not necessarily have to be above the data table,
but it is recommended for the following reasons:
With this example we can verify the fundamental difference with the
normal filters: in a normal filter if we had filtered these two colors
("Blue" and "Green") and this size ("S") only the lines of color "Blue"
and size "S" and the lines of color "Green" and size "S" would be
shown. With the advanced filter we have been able to distinguish in
specific to show the lines of color "Blue" and size "S" and all the lines
of color "Green", regardless of size.
We can add as many filters as we want (adding more lines to the filter
table, if you run out of lines where to write remember how we inserted
rows in chapter 1), but every time we modify the filter table we will
have to use the "Advanced" command again.
Lesson 3.6: Statistical functions related to tables
When we deal with tables with a large number of data there are certain
mathematical and statistical functions that greatly facilitate the
obtaining of data from these tables, therefore, although we have not
yet gone through the chapter of functions, we will begin to deal with
some of the most important functions in the treatment of tables.
To see all the functions in Excel we can click on the “fx” icon next to
the formula bar, and the following window appears:
Here we can choose which category we want (mathematics, logic,
statistics...) or see them all at once. If we are not sure how the function
we want to use is called, it is quite useful, since all the functions are
grouped according to their category, but if we know how the function
we want to use is called, it will be enough to start typing in the active
cell an equal symbol ("=") and when we start typing the name of the
function, the names of the functions that start like this will appear.
The first function we are going to deal with in this lesson is a very easy
to understand function with very simple input parameters: the "MAX"
function, which, as you can imagine, compares the value of all the cells
in a range and returns the maximum of all of them. We write in the
active cell "=MAX" and as we write Excel will show us the functions
whose name begins in the same way. We can use the up and down
arrows of the keyboard to choose the function we want if it is not the
first one that appears in the list. Once our function is marked in blue
we press the "tabulator" key of our keyboard so that it self-completes.
At this point, it is advisable to press the "fx" icon next to the formula
bar and the window opens explaining which parameters are necessary
for the function and what each of them means, especially useful if we
are not very sure of the parameters needed to use the function.
Here we can read the description of the function, and as we go
positioning the cursor in each parameter will show us the data that we
have to introduce.
When introducing the data we see to the right the first values of those
that we have been selected, and just above the description we see the
result of the formula if we press "OK" at this moment.
All the functions named in the previous title have as parameters the
same as the "MAX" function: a range (or several) of cells to evaluate
and return the result.
Parameter 1, Range: “is the range of cells from which you want to
count nonblank cells”.
In this case the criterion is a text, since the column we want to count
contains texts. If we wanted to count sales over $5000, we would have
to select the sales column and as the criteria put ">5000".
All the functions named in the title require the same input parameters:
the range of cells to be evaluated and the condition for performing the
function.
Some of the mentioned functions also have the option to end the name
with "IFS", which gives us the possibility to set even more conditions,
not just one (e.g. COUNTIFS).
They both work very similarly to the function seen above. The first
asks for a range of cells as an input parameter and returns as a result
the sum of all of them, and the second does the same, but adding only
the cells that meet a certain condition.
The small difference is that here there are 3 input parameters, the
range of cells to evaluate to check whether or not the condition is met,
the condition itself, and the range to be summed if the condition is
met. There is one more parameter since it can be, as in this case, that
the cells we want to evaluate are not the same ones we want to add. We
want to calculate the total sales in Boston, so that's the criteria, and
the range to evaluate is the column with the name of the city, but what
we want to sum is the total sales, which is in a third column. In this
way, we have defined the three arguments of the function.
Function “SUBTOTAL”
Another of the most useful functions dealing with tables when filters
have been applied is that of SUBTOTALS, which performs different
functions (the operation to be performed is one of the input
parameters of the function) on the data that have not been hidden by
the filter.
This is very useful because, if you make for example a normal sum of
an entire table to calculate a total (sales of all products) and then use a
filter to see only certain elements (sales of all products in the Boston
store), the sum will continue showing you the value of the sum of all
values in the table (total sales), while the subtotal will only show you
the value of the sum of the elements that have not been hidden (sales
in Boston).
If there is no filter applied to the table, the sum of total sales looks like
this:
This function is very similar to the ones we have seen before, which
only perform the function if a certain condition is met, and the
subtotals do something very similar, since they perform the function if
the cells are not hidden by the filter (i.e., a condition that we have
introduced in the form of a filter). The difference is that with the
subtotals when we modify the filter we lose the condition, so we could
not use it to fill a table like this, for which we would have to use
functions.
The charts can be of multiple types (line, bar, pie, 3D) and can even be
combined among them, usable to represent any value we can imagine,
so by dominating this Excel option and combining it with cell formats,
we have completely gained the visual aspect of Excel sheets.
Lesson 4.1: Select data to create a chart
To create a chart with the world population from 1750 to 2017 we need
to organize the data into two columns containing the following data:
The year
Excel detects what type of data we are entering and shows us the types
of graphs that may best suit our needs.
To the left we see a column with all the charts groups in Excel, at the
top of the right we see the types of charts offered by the selected group,
and just below a preview of how our chart would look (if it can be
done, since there are charts that need data in a specific way and if they
are not so can`t be plotted).
Line: Similar to the previous one, but seeing only the maximum
points of each data, not the column filled below. It can also be
stacked and viewed in 3D.
Area: the same as the lines, but coloring the gap under the line.
X Y (Scatter): similar to the lines, but marking each point
independently of the others. It also gives the option to join them,
making them equal to the lines.
Combo: used to customize a chart with more than one data type,
to put each one with a different chart type, and on different axes
(main and secondary) if necessary.
Lesson 4.4: Combining chart types
In this section we are going to extend the use of the last type of charts
we have just seen: the combo.
To make a combo chart we need to have a data table with two columns
of data (at least), of which we are going to represent each one in a
different way in the graph, for example, one with a line and another
with columns.
Let's use this table as an example, which shows the evolution of visits
to a web portal over any year and the benefits generated by such visits.
The first thing is to think about how we want our graphic to be before
starting to make it:
We select all the data of the table, we use the command to insert a
chart and we select the last option of all: combo. The screen looks like
the image above, and from here we'll have to start changing so that it
appears as we described a few lines ago. In "Visits" we will have to
change the type of graph to "Line" and "Income" we will change it to
"Clustered Column". Finally, in "Secondary Axis" we will mark the box
for "Income".
The chart then appears as shown in the image, where in addition to
seeing the evolution of both sets of data throughout the year, we can
also see the relative difference between visits and income (I encourage
you to check how the chart would look if we had not decided to put the
benefits on the secondary axis, and serve as a reference when to use
the secondary axis and when not).
Not all types of charts look good when combined, for example, it
would not have looked good if in the previous example we had decided
to use a pie chart type to show the benefits, but it would be good to use
an area or scatter plot. The graphs that combine well are those that
share the advance of the axis as the value increases:
Column, line, area, X Y (Scatter): the value grows on the "Y" axis
of the chart.
Sometimes you could combine graphics that we just said don't go well,
but that can only be decided by the user through his own experience.
Lesson 4.5: Chart elements
If you have been trying to use several types of charts you may have
noticed that in some of them it automatically appears a title for the
chart and not in others, in some appears the legend of what represents
each color of the bars, lines ... and in others not and so on with several
more elements.
The best way to know what each one of these elements does is to
activate and deactivate them and see what happens, since they are very
simple elements that once you see for yourself you will know what they
are for, and you will have to be yourself based on your experience and
level of detail that you require, which must decide which elements to
show and which to hide.
Lesson 4.6: Format Axis
If you click on one of the axes of a chart and then right-click on the
same axis, a menu is displayed in which the last of the options is
"Format Axis":
Type: Used to change the type of chart we had initially chosen, for
example, if we want to move from a chart with several lines to a
combined chart. The screen is the same as the one that opens
when we create the graph for the first time.
In the left part we see the series of data that are represented in the
table, and in the right part the divisions of the horizontal axis. In the
case of the divisions of the horizontal axis we can only edit them to
select other different divisions (labels), while on the left we can add
new series (what we want to do in this case), edit the existing series
(for example, if we had added under the table another 12 rows with
data to show the following year), or remove a series (if we want to stop
representing it in the graph).
We create the new column in our data table, click on "Add", select the
title of the column as "Series name" and the range of data as "Series
values".
In this way we have been able to add a new set of data to a graph that
we had already created and formatted without having to create the
entire chart again.
The new series of data, "Users", I've decided to leave it with the line
chart type, but I encourage you to open the chart type editor again and
try the "Combo" options until you find the one that suits you best,
being able to change not only the new series, now you can change the
other two old series to accommodate everything to your liking.
Lesson 4.9: 3D charts
So far we've used various types of charts to represent various
situations, but we haven't come to use any 3D charts. We have done
this so that we can dedicate a lesson just for them.
Apart from data labels, legends, etc., based only on the visual
component, which of the two graphs is more visually clear?
The first of the graphs has too much perspective, and too little rotation
of the "Y" axis. The second one has less perspective and more Y-axis
rotation, as well as having rotated the X-axis to show the month of
January at the bottom.
This rotation of 3D graphics is done by right-clicking on the graphics
and pressing "3-D Rotation", which displays a menu with the special
options of 3D graphics.
The 3 kinds of spin that are fundamental to creating a good 3D graph
are the spin on the X-axis, the spin on the Y-axis, and the perspective.
There are some types of charts that do not allow us to change any of
these values, and we will have to make the most of the possibilities
they allow us.
As a tip, I'll tell you, take advantage of the rotation in your favor. As
you saw in the example above, in the first graph the month of April
seems to have a much larger percentage of the total than any of the
others, but if we look at it with a more realistic perspective we realize
that there is not that much difference with January, that is, we can use
the turn in our favor to focus on the data that interest us, and leave
other less relevant data in the background.
Section 5: Data Validation
Data validation is a tool used to prevent data from being entered that
the sheet creator considers to be "invalid" data in a cell or set of cells.
Invalid data can be fundamentally distinguished between two types:
When you enter invalid values in a cell with data validation, 3 things
can happen:
1. An error message appears and Excel does not let you enter the
data.
Now you can have the following question in mind: If someone has
entered invalid data on my sheet because I have decided to leave a
warning message or information instead of error, how do I know?
With the corresponding command, we will be able to mark with a red
circle all the cells where invalid data has been introduced, but that we
have allowed to introduce.
We do the same for the first cell of the "Material" column using as
validation the list of materials, we select the first cell of "Customer"
and "Material" and we use the autofill to apply the validation to all the
rows of the table.
Lesson 5.2: Limit the data entered
Another much less restrictive way to apply data validation is to use the
predefined Excel options to allow you to enter data that meets a simple
condition, such as the content of the cell being an integer (without
decimals), a number between two values, a text with a minimum and
maximum number of characters, and so on.
For all these options, when we click on one of them there are 3 fields to
fill in:
We must choose the limits of the condition we are going to establish
and establish them numerically.
Date: the value entered in the cell must be a date within the set
limits.
Text length: sets the number of characters the content can have.
We are now going to set a length limit for the text in the "Description"
column of our table, so that no text of less than 4 or more than 14
characters can be entered, so that there is a description of the element,
but it is not too long.
Lesson 5.3: Custom limits
Since Excel always offers us the possibility of using predefined options
to facilitate a task, it also offers us the possibility of establishing our
own criteria for data validation through formulas and functions.
To set our own custom limits to data validation, we must use the "Data
Validation" command and in the "Allow" drop-down list select the last
of the options: "Custom".
=isblank(A1)
=A1<>B1
Avoid repeating in range:
=countif($A$1,$A$2:$D$4)=1
=year(A1)=year(today))
=mod(A1,2)=0
=and(len(A1)=9,isnumber(A1))
=isformula(A1)
=exact(A1,proper(A1))
=exact(A1;lower(A1))
For now, we are going to use one of the functions we saw before to
avoid entering a higher price than any of those in the attached table in
the "Cost" column, the "MAX" function.
Select as active cell the first cell of the "Cost" column, press "Data
validation" and select "Custom". In the formula box write:
Being:
L6:L16: the range of cells in the attached table where the price of
the material is.
Obviously, this would have been done much faster using "Decimal"
validation instead of "Custom", this was just an example of how to use
custom validation with current knowledge of functions.
Lesson 5.4: Protecting a worksheet
Sometimes it may be necessary to lock all or part of the cells of a
worksheet or an entire book. This is done mainly for two reasons:
because we are going to send it to someone we don't want to change
anything or because there is a part of the sheet that seems empty, but
is really full of functions, which if modified unintentionally would
affect the behavior of our sheet.
First, we are going to use a very simple formula to fill in the column
"Total price". The total price is the multiplication of the cost per
square foot by the total square feet, i.e. the fourth column by the fifth
column. To enter this as a formula we select the first cell of the column
"Total price" as the active cell and type:
2. Click with the mouse on the first cell of the column "Cost".
4. Click with the mouse on the first cell of the column "Quantity".
In my case, the cost is in column "E" and the first row is 7, so the
formula is "=E7*F7".
We then use the autofill to apply the same formula to the whole
column; so all the "Total Price" cells multiply their unit cost by their
quantity.
At this point is when we have to think: "I've already filled in the
column with the total price, I don't want anyone else to write on it",
and that's when we use cell protection.
To know if a cell is locked we must press the right mouse button and
then "Format Cells". In the tab "Protection" there are two options to
mark:
Hidden: the cell looks like it normally does, but nothing appears
in the formula bar. This is useful if we are going to share the book
and the cell is the result of a function or operation that we don't
want anyone to know about.
By default all the cells of a sheet are locked, so we have to select all the
cells of the sheet (clicking on the corner between column "A" and row
1), enter the format and in the protect tab uncheck the option
"Locked".
Next, we select the cells that we are going to protect, those of the
column "Total Price", we enter to the format and we mark the option
"Blocked" (and the hidden one if we want to see how it works). With
this we have marked the cells as locked, but we have not yet protected
the sheet, so you can still write in the cells as usual.
Both the input and error messages are entered in the same way: select
the cell, open the data validation and go to the tabs "Input message"
and "Error alert".
These types of messages are not mandatory when applying data
validation, but they are really useful not only for other users, but for
ourselves as well, since it is quite easy to forget which cells we have
applied validation to and which type of validation.
Warning: the message that appears tells us that the data we have
entered is invalid, and asks if we are sure we want to continue. If
we click on "Yes", the value we have entered will be entered, even
if it is invalid.
In this way, we can decide whether to leave that value entered or warn
whoever entered that value that he has to change it.
Finally, to delete the circles, click on the third of the commands we
have seen: "Clear validation circles" to leave the sheet clean of circles.
Lesson 5.8: Other commands of the "Data tools" group
Text to columns: there are times when we have to use a data file, but
they give it to us in a text format, and when it is passed to Excel it
looks like this:
We know that it has the form of an Excel file, where the columns are
separated by the tab separator, but we have no way to use the file
because we only have one row of data, where all the columns form a
string separated by tabs.
To pass it to the format we need, we can use this command, which can
be found in the "Data" tab, group "Data Tools". Select all the data and
press the command. In the first screen we choose “Delimited” and
press next, in the second screen we select the type of separation, in
this case it is "Tab". We press next and in the third screen we press
finish.
Flash Fill: Detects a pattern that relates several cells and continues it.
For example, if in column A you have 10 names, in column B 10
surnames and in column C1 you write the name of A1 and the surname
of B1 all followed, the quick fill will write in column C the name and
surname together with all the other rows (it is hardly used).
Consolidate: used to group data from several data sheets into one
data sheet. It is little used as it is a static method (i.e., the results are
from the time the operation was made, if the original data changes the
results will not).
Section 6: Other Groups in the Insert and Page
Layout Tabs
In this section we are not going to deal with a specific topic that we can
divide into different classes, but we are going to see several of the
groups that we have been leaving aside in different cards in the
previous classes, mainly related to the visual aspect, but without
affecting the functionality at all, and practically without modifying any
cell.
Pictures
We can edit the size of the image with the white dots around it,
clicking on them, holding and dragging. We can also rotate the image
with the icon on top of the image.
If we want an edition of the most exact size we can press with the right
button and then in "Size and properties", and it will appear to the right
of the window a tab like the one of the image above. From this menu,
with the 4 tabs above, we can change absolutely all the properties of
the image. From left to right the tabs are:
1. Fill and line: to give background color and outline to the image.
2. Effects: from here you can apply all the effects that modify the
visual aspect of the image, such as shadows, lighting, 3D turns,
etc.
Online pictures
Shapes
When we click on it, a drop-down list will open showing the different
types of shapes you can introduce: lines, arrows, filled arrows,
rectangles, callouts...
When we introduce a form we have the options to modify it
completely:
As with the images, we have the white dots for the size, and the
rotation icon. In addition, yellow dots appear to modify the shape of
the arrow (use them to see what I mean), which in each shape will
appear in a different position.
As you may have noticed, when you have a form selected, a new tab
appears in the menu tabs: the "Format" tab. From it we can change the
colors, contours, thicknesses, etc. (these options are quite evident by
the name and similar to those of the images).
They're like shapes, but more complex and online. When selecting one
we can convert it into a form (to edit it better) with the "Convert to
form" command of the "Change" group.
Lesson 6.2: Sparklines
Sparklines are really similar to normal charts, with the difference that
it is inserted in a single cell, filling it completely, and the peculiarity
that there are only three types of charts to insert available. These
sparklines are inserted from the "Insert" tab, group "Sparklines".
To use them you can click on one of the commands directly, or select
the group of cells, then click on the command, and when we are in the
box where we select the destination, click on the cell where we want to
insert it.
When you select a sparkline, the "Design" tab appears, which offers
several options, such as changing colors, marking different points on
the sparkline, deleting it, etc.
These types of charts are very rarely used, but they are useful on
specific occasions, where we do not want to show a detailed graph but
a simple evolution, usually not of a single set of data, but of several of
them.
Lesson 6.3: Text and Links groups
In the "Insert" tab, there are two groups which, in most cases, are
usually accompanied by one another: links and text objects.
Equation
These equations are not solvable by Excel, but are only objects, such as
images or shapes.
Symbol
The print area is the area of the sheet that will be printed when you
use the print option (in the "File" tab). To set the printing area of a
sheet, select the group of cells you want to print and click the
command "Set print area", within the group "Page setup" in the "Page
layout" tab.) When doing so, no difference can be seen in the sheet,
but if we click on print we will see in the preview that the whole sheet
is no longer printed, but only the selection:
Normal: This is the default view of Excel, the one we've been
seeing all along.
On my sheet I have this table, with a lot of rows (105 rows), but on my
screen you only see 18 rows at the same time, and the total columns is
8 (A-H), but you only see 6 (A-F). If I want to see row 50 I have to use
the vertical scroll bar, and when I do I stop seeing row 1, so I don't
know what value is represented in each column. In this case, it would
be useful if the top row remained fixed, so that it would always be
seen, even if I scrolled on the sheet.
In the "View" tab, in the "Window" group, there is the "Freeze panels"
command:
Freeze Top Row: row 1 is blocked, so even if we go down on the
sheet with the scroll bar we always see the first row.
Let's now see the other options of this group less used, but also very
useful:
Hide: Hides the Excel book, so it doesn't appear in any of the tabs
on the computer taskbar.
Once we have created the header and footer we don't see it on our
sheet until we print it or switch to "Page Layout" mode of the "View"
tab, from which we could modify both elements.
As you may have noticed when you clicked the "Print titles" command,
a sheet with 4 tabs opens:
Sheet: from here you can set the printing area, have a series of
rows repeated on each of the printed sheets, and other aspects of
the sheet related to printing.
Section 7: Working with functions
In some of the previous chapters we have started working with the
formula bar by introducing simple mathematical formulas, such as
sums and multiplications, of numbers and other cells. Also in section 3
we came to use directly some functions related to tables, such as
"SUM", "SUMIF", "SUBTOTAL" and other mathematical and
statistical functions.
In this section we are going to use functions from all groups and we
are going to use the "$" symbol so that we don't have to write the same
function multiple times.
To see all the functions in Excel we can click on the icon "fx" next to
the formula bar. The formulas are grouped according to their category,
to be able to search them more easily in case of not being sure which
function we need to use.
When you select a function, a window opens where all the information
to use it correctly is shown:
The problem, as we saw in classes 1.6 and 1.7 (Clipboard and autofill
groups), is that when you drag one cell that refers to another, the
reference moves as many cells as the original cell, so the formula in the
cell "G8" is "=C8*F8", when we wanted it to be "=C7*F8".
To avoid that the references of the cells with functions move when
dragging the cell with the autofill we have to indicate in the function
which is the cell we want to "block", and this is done using the “$”
symbol. If in the formula of the first cell of the price in pounds (G7) we
introduce the formula in this way "=$C$7*F7", being C7 the cell where
the €-£ change is, and we drag again, this time all the operations will
be as we want: multiply the cell of its left by the value of the €-£
exchange.
What we just did with the "$" symbol was to "lock" the row and
column of cell C7, so when you copy that cell elsewhere, the reference
to cell C7 remains constant, instead of moving as many rows and
columns as there is a difference between the target cell and the source
cell.
The most usual and advisable thing is to write the formula for a single
cell and without blocking anything, that is to say, without including
the symbol "$" in any cell. Once we have verified that the formula or
function returns the expected result we will lock the necessary cells. To
do this, even simpler than typing the "$" in front of the row and
column, is to position the cursor in the formula bar in the name of the
cell we are going to lock and press the "F4" button on the keyboard.
With this the "$" will automatically appear in front of the row and
column. Pressing "F4" again blocks only the row ("$" in front of 7),
pressing it once again blocks the column ("$" in front of the "C"), and
pressing it again removes the "$" symbols.
Track precedents
Clicking "Track Dependents" does something similar, but the cells that
are marked are those that depend on the result of the cell itself.
Lesson 7.2: Using the $ accurately
Let's make a table with the multiplication tables from 1 to 10 to see
how the symbol "$" is used much more precisely than always putting
"$" in front of the row and column. The table we want to fill in is like
this one, where the white boxes multiply the blue factor in the left
column by the blue factor in the top row:
If "Factor" is in cell "A1", then the first blank cell will be "=A2*B1"
(remember that first we write the function and then we will lock). Let's
see what happens if we don't put any "$" symbol:
Each cell multiplies the value of the cell above it by the value of the cell
to its left, so the growth is exponential.
The second table we are going to calculate is this one, where as before
cell "B2" will be "=A2*B1", and what we have to block completely this
time is the reference to cell "B1", leaving the formula like this:
"=A2*$B$1", and we use autofill.
Now we are in a problem, since in the first table the cell "B2" was
"=$A$2*B1", while in the second it was "=A2*$B$1". This is how we
realize that we are blocking rows and columns without really having to
do it:
This way, if we use autofill to the right, the reference will still be to cell
"A2", because we have blocked the column, while the reference to the
upper cell will be changing, because we have not blocked the column
of "B1".
The formulas written below the table are those of the last row, while
the formulas to the right of the table are those of the last column, and
three checks of formula precedents have been added to easily see that
the result is the one we wanted.
Lesson 7.3: Name manager
We have seen how to leave in a single place of the sheet a value that we
are going to use multiple times in the same sheet. However, what
happens if we want to use that value on multiple sheets?
In principle, the easy answer is: exactly the same way. If we are on the
sheet "Sheet2", and we want to refer in a formula to cell "A1" on sheet
"Sheet1" we can start writing the formula normally and just as we
would select the cell on the sheet itself, we change sheets and click on
the cell. The formula will then look like: "=A1*Sheet1!A1".
We can add to this formula the symbols "$" where it corresponds, but
this solution is only feasible if we do not have to refer too many times
to data from other sheets. The optimal solution to this is to use the
"Name Manager".
We could also have changed the name in the name box, but then we
couldn't comment on the value.
In the first cell to fill (B5) we begin to write the formula, and when we
are going to write the name of the dollar-euro exchange, it appears as
the first option, with the comment that we have introduced in the
previous window.
We finish typing the name or press tabulator to finish entering
automatically. Then we use the autofill to apply the formula to the rest
of the cells, and since the value "E.USD" is not a formula, but a name,
we don't need to use the "$".
What we have done now is a very simple example, and it would not
have been really necessary to use the name manager, but imagine a
book with many pages, in which one of all those pages is dedicated
only to keep these constant values. It would be tremendously difficult
to have to be all the time changing sheets to select the value we want to
choose, and it is in this type of cases where it is really useful the name
manager.
Lesson 7.4: Use of Lookup & Reference functions
Of all the lookup and reference functions we are going to see 4 (ROW,
COLUMN, INDEX and VLOOKUP), and we are going to focus on the
last of them (VLOOKUP).
ROW
It returns the row number of the referenced cell. It is not usually used
alone, but in conjunction with other functions. The only input
parameter is the reference to a cell.
COLUMN
INDEX
Returns the value in the cell where the row and column specified as
input parameters intersect. It has 3 input parameters: the matrix
(range of cells to search, usually the entire sheet), the row number,
and the column number (it's a number, not a letter).
VLOOKUP
We want to look for the material in the array formed by the attached
table, and once found return us the text that is in the same row and in
the second column (the first column is the one that contains the own
searched value). We are going to open the arguments of the function
and introduce the parameters as we have just said:
Lookup_value: the cell with the material reference 111586.
When we accept the function in the formula bar, it looks like this: "
=VLOOKUP(C7;$K$6:$M$16;2;0)", and in the table we have the
result we expected.
You may have noticed that I didn't write the table as "J5:L16", but as
"$J$5:$L$16". This is because if I drag the cell of the function using
the autofill I don't want the reference to the table to move as well, but
the reference to the table has to be always the same. Most of the time,
the "Table_array" must be locked with "$", but it's always better to
think about it first.
To look for the price and add it to the table you will have to do exactly
the same, with the difference that this time "Col_index_number" will
be 3, since we are looking for the same reference, but the result we
want is in the third column of the attached table.
Lesson 7.5: Use of logical functions
Logic functions are those that evaluate a condition and return one
value or another depending on whether the condition is true or false.
Let's see the 5 most important and used logic functions (AND, OR, IF,
IFS and IFERROR).
AND
Checks if all the arguments entered are true, and if so, the function
returns the value "TRUE". If only one of the arguments is false it will
return the value "FALSE". Arguments are any condition that can be
evaluated as true or false, such as "8*3=24", "A1*7>50", "B2=Boston"
...
OR
Checks if any of the arguments entered is true, and if so, the function
returns the value "TRUE". If none of the arguments in the function is
true, it will return the value "FALSE". As before, arguments must be
evaluable as true or false.
IF
IFS
Checks whether one or more conditions are met, and returns the value
entered when the first true condition is detected. It is very similar to
the "IF" function, but since there are several conditions, each with a
result if met, care must be taken when entering the conditions, as the
result will be the first condition detected as true.
With this formula I want to check whether a certain task has been
done and whether it has been done on time.
1. The first condition assesses whether the actual end date is less
than the deadline, and then the result would be "On time.
3. The third condition evaluates if the task has not been performed,
and the result would be "Unfulfilled" (in the screenshot is not
seen because it does not fit on the screen)
IFERROR
Example (continuing with the table of tasks from the previous class):
If the first task (buy) and the second task (assemble) are completed,
show as a result the number of phase that make up these tasks (1st
stage) followed by the word "completed", if not show "Unfulfilled".
The first of the functions that we will use is the "IF". In the first
argument (the condition) we will use the function "AND", to check that
both boxes are marked with the X. The second argument, if the
condition is evaluated as true, we want to concatenate (function
"CONCAT") "1st stage" (in cell "E2") and "completed". The third
argument, if the condition is false, will show "Unfulfilled".
→ Si_false → “Unfulfilled”
The more functions we need to nest the greater is the need to make
this decomposition into pseudo-functions, and if we break it down so
much that it is still difficult to compose the function understandable
by Excel nothing happens, we do an intermediate step, two or as many
as necessary.
In this case it is not difficult to compose the whole function from this
pseudo-function, and the result is like this:
Lesson 7.7: Use of math & trig functions
The most important and used mathematical functions are those we
have already seen in the section on data tables:
Within the modification functions the most important and used are
these:
PROPER: converts the text, leaving the first letter of each word
capitalized, and the rest in lower case.
Within the information functions the most important and used are
these:
We can therefore get an idea of what pivot tables and pivot charts will
be before we even introduce them: they are elements whose
component values do not need to be completely modified by hand each
time we want to remake them, but they will adapt to our needs in a
much faster way.
Pivot charts are those charts that represent a pivot table, allowing
the same filters to be applied to the table.
Lesson 8.1: Convert a table into a pivot table
Suppose you have a table like the one in the image, in which you have
the raw data of the sales units of each type of car in 3 different
countries and in the 4 quarters of the year (the table is actually bigger,
this is just a clipping).
You want to make a table consolidating all these data, so that it can be
understood in a more visual way, since anyone who sees this table
does not understand anything because of the large amount of
unstacked data, but you are not even sure how you want to do it, in
addition to having to use many formulas of "SUMIF", "COUNTIF", etc.
and if in the end the table is not to your liking you have to remake it
whole.
With a table like this, in all cases, whether you know exactly what you
want to do or you're not sure what you want, it's best to create a
dynamic table from this table. To do this, just select a cell in the table
and use the command "Pivot table" from the "Tables" group in the
"Insert" tab.
Rows: when dragging an item here, all values not repeated under
this title in the original table will appear as rows. If we put
"Country" in "Rows", the table begins to form as in the image
below, and if we add a second field below its values appear under
each of the names of the first element. If we put "Quarter" under
"Country" the table would take the form of the image on the right:
Columns: when dragging an item here, all values not repeated
under this heading in the original table will appear as columns.
For the columns we are going to use the element "Car body",
dragging it to this field.
Values: the element dragged here will be the one shown at the
intersections of the rows and columns, adding if the values are
repeated.
By filling in these 3 fields the table can be considered as finished,
although there is a fourth field that is also useful: the filter. It works
like any of the filters we've used so far, we select the data we want to
show and the table automatically hides all the others.
Lesson 8.2: Design of a pivot table
When we create a pivot table it appears with a default format, but like
any other table, we can change its format completely through the
groups to modify the format of the "Home" tab (" Font", Alignment"
...), or, if we have selected at least one cell of that table, we can open
the "Design" tab and use one of the predefined designs.
From this same tab we can use the commands of the "PivotTable style
options" group to slightly modify the display (the action performed by
each command is explained by reading its name), but more
importantly, we can use the commands of the "Design" group to
modify the way the table is structured:
To update the table (recalculate it), use the "Refresh" command of the
"Data" group in the "Analyze" tab. This does not require anything else,
you do not have to select the data again, refill the fields of rows and
columns ... Just press the button, wait for Excel to recalculate and it is
done.
In the "Show" group of the same card, we can use these 3 commands
to show or hide these fields. To find out what each one is used for, it's
best to try them and see what changes on the sheet.
The last of the changes after the table was created affects the totals in
the table. If we click on the element that we have put in the "Values"
field, a menu is displayed, in which we can move this field element,
and there is also the option "Configuration of value field". From here
we can modify the function that is made on the totals, which by default
is a sum.
This affects both totals and subtotals, so if we want to put one function
in totals and another in subtotals, we have to do it by hand.
If you've noticed, pivot tables don't use all the data in the table and
hide the ones they don't need like filters, but only use the necessary
data. This means that we can copy and paste the table to modify it to
our liking, adding functions, removing values, inserting rows and
additional columns...
Lesson 8.4: Pivot charts
The pivot charts are exactly the same in their creation as the normal
charts, with the difference that they have filter buttons to be able to
modify the data shown from the chart itself.
Clicking opens the same insert charts menu as for normal charts, with
the difference that some of the chart types cannot be used for pivot
charts.
If we create a 100% stacked column pivot chart from the table above it
looks like this:
We can see how the horizontal axis has broken down all the quarters
for each country automatically, and that in several places in the table
we have filter buttons to select the values we want to show. When the
filters are applied they will also be applied to the table, so modifying
the graph means modifying the table, and vice versa.