IntroductionWelcome| 00:04 | Hi! I am Dennis Taylor, and I am pleased to
present Excel 2010 Advanced Formulas and Functions.
| | 00:10 | For many Excel users, the central focus of
what they do is writing formulas and functions.
| | 00:16 | If you really want to take advantage
of Excel's power, you need exposure to
| | 00:20 | its many functions.
| | 00:21 | Nobody needs to know them all, of course,
but just mastering the intricacies of
| | 00:25 | such vital functions as IF and VLOOKUP--
as well as the related MATCH and INDEX
| | 00:30 | functions--gives you enormous control
over your data, and opens the door to
| | 00:34 | creative data analysis and manipulation.
| | 00:37 | I'll start it off by showing you some
great shortcuts for building formulas and
| | 00:41 | functions, numerous variations on the
aforementioned IF and LOOKUP functions,
| | 00:46 | vital statistical and MATH functions,
and some DATE functions that could prove
| | 00:50 | to be indispensable.
| | 00:52 | I'll show you how TEXT functions
can help you clean up flawed data,
| | 00:56 | how powerful array formulas and
functions give you even more analytical
| | 01:00 | possibilities, and I'll show you how
to use functions in combination with one
| | 01:05 | another to achieve even greater power.
| | 01:08 | To become a proficient and more
confident Excel user, you need to know more
| | 01:12 | about formulas and functions.
| | 01:14 | This course is filled with tons of techniques
and tools to help you reach those objectives.
| | 01:20 | Welcome to Excel 2010
Advanced Formulas and Functions!
| | Collapse this transcript |
| Using the exercise files| 00:01 | If you have access to the exercise
files for this course, you can put them on
| | 00:04 | your Desktop--as I have--
or anywhere else you want.
| | 00:08 | Each file here--for example,
Chapter 5--has various worksheets in it that
| | 00:13 | corresponds with each
portion of each course lesson.
| | 00:17 | If you do not have access to these
files, you can follow along with your own
| | 00:21 | files as we proceed through the course.
| | Collapse this transcript |
|
|
1. Formula and Function Tips and ShortcutsUsing the entire row/column references| 00:01 | If you are working with large amounts
of data--as in the worksheet that we see
| | 00:04 | here called ColumnRef, it's
in the file called Ch 1 Tips--
| | 00:09 | as we look at the data here, and
it's about 700 rows worth of information,
| | 00:13 | it's not uncommon to want to see totals of
what's in each column--or at least certain columns.
| | 00:19 | Certainly one way to find this
information quickly is merely to click the
| | 00:23 | column letter. And I just click
column F as you can see here. At the bottom
| | 00:27 | of the screen, you will see the
Average salary, Count, Numerical Count,
| | 00:31 | Minimum, Maximum, and Sum.
| | 00:33 | Now these don't appear here by magic.
| | 00:35 | It's likely that you are seeing at
least some of them--possibly all of them.
| | 00:39 | If you right-click the Status Bar,
you will see a section here where these
| | 00:43 | various items here that are
tabulating the information are displayed.
| | 00:47 | If some of these don't appear very
useful to you, or if you are thinking you
| | 00:51 | wouldn't use them that often, just
uncheck them, and they won't be there
| | 00:54 | anymore. And you can, at different, times
change your mind about what's important.
| | 00:58 | I think the idea here might be which ones
would you like to see most of the time? Fine.
| | 01:03 | Now these will appear at the bottom of the
screen anytime you highlight two or more cells.
| | 01:09 | Many times, you'll just ignore what's there.
| | 01:11 | But there are also times when you
need actual formulas in a worksheet--
| | 01:16 | summary-type information.
| | 01:17 | For example, in column I, what we might like
to see here--because we use this list a
| | 01:22 | lot--the list will grow and shrink at
different times, and whenever we are
| | 01:26 | looking at the top portion of this
worksheet, we want to see Total Salaries in
| | 01:31 | Years, perhaps some Averages, and
maybe some other stats as well.
| | 01:34 | So let's set up a formula here to add up
these salaries. In other words, we don't
| | 01:38 | need to click on column F all the time;
| | 01:40 | this is going to be here consistently.
| | 01:42 | Easy way to do this is
with the AutoSum function.
| | 01:45 | You'll find it on the Formulas tab in
the Ribbon on the left side. Or on the Home
| | 01:49 | tab, you will see it on the
right side. There is AutoSum.
| | 01:52 | Click it once to save yourself some typing--
| | 01:55 | even though this function typically
does guess what you want to do. Here it's
| | 01:58 | not doing a good job of that.
| | 02:00 | We want to add up the data in column F.
| | 02:02 | Now the standard way to do this is
to start highlighting the cells here.
| | 02:06 | And surely you could imagine
situations where you are thinking, "Well I
| | 02:09 | have got 40,000 rows here.
| | 02:11 | This is going to take forever."
| | 02:12 | Well, rather than doing this, I am going
to press Escape. Start over here again.
| | 02:17 | Let's press AutoSum and simply click column F.
| | 02:21 | The notation F:F refers to the entire column.
| | 02:26 | Even F1 is relevant here.
| | 02:28 | We don't worry about it. Enter.
We have got our total. There it is.
| | 02:33 | And the function as we see
it here: short, quick, easy.
| | 02:37 | We didn't have to refer to cells F2
down to F783, or whatever it might be.
| | 02:42 | We didn't have to do any dragging.
| | 02:44 | We simply clicked column F. It works beautifully.
| | 02:46 | And certainly we could do this on other
columns as well. Here is AutoSum. For the
| | 02:50 | Years, click column E, and so on.
| | 02:53 | If we want averages, take advantage of
the fact that AutoSum is accompanied by a
| | 02:57 | drop arrow. We'll click it.
| | 02:59 | Let's choose Average this time.
| | 03:01 | We also have Max and Min out here.
| | 03:03 | We'll choose Average.
| | 03:04 | Once again, it's guessing
wrong. Don't worry about that.
| | 03:08 | We want the Average salary.
| | 03:08 | Let's click column F. Same thing with Years,
same thing with Performance; same general idea.
| | 03:15 | Now occasionally, but very rarely--and I
do use Excel a lot, and I almost never use
| | 03:21 | this--but you could imagine if we can
refer to an entire column, we can also
| | 03:25 | refer to an entire row.
| | 03:27 | I think you can see how ridiculous it
would be in this worksheet and in most
| | 03:31 | worksheets, but you certainly could
imagine situation where if you needed to
| | 03:35 | add up a bunch of columnar data out of row 11
here, you might choose AutoSum and click row 11.
| | 03:44 | It would look like that.
| | 03:45 | That is a valid construction. It wouldn't
make a lot of sense here, but in some
| | 03:48 | situations it would.
| | 03:49 | It means add up all the data in
row 11, all the numerical cells.
| | 03:54 | We wouldn't use that in this
situation really, but it's just to point out
| | 03:57 | that the construction is valid, and it will
save you time here and there, but very rarely.
| | 04:02 | The focus, again, in this particular
shortcut--and it saves you a ton of time--
| | 04:06 | it's just the idea that when you are
tabulating information in a column, there
| | 04:10 | are many times when you might as well
refer to the entire column, rather than
| | 04:14 | highlighting or typing in the addresses.
| | 04:17 | The other distinct advantage of this--
particularly if this list grows--we don't
| | 04:22 | have to rewrite any of these formulas.
| | 04:25 | This means the entire column F, down
over a million rows. If we take out rows, we
| | 04:31 | don't have to rewrite the formula.
| | 04:32 | We don't have to make any of those adjustments.
| | 04:35 | So this is by far the easiest
way to set up formulas for columns.
| | 04:40 | Now what if there is a total on the
bottom? I am going to press Ctrl+Down Arrow
| | 04:44 | here and put a total on
the bottom of the Salaries.
| | 04:46 | Just by clicking AutoSum twice. There we go.
| | 04:49 | That's one way to do it.
| | 04:50 | I'll press Ctrl+Up Arrow. We are back here.
| | 04:53 | You remember this total before?
It was 39,000,000; now it's 78,000,000.
| | 04:56 | So for the moment
obviously, this is not acceptable.
| | 04:59 | But you would know in a situation like
this that there is a total at the bottom.
| | 05:03 | So in these kinds of situations where
you needed to have the totals at the
| | 05:07 | bottom, it would be simply a
question of dividing this by 2.
| | 05:10 | A different scenario might play out
where you had interim subtotals, perhaps at
| | 05:14 | the end of each department, something like that.
| | 05:17 | If you have those in place without a grand
total, there too you would divide by two.
| | 05:22 | If you have a grand total as
well here, you'd divide by four.
| | 05:25 | So you would certainly have to
make some adjustments in those cases.
| | 05:27 | But again, the key idea here is in
formulas where you need to tabulate columnar
| | 05:32 | information, many, many times using the
entire column reference makes good sense.
| | 05:38 | It's fast, it's easy, and it's very
clear once you get used to the notation.
| | Collapse this transcript |
| Copying column formulas instantly| 00:01 | It's not uncommon when dealing with
large lists of data in Excel to have
| | 00:04 | formulas that need to be
copied through an entire column.
| | 00:07 | In column H here, we need an adjusted salary.
| | 00:10 | It's simply going to be the total
of current salary and the bonus.
| | 00:13 | So formula, one or many different
variations might simply be =G2+F2.
| | 00:19 | I am going to press Ctrl+Enter,
so the active cell doesn't move.
| | 00:22 | I am ready to copy this down the column.
| | 00:25 | And although we certainly can use copy
and paste techniques, by far the best
| | 00:29 | way to do this--that most people would agree on--
would be to drag the lower right-hand corner.
| | 00:34 | However, that's not going to be the fastest way,
| | 00:37 | particularly if this list is huge;
think of how long this might take if this is
| | 00:41 | thousands and thousands of rows.
| | 00:43 | If you excuse the bad pun for a
moment, this could be a real drag.
| | 00:46 | It might take a long, long time.
| | 00:49 | A much better way--and practically
flawless--is simply to double-click the
| | 00:54 | lower right-hand corner.
| | 00:56 | That corner, by the way, has a name.
| | 00:57 | It's called the fill handle, f-i-l-l handle.
| | 01:00 | I am going to double-click.
| | 01:02 | First question in your mind might be,
"Well, how far did this get copied?"
| | 01:06 | And did it really get copied?
| | 01:08 | Well we can look at the numbers in the
second example here, yes. 73,430 + 2,000.
| | 01:13 | We have got a new total.
| | 01:14 | This is working properly;
the formulas have been copied.
| | 01:18 | How far did this get copied?
| | 01:20 | A not so well known shortcut is Ctrl+Period.
| | 01:24 | I am going to press it now once.
| | 01:25 | You can see what happens: the active
cell is in cell H709--why only that far?
| | 01:32 | Scroll down a little bit.
| | 01:33 | That's the bottom of the list here.
| | 01:35 | Every time you press Ctrl+Period--if
you have got a highlighted range that is--
| | 01:39 | the active cell moves
around the corners of the range.
| | 01:43 | In this case, it's in a single column,
so it simply--in this case--tells us
| | 01:47 | quickly and easily the
extremities of this range.
| | 01:51 | Now what happens if we have other kinds
of data here? For example, what if you
| | 01:55 | forget? What if there is nothing in this cell?
| | 01:57 | I am going to press Delete.
| | 01:59 | In prior versions of Excel--I am also
going to double-click this section here
| | 02:03 | and press Delete to get rid of it--
| | 02:05 | in prior versions of Excel, if you
double-click the lower right-hand corner, if
| | 02:09 | there is an empty cell to the left, as
we see here, the formula would only go this
| | 02:14 | far. But here that's not going
to be the case in Excel 2010.
| | 02:17 | It goes down to the bottom of the list.
| | 02:20 | The change, and you want to note it
from time to time as you are using perhaps
| | 02:23 | different versions of Excel, as long as
there is other data off to the left, we
| | 02:28 | can see that this is a larger list.
| | 02:29 | We have data in other columns.
| | 02:31 | Now here and there, you might need to
experiment with that a little bit, but we
| | 02:34 | don't have to worry about
the empty cells to the left.
| | 02:37 | Let me press Ctrl+Z to do another Undo
here, and point out another aspect of this.
| | 02:42 | On purpose here, I am going to put in an
empty column to the left. And now I am
| | 02:47 | going to double-click. Nothing happens.
| | 02:50 | Same thing would have
been true in prior versions.
| | 02:52 | If there is data to the right,
however--I will just make up a heading
| | 02:56 | here called Tax Code, over a few cells I am
going to type in 5%, and press Ctrl+Enter--
| | 03:04 | what happens now if I double-click?
| | 03:07 | If the column to the immediate left is
empty, then the double-clicking technique
| | 03:12 | follows the column to the right.
| | 03:14 | Another aspect of this too is to press
Ctrl+Z to undo. What if we hide the column H?
| | 03:21 | Right-click Hide.
| | 03:23 | I am going to double-click here.
| | 03:26 | You see what's happening.
| | 03:27 | In prior versions, it would have worked
in the reverse way, so it's interesting
| | 03:31 | the way that redefined the use of this.
But the general idea--and the way this
| | 03:35 | is going to work most of the time and
for you--is when you got data lined up, in
| | 03:40 | this case we want to take out
that empty column, typical situation.
| | 03:45 | You need to copy information.
| | 03:46 | Now this does not need to be a formula,
although we are talking about formulas
| | 03:50 | and functions in this particular movie.
But whether this is text or a value or
| | 03:55 | in this case the formula, double-
clicking the lower right-hand corner takes us
| | 03:58 | to the bottom of the column.
| | 03:59 | And again, Ctrl+Period quickly
determine the limits of how far it was copied.
| | 04:05 | Unfortunately, there is no
corresponding shortcut for copying formulas across
| | 04:09 | a row, but rarely what you need to do
that across the thousands and thousands
| | 04:14 | of rows that you might need to use when
data is set up like this in the column.
| | 04:18 | So this is a great shortcut, and you
can use it even when you have got a small
| | 04:21 | amount of data. Even if it's only five or
six rows downward, make this fast and easy.
| | 04:26 | Enter the formula or text as needed,
double-click the lower right-hand corner,
| | 04:29 | and have it quickly fill in the remainder of
the column through the active part of your data.
| | 04:33 | It's a great shortcut.
| | Collapse this transcript |
| Converting formulas to values with a simple drag| 00:01 | If you've created formulas that
manipulate data on a worksheet, you usually want
| | 00:05 | to keep those formulas to provide the
paper trail that shows you where the
| | 00:09 | information comes from.
| | 00:10 | In this worksheet called ValueConvert,
in cell H2, we see a formula--and this is
| | 00:16 | copied throughout column H--that
simply provides a new salary here.
| | 00:20 | Now for the moment, we want to see the
current salaries, and we need to see the
| | 00:24 | mechanism here for creating
new salaries. And the Job Rating,
| | 00:28 | we're simply ignoring those who have a
job rating of one and taking the others
| | 00:32 | and giving them $1,000 per job rating.
| | 00:34 | So in the example here, this
person has a job rating of 5.
| | 00:37 | We see what's happening here.
| | 00:38 | It's four times 1,000, plus the current salary.
| | 00:41 | So there we see what's happening.
And, for example, in row 5, that person doesn't
| | 00:44 | get any salary increase at
all. Simple little formula.
| | 00:48 | Now formulas take up space, in the
sense take up time, in that they have to be
| | 00:52 | recalculated. And if this is a few
hundred rows, not a big deal--even a few
| | 00:56 | thousand. But we get into the tens of
thousands sometimes worksheets that have
| | 01:00 | formulas, it becomes a concern, and
sometimes you have to balance that
| | 01:05 | recognition with the rationale
you really need the formulas.
| | 01:08 | So what we're talking about here is the
idea that there will be situations where
| | 01:11 | either for purposes of saving time and
space or simply for clarity, you want to
| | 01:16 | get rid of the formulas but keep the results.
| | 01:19 | Maybe eventually these
salaries have been approved.
| | 01:22 | We don't need to understand the mechanism here.
| | 01:25 | Maybe what we really like to do is to
take these results in column H and put
| | 01:30 | them in column F and get rid of
column H. Maybe it's that end-of-year
| | 01:33 | adjustment here that we make.
| | 01:35 | So we could either double-click the
lower right-hand corner here or simply with
| | 01:39 | the Shift key held down, press Ctrl+
Down Arrow and highlight all of these.
| | 01:44 | So what is it that we want to do here?
| | 01:45 | In effect, we want to take formulas
and convert them into the results.
| | 01:51 | In other words, let's not make this
cell H2 consist of a formula anymore;
| | 01:56 | let's actually make it be equal to 61,520.
| | 02:00 | Now there are certain times when you
want to make the conversion right within
| | 02:03 | the cell itself, or possibly copy the
actual values, for example, into column
| | 02:10 | F. So let's take the situation where
we want to effectively move these into
| | 02:14 | column F. Now a simple move is not going
to work because we're moving a formula.
| | 02:20 | So I'm going to point to any edge--top,
bottom, left: doesn't make a difference--
| | 02:26 | and hold down the right mouse button
and drag these cells into column F. And as
| | 02:33 | I let go here, there is a choice
called Copy Here as Values Only.
| | 02:38 | So the 61,520 that we see
will end up in cell F2 as 61,520.
| | 02:46 | So we've moved those so-called new
salaries into column F. Now over here,
| | 02:50 | we've got old formulas and things to the left
over here we don't need. We'll get rid of this.
| | 02:54 | So we effectively have thrown that away.
| | 02:56 | Now a different approach to this--and
it's six of one, half-a-dozen of another--
| | 02:59 | is I press Ctrl+Z and return to the
earlier layout here. Here we are again
| | 03:03 | with these formulas.
| | 03:05 | If we wanted to, we could've
copy these formulas to themselves.
| | 03:09 | Now recognize too that what we're
doing is simply a shortcut for the longer
| | 03:13 | process of copying data.
| | 03:15 | We'll do it the longer way.
The data is highlighted. Here is a copy.
| | 03:18 | You can use Ctrl+C, Copy button, or
right-click > Copy, and now what? Paste >
| | 03:25 | Paste Special > Values.
| | 03:29 | I could have used one of those
buttons as well too. Values, this way.
| | 03:33 | So that's another way to do this.
| | 03:35 | Even faster, once you get familiar with
the concept--I'm going to press Ctrl+Z
| | 03:39 | again to undo--is simply to take this
list and with the right mouse button this
| | 03:44 | time, drag it off the
selection and then right back onto it.
| | 03:47 | So I simply dragged right and
left with the right mouse button.
| | 03:50 | I'm letting go. Copy Here as Values Only.
| | 03:54 | So in this kind of situation here,
maybe you will change the labels.
| | 03:57 | We don't want to keep both of these--
probably wouldn't forever. Possibly you've
| | 04:00 | hold on them for a while, but at some
point may we'll just, now since these are
| | 04:04 | no longer formulas, move this into
column F. You can do that with the right
| | 04:08 | drag and then a move. That's fine.
| | 04:10 | Now we'll get rid of this. So, a
couple of different approaches there.
| | 04:14 | Another situation off here to the right.
We probably would want to keep these
| | 04:17 | formulas, at least for a while, but if
the data is all old and we're finished
| | 04:21 | with this, everything has been verified,
| | 04:23 | let's throw away the formulas.
| | 04:24 | We need to keep the data.
| | 04:26 | These are all formulas that
subtract the two cells to the left.
| | 04:29 | This time I'll do it from the
bottom. Right-drag, down up,
| | 04:32 | let go: Copy Here as Values Only.
| | 04:36 | And one more quick one off here to the right.
| | 04:38 | Here I think you can see what would happen.
| | 04:40 | Nothing really wrong with these names,
but it would look better if they weren't
| | 04:43 | capitalized, so we'll simply use a
little function here called proper.
| | 04:49 | Double-click to copy this down the column.
| | 04:51 | We want to keep this data, but not the
data in column Q. With the right mouse
| | 04:55 | button, simply drag any edge on top of
the data in column Q. As soon as we let go,
| | 05:00 | Copy Here as Values Only.
| | 05:02 | Don't need these anymore. Delete.
So, fast, easy ways to convert formulas into
| | 05:08 | their actual results.
| | Collapse this transcript |
| Creating 3D formulas to gather data from multiple sheets| 00:01 | If you need to write formulas that
tabulate data from multiple sheets, you can
| | 00:05 | approach this as simply a formula-by-
formula construction or rely upon a great
| | 00:10 | method of tabulating by grouping
information on multiple sheets.
| | 00:15 | Now that's the mouthful.
Let's talk about a situation where we've got
| | 00:18 | worksheets like the one we see for Arizona data.
| | 00:21 | One sheet to the right is Nevada, Oregon.
And as you see the different sheets,
| | 00:26 | note that they have exactly the same
layout. And I've also set up a Summary
| | 00:30 | sheet, having the exact same layout--
column width might be different, but we see
| | 00:34 | the same layout in all situations.
| | 00:37 | Now you could imagine sheets like
this with names of separate months of
| | 00:41 | the year. Possibly, we might
have all the states here.
| | 00:44 | You could do this by regions, by
your sales tab--any number of different
| | 00:48 | scenarios whereby you've got multiple
sheets in the same workbook and you'd
| | 00:52 | like to tabulate information
perhaps on a summary sheet.
| | 00:55 | The summary sheet could be after or before
these. And let's show the basic way to do
| | 00:59 | this and then the simpler and better
way they will handle multiple sheets.
| | 01:04 | I'm going to go to the Summary sheet
here on the right and go to cell B4. And a
| | 01:09 | quick reminder again as I click on
the various sheet tabs here: B4 is the Disk
| | 01:13 | Drive Retail total for Arizona and
Nevada and Oregon and California and of
| | 01:20 | course, right here, Summary.
| | 01:23 | So one way to write this would be
to type the Equals sign, click on the
| | 01:28 | Arizona sheet and press B4. Now, you see this
building in the formula bar. Then put in a plus.
| | 01:35 | I'm going to do the same thing for Nevada,
| | 01:38 | each time clicking the sheet tab,
clicking the cell. In other words, I'm doing
| | 01:42 | no typing except for the plus. And then Oregon,
click there, plus California. Click there.
| | 01:50 | No final plus needed.
| | 01:52 | You see the formula.
| | 01:53 | I'm pressing Enter.
| | 01:54 | There is the result, and there is the
formula. And certainly nothing wrong with
| | 01:59 | that, and it makes perfect
sense if we're doing 2, 3, 4 sheets.
| | 02:03 | Beyond that though, I think you can
sense how this becomes unwieldy. And imagine
| | 02:07 | even doing this for 12 months and if
we're going to have eventually 20 states in
| | 02:11 | this list, or it may be all of the
states--all 50 of them--this is going to get
| | 02:15 | out of the hand and would take forever.
| | 02:16 | So although this is a valid, I'm
going to show you a better way.
| | 02:20 | You may know from working with multiple
workbooks and multiple worksheets that
| | 02:24 | you can select and change multiple
sheets simply by clicking on one sheet and
| | 02:30 | then either using Ctrl+Click on other
sheets or possibly--if we wanted to include
| | 02:36 | all series here--if I want to select
all the sheets from Summary all the way
| | 02:41 | back to Arizona here, I am pointing
toward the Arizona sheet at the bottom,
| | 02:45 | holding down the Shift key, and I'm
going to click, and we now see that all five
| | 02:50 | of these sheets are selected.
| | 02:52 | The word "Group" appears at the top of the screen.
| | 02:55 | So I'll just make a slight change here
and say that for all of these, maybe we
| | 02:58 | simply want to make a
column wider or insert a new row.
| | 03:02 | Just for the sake of argument here
I'm going to right-click on row 9 and
| | 03:06 | simply insert a row.
| | 03:08 | So that's happened on all five sheets at once.
| | 03:11 | But the main thought here was the
idea that we selected all of these, first
| | 03:14 | clicking on one sheet, and then using a
Shift+Click to pick up a whole series.
| | 03:20 | I am now going to right-click and ungroup
these and show a different summary formula.
| | 03:25 | It's going to tabulate the
data from all four sheets at once.
| | 03:28 | This time to make this simpler,
I'll just start with AutoSum.
| | 03:32 | There it is on the Home tab: AutoSum.
Nothing to put in there from the adjacent cells.
| | 03:37 | I know I want to select
those four sheets to the left.
| | 03:41 | I'm going to click Arizona. With the
Shift key held down, I'm going to click
| | 03:44 | California. And now I'll simply click cell
B3. And you can see in the Formula Bar,
| | 03:52 | even though you might not be
familiar with that notation,
| | 03:54 | we are about to add up all the different
B4 cells, Arizona through California, as
| | 03:59 | I press Enter. And there it
is: same total we saw before.
| | 04:03 | I'll double-click to copy this downward
and then drag this mainly to the right,
| | 04:07 | and this truly is a summary sheet.
| | 04:10 | Every one of these formulas here--whether
it's this one, that one, this one--I'll
| | 04:14 | just double-click here to show you, and
all of these are adding up data on all
| | 04:18 | four sheets, Arizona through California.
| | 04:21 | In this case, it's cell D5.
| | 04:23 | It doesn't make any difference
| | 04:24 | how many sheets we have here. And if
we really did have all 50 states, fine.
| | 04:28 | If they've been alphabetized, this
would probably read, for example, "Alabama:
| | 04:33 | Wyoming," and it would
include all the sheets in between.
| | 04:37 | Now once you have these set up, you
don't want to be altering the order of
| | 04:41 | either the first or the last sheet.
| | 04:43 | And if you were to move one of these
two inner sheets out of the mix, their
| | 04:47 | totals would not be included,
but the formula wouldn't change.
| | 04:49 | So you have to think this out a little bit.
| | 04:51 | In some cases, if you're adding lots of new
sheets, you might tack them onto the end of here:
| | 04:56 | you might have to rewrite your formula,
But if you insert new sheets between
| | 04:59 | Arizona and California, you do not
have to rewrite the formula; the summary
| | 05:04 | information still works.
| | 05:06 | These kinds of formulas are usually
referred to as 3D formulas, and they save you
| | 05:11 | a ton of time. And once you get used to
how to read them, they make great sense.
| | 05:15 | And they're easy to construct.
| | Collapse this transcript |
| Updating values without formulas| 00:01 | You can easily update certain kinds
of data without using formulas at all.
| | 00:05 | In this worksheet called NoFormulas,
in columns A through F we see data for
| | 00:10 | projection data for various states
over the next 12 months. And let's imagine
| | 00:15 | that whoever came up with these
values used some kind of an index.
| | 00:18 | They used maybe a hand calculator.
And you realize--or this person has told you
| | 00:22 | perhaps--that these numbers are all off by 10.
| | 00:24 | They don't know what original data had been.
| | 00:26 | You simply want to make all these bigger by 10.
| | 00:30 | Well, without formulas, let's
just put a ten in a cell nearby.
| | 00:34 | We'll later erase this.
| | 00:35 | We'll put a 10 here and simply copy it:
right-click > Copy, Ctrl+C, whatever.
| | 00:41 | Highlight the data in question, then
right-click > Paste Special and choose in
| | 00:46 | the Paste Special dialog box, Add.
Double-clicking it makes it slightly faster.
| | 00:52 | Keep an eye on one or two of the
numbers, but all of them are about to be
| | 00:54 | incremented by 10, just like that.
| | 00:55 | We can get rid of that 10.
Just click and press Delete.
| | 00:59 | We don't need it anymore.
| | 01:00 | These cells do not have formulas in them.
| | 01:03 | So if you need a paper trail, this
particular set of actions doesn't help.
| | 01:07 | But if don't, it simply incremented
all the values by 1. And as you saw in
| | 01:12 | the dialog box, we also had other kinds of
arithmetic applications as well, like a subtract.
| | 01:18 | If we change our minds about this and
maybe something else occurs so it's
| | 01:21 | too late to do an undo,
| | 01:23 | we could easily select this data, copy
a 10 out of a cell and do a subtract to
| | 01:27 | take them back what they had been.
But after a certain point in time, however,
| | 01:31 | you would not remember what the data had been.
| | 01:33 | So this certainly has its merits.
| | 01:35 | Another variation on this might be a
situation over here in column W where
| | 01:39 | maybe you just want to
change all the salaries here.
| | 01:42 | We're going to adjust all the salaries
by 1,000. Simply add a thousand to them.
| | 01:46 | So what are we going to do here? Just
put 1,000 into an empty cell somewhere.
| | 01:50 | Let's just copy this 1,000: right-click > Copy.
| | 01:54 | We're going to select all this data here.
| | 01:56 | This time we'll do it a different way:
Shift+Ctrl+Down Arrow. Select all that
| | 02:00 | data, right-click > Paste
Special. Paste Special.
| | 02:05 | We'll simply add. Double-click. There we go.
| | 02:08 | All those numbers are
bigger by 1,000. Fast and easy.
| | 02:12 | Now I'm on a totally different kind of scenario.
| | 02:14 | Here is a list of data, and it is
unrelated to that first list that we saw.
| | 02:19 | Maybe this represents the actual
2010 values, or maybe this is a copy of
| | 02:23 | something you have either on
another worksheet or in a portion of this.
| | 02:27 | You'd like to experiment with these
numbers and show how they might project
| | 02:30 | into say 2011, and you want to show the 2011
numbers as being 10% bigger, 12% bigger, whatever.
| | 02:37 | So if you thinking about the math here,
you could imagine multiplying these by
| | 02:41 | 1.1 if you want to make this be 10%
bigger. Or if you wanted them all to be 5%
| | 02:47 | bigger, you multiply them by 1.05.
| | 02:48 | So, either do the math in your head
or on paper, but let's say we want to
| | 02:53 | multiply all of these by 1.1 to show
how they will look if they were 10% bigger.
| | 02:59 | So I'm going to put 1.1 into an empty cell.
| | 03:02 | We will, of course, have decimals involved here.
| | 03:04 | We might need to make some
adjustments to the formatting of this.
| | 03:06 | Now the ones you could do in your head
would be the ones, for example, like this 32.
| | 03:10 | We're going to add 10%.
| | 03:10 | So that's going to go up
by 32. That will go to 352.
| | 03:14 | So you know, keep your eye one or two of them
you know for sure what the answer should be.
| | 03:19 | So we're going to copy the 1.1--as
we did before--highlight the data in
| | 03:25 | question, right-click > Paste Special
> Paste Special, and simply Multiply and
| | 03:32 | we see what's happening.
| | 03:33 | Now the decimals are there.
| | 03:34 | We probably would want to show them, but
there is that entry that adjusted here.
| | 03:38 | These are 10% bigger than they had been,
so by choosing the Comma button in the
| | 03:44 | Number group on the Home tab, probably
the fastest way to do it. You probably
| | 03:47 | don't need two decimals here.
| | 03:49 | We'll decrease those,
readjust the column width, and so on.
| | 03:52 | The main point though, is we adjusted all
these. These are all 10% bigger than they
| | 03:56 | had been because we multiply
everything by this value here.
| | 04:00 | We don't need this anymore.
| | 04:02 | Once again, as in the previous
example though, if you somehow need a paper
| | 04:05 | trail, this is not the feature for
you. But if you need to make quick
| | 04:08 | adjustments to data by changing them in
a consistent way, figure out what that
| | 04:12 | multiplier is, what that divisor is,
what the add-in is going to be, and so
| | 04:17 | on and then simply use this technique
with Paste Special to increment, or change,
| | 04:22 | all the values at once.
| | Collapse this transcript |
| Displaying and highlighting formulas| 00:00 | If you're trying to figure out what's
going on on a worksheet that you haven't
| | 00:03 | seen in a long time--or maybe never--it
would be really helpful if you could get
| | 00:07 | a handle on the formulas. Where are they?
What do they look like? How many are there?
| | 00:11 | So there are two techniques we
can use here. They're complementary.
| | 00:15 | One will actually show us every cell
that has a formula in it by showing the
| | 00:19 | formula instead of the result.
| | 00:21 | Now if I click on cell B7, for example here,
I can certainly see in the formula bar that
| | 00:27 | that's a formula. I could also
double-click in the cell.
| | 00:29 | But we are only seeing one formula at a time.
| | 00:32 | So then we need to do this at times.
And of course we always keep an eye on
| | 00:36 | formulas in worksheets.
| | 00:38 | Let's expose all of the
formulas at the same time.
| | 00:42 | Now, let me zoom on this cell here to
get you oriented with the shortcut.
| | 00:44 | One of Excel's better keystroke
shortcuts is to hold down the Ctrl key and then
| | 00:50 | click the key that has tilde on the
top and an accent grave, as it's called in
| | 00:55 | French, on the bottom.
| | 00:57 | Some workbooks and Excel itself
will tell you this is the keystroke
| | 01:00 | shortcut, and that's fine.
| | 01:02 | That's actually accurate.
| | 01:04 | But a lot of us see this,
and then we say, "Well, I guess.
| | 01:06 | I am not sure what that means.
Is that the apostrophe?
| | 01:09 | Is that near the Enter key?
Well, which one is this?"
| | 01:11 | It's on the key that has the tilde with it.
| | 01:14 | Now I often refer to this when
teaching a live session.
| | 01:17 | I say use Ctrl+Tilde.
| | 01:20 | Do not use the Shift key.
| | 01:21 | This key is typically on the
upper-left corner of your keyboard.
| | 01:24 | Now what does it do?
| | 01:25 | Let me zoom back a little bit
with Ctrl and the mouse wheel.
| | 01:29 | When you press this button,
one of two things happens.
| | 01:32 | It either--as it will the first time--
double the width all columns and wherever
| | 01:37 | there is a formula, like in
B7 and B10 down below here,
| | 01:41 | we see the formulas instead of the results.
| | 01:45 | You see there in D13 also in E13.
| | 01:47 | The reason the column widths are doubled
is because we have a greater likelihood
| | 01:52 | of seeing the actual formula
| | 01:54 | because they tend to be wider
than cell what's usually are.
| | 01:57 | Well, this isn't perfect.
| | 01:58 | For example, in D13 we are still not seeing
all of that, even under its normal display.
| | 02:02 | So if you wanted to print this,
that might be a good idea.
| | 02:05 | You could do that, readjust all
the column widths, and print this.
| | 02:09 | Now this is what we call a toggle
button, meaning if we simply press this
| | 02:14 | combination again--Ctrl with that key
that's got tilde on it--we simply revert to
| | 02:19 | the standard display.
| | 02:20 | So think of it this way.
| | 02:22 | I use this all of the time.
| | 02:23 | It's one of the first things I do when
I am looking at a worksheet that I can't
| | 02:27 | figure out what's going on
inside of it, like this one here.
| | 02:30 | What is this worksheet all about?
| | 02:31 | It's poorly laid out.
It needs some work.
| | 02:33 | It needs some realignment, some
adjustments, some clarification.
| | 02:37 | I am just trying to figure out what's going on.
| | 02:38 | I want to know and see the formulas.
| | 02:41 | You'll also find this in the Ribbon,
but depending upon your display, it
| | 02:45 | might not be so obvious.
| | 02:47 | On the Formulas tab, if you have a wide
display, and you are seeing the Ribbon
| | 02:52 | the way I am here, you do
see this Show Formulas button.
| | 02:56 | As I slide over this, notice the pop-up
tip below it: Show Formulas Ctrl+Plus.
| | 03:03 | And as you look at that there, that
symbol could hardly be smaller.
| | 03:06 | It does refer to that slanted
accent symbol, accent grave that we see.
| | 03:11 | Of course, it is correct, but yet a lot
of people see then is they just sort of
| | 03:16 | read through it, or it doesn't register.
| | 03:18 | If you have a slightly different
screen display and the Ribbon is displayed
| | 03:22 | in a more narrow fashion, as it might
be sometimes, you won't even see that
| | 03:26 | phrase, Show Formulas;
| | 03:28 | you'll see just the symbol. And that
symbol is pretty far removed from actually
| | 03:33 | suggesting what it does. And you could easily
overlook this feature this way. But let's face it.
| | 03:38 | Once you learn the keystroke shortcut,
I think you will find it really handy,
| | 03:41 | because it just, invariably--as I press
it again--reveals those formulas, helps
| | 03:46 | you figure out what's going on in a
worksheet, or if you just want to focus on
| | 03:51 | certain formulas: you see
them quickly and easily.
| | 03:53 | Again, it's not designed
in any way to do any damage.
| | 03:56 | It doesn't alter anything except look of
things, and you go right back to normal
| | 04:00 | with the same keystroke shortcut.
| | 04:02 | Now a companion to this--and
we could use on this worksheet;
| | 04:05 | I am actually going to use it on a
copy of the worksheet--is not a keystroke
| | 04:09 | shortcut, but it's a way to actually
highlight the cells that have formulas.
| | 04:14 | And a companion idea to this might be
to quickly highlight the cells that have
| | 04:18 | just values in them.
| | 04:20 | Here the feature is not so obvious, but once
your see it, I think you will use it a lot.
| | 04:25 | On the Home tab in the Ribbon, the extreme
rightmost button is called Find & Select.
| | 04:31 | Now before using this, you
want to click on a single cell.
| | 04:36 | If you highlight two or three or five or
more cells or whatever, the search will
| | 04:40 | only take place within the highlighted cells.
| | 04:44 | So, the counterintuitive idea here is to
click on one cell and then this feature
| | 04:48 | that we are about to use will
search throughout the entire worksheet.
| | 04:51 | So we want to click the Find & Select,
the binoculars button on the Home tab in
| | 04:57 | the Editing group, and choose Formulas.
| | 05:01 | So what's happened?
| | 05:02 | All the cells with formulas are highlighted.
| | 05:05 | I would suggest if you want to keep
those cells in your memory or remind
| | 05:09 | yourself where they are,
simply apply a color to them.
| | 05:12 | Maybe click this button. Or if you prefer
a different color, click the drop arrow
| | 05:16 | there on the Home tab, pick a different--
light color is preferable, highlight
| | 05:19 | the cells, and you
remembering why you highlighted them.
| | 05:22 | Those are the cells with formulas.
| | 05:24 | Now if I write a new formula here,
it's not going to turn that color. Or if I
| | 05:28 | erase one of these cells with the
formula, it's going to keep its color.
| | 05:32 | So, the feature as we use it here is
like a snapshot in time, and you will have
| | 05:37 | to make adjustments to it if you alter
the worksheet, in terms of its content.
| | 05:41 | Now a companion to this isn't quite so
easy find, but it too has merit, and
| | 05:45 | that's the idea of you might also
want to highlight the cells that have
| | 05:50 | values in them, because that helps you
figure out what's going on in a worksheet as well.
| | 05:54 | So using that same Find & Select button
after having selected only a single cell
| | 05:59 | within the worksheet, choose Find &
Select and here the choice--not nearly so
| | 06:04 | obvious--is Go To Special.
| | 06:09 | We want to choose Constants.
| | 06:12 | You may notice there when I choose
Constants that these boxes here that seemed
| | 06:17 | to be related to the formulas choice--and
they are-- are also related to the Constants choice.
| | 06:23 | Now lets say that we might not want to
highlight the cells with text or logicals or errors.
| | 06:29 | Let's uncheck those, and in effect
highlight the cells that have strictly pure
| | 06:35 | numerical values in them.
| | 06:37 | That's what this means, really. Click OK.
| | 06:40 | We see what's highlighted.
| | 06:41 | I am going to make those in
different color, maybe yellow.
| | 06:44 | So in this worksheet at the moment
the yellow cells contain pure numerical
| | 06:49 | values. The bluish cells contain
formulas. And again, as you make changes in
| | 06:55 | worksheet, in terms of content, you
might want to give it all the colors and
| | 06:59 | reapply these two features as needed.
| | 07:01 | Maybe long-term you will give rid to all
the colors eventually. But in trying to
| | 07:05 | figure what's going on in a worksheet
and get your bearings, it might be a good
| | 07:09 | idea to keep highlighted the cells with
formulas and then have a separate color
| | 07:13 | for the cells that have values.
| | Collapse this transcript |
| Simplifying debugging formulas| 00:00 | The more you work with Excel, the
more likely you are to encounter longer
| | 00:04 | formulas, like the one we were seeing in
cell F2 on the DebugFormula sheet here.
| | 00:10 | Now you might even have seen longer formulas
than this, but here is what happens sometimes.
| | 00:15 | You're not getting the answer you
expected. Maybe you are familiar with this
| | 00:19 | data and yet this formula right here
isn't giving you the answers you want.
| | 00:24 | I have a habit of zooming in on cells
where I want to make editing changes and
| | 00:29 | then double-clicking.
| | 00:30 | You certainly can do this in the
formula bar if you are comfortable with it,
| | 00:34 | but by double-clicking in a cell as
I'm doing here, particularly if you have
| | 00:38 | zoomed in, this is larger and clearer and
easier to see, and the color coding helps as well.
| | 00:43 | Now there's a technique that's
going to be really useful at that times.
| | 00:47 | Let's suppose that a portion of this
formula you want to know the answer before
| | 00:52 | actually seeing the entire answer.
| | 00:54 | In another words, what does this evaluate to?
| | 00:56 | So I am going to be highlighting
just these cells here and press F9.
| | 01:02 | While editing, F9 allow us to explore
interim results, or a portion of this.
| | 01:08 | Now maybe as I look at that I say, "Well, I
don't think that's going to be the problem.
| | 01:12 | Maybe it's the some of these
too that somehow is the issue.
| | 01:15 | I am going to highlight these two and press F9."
| | 01:19 | Well, maybe that's helpful, maybe not.
| | 01:22 | The point is you can do
this in pieces or in chunks.
| | 01:25 | Is it this product here
maybe that's part of the problem?
| | 01:28 | I am going to highlight that and press F9.
| | 01:32 | Now it's important when you do this to
recognize sometimes maybe that light bulb
| | 01:36 | just hasn't gone off, you haven't
figured out what's wrong, but if you press
| | 01:40 | Enter, it's as if you've altered
the formula to look like this.
| | 01:43 | So you don't want to be doing that, and if
you do, of course press Ctrl+Z to undo it.
| | 01:48 | So many times what you
will do here is press Escape.
| | 01:51 | Now when you're doing this editing,
and you do recognize that something is
| | 01:55 | wrong--maybe, for example, it was
this product here or maybe this whole
| | 02:00 | portion of it right here--
| | 02:02 | be sure that what you highlight by
itself could stand alone as a viable formula.
| | 02:08 | Now if I were to highlight this and
press F9, you get a message that's
| | 02:14 | completely misleading and not helpful at all.
| | 02:16 | This really isn't an error.
| | 02:18 | It's just that what I highlighted by
itself would not be a coherent formula.
| | 02:22 | So I want to just close this and
start over again, and maybe highlight this.
| | 02:28 | In other words, that by itself with equal sign
would be a viable formula. So I'll press F9.
| | 02:35 | And if that's helpful, I will say, oh,
yeah, I have to refer to another cell.
| | 02:38 | I am just going to hit Escape here and
maybe reedit again and maybe that should
| | 02:42 | have been an E17 or an
E16 or something like that.
| | 02:45 | In other words, use it as you need it,
and you can get those interim results
| | 02:50 | which are going to be helpful to
figure out certain kinds of formulas.
| | 02:54 | By the way, there's also a
technique in Excel called Evaluate Formula.
| | 02:58 | You'll find it on the Formulas tab.
| | 03:00 | You might have a look at this.
| | 03:02 | Now, I don't prefer this one,
although I think it has some merit too.
| | 03:05 | This shows you the formula in a
different way, and allows you to evaluate it
| | 03:09 | from left to right.
| | 03:11 | So if I press Evaluate now, it will
show me what E17 is actually equal to, and
| | 03:16 | now it moves over and highlights the E18.
| | 03:18 | I will press Evaluate.
| | 03:19 | Now, we can certainly do this with the
F9 key, but to me, with the F9 key you get
| | 03:24 | more flexibility to highlight the
portion of this that you want to see, rather
| | 03:28 | than doing this in a left to right order.
| | 03:30 | So I am simply going to
close this and ignore it.
| | 03:33 | So we've seen a method of doing this with
the F9 key that I think is more valuable.
| | 03:37 | Now here is another kind of formula here.
| | 03:39 | I am going to scroll over to display
it better. And even if you don't know
| | 03:42 | anything about the if function,
which we cover later in this course,
| | 03:46 | if you happen to see a formula
like this--I am double-clicking--
| | 03:49 | I think you want to throw up your hands and
possibly give up or start over or something.
| | 03:53 | Now maybe you were the one that wrote this.
| | 03:55 | So maybe you got some insight into it.
| | 03:58 | It's been a while since you looked at it.
| | 03:59 | If someone else read it, usually it's
going to take a bit longer. But what might
| | 04:03 | we do to figure out
whether this is working properly?
| | 04:06 | A formatting technique that you might
be familiar with if you are putting in
| | 04:09 | titles is that while typing titles
when you press Alt+Enter you introduce a
| | 04:14 | line break into a cell.
| | 04:15 | Now here we've got a long formula.
| | 04:18 | Now what if we were to have line
breaks here in front of the ifs?
| | 04:22 | So here is an if right here, the second one.
| | 04:23 | I am going to click right in front of it
after that comma there and press Alt+Enter.
| | 04:28 | I am going to do this right before
the next if and before the next one and
| | 04:33 | before this last one--and maybe even
in front of the first one there, right
| | 04:37 | after the equal sign. Alt+Enter.
| | 04:39 | That simply introduces a line break.
| | 04:43 | Now this does not change the content
of the formula at all, but it simply is
| | 04:48 | going to give us the same result.
| | 04:50 | However, it is easier to read.
| | 04:53 | I think you got a much better chance
of figuring out whether this logic is
| | 04:57 | working properly.
Should this formula be rewritten?
| | 05:00 | Well, based on the data at hand, perhaps.
| | 05:02 | That's not situation here that we
are trying to really focus on; it's the
| | 05:06 | idea that by a restructuring a formula,
by pressing Alt+Enter wherever you wish,
| | 05:12 | you can view this in a more
coherent way. And finally, just press Enter.
| | 05:17 | Now when you click back on this cell,
you might be a little surprised to see
| | 05:21 | nothing in the formula bar.
| | 05:23 | If you double-click here, you'll see
the whole formula. But something else you
| | 05:26 | can do as well to see this,
| | 05:28 | you can expand the formula
bar in couple of different ways.
| | 05:31 | You can simply put the mouse on
its lower border and drag downward.
| | 05:34 | You could do it that way.
| | 05:36 | If you press Ctrl+Shift+U,
it'll also expand the formula bar.
| | 05:41 | It might not expand it to
the depth that you wish,
| | 05:43 | so on the right-hand side you will
arrows over there, and you could explore
| | 05:47 | the function this way.
| | 05:48 | You'll also see a double
set of arrows on a right.
| | 05:51 | You can look at it line by line
this way or drag it downwards.
| | 05:54 | So you want to
experiment with that a little bit.
| | 05:57 | You don't necessarily need to
make this formula bar taller--
| | 06:00 | I think it's better to double-click in
the cell--but you certainly have that
| | 06:03 | as an option as well.
| | 06:05 | But it might throw you at first if
after adjusting by using these Alt+Enters as
| | 06:09 | I did here when you perhaps later you've
forgotten about that, you come back and
| | 06:12 | click on this cell, you're a little
surprised as you look in the formula bar.
| | 06:16 | That's why, again, I suggest double-
clicking in the cell to editing I think is the
| | 06:20 | best way--particularly if you have
zoomed in. You want this to be big and clear
| | 06:24 | and unambiguous as you view it on the
screen when you need to do debugging.
| | Collapse this transcript |
| Enhancing readability with range names| 00:00 | To provide greater clarity in worksheets
and to simplify the creation of certain
| | 00:04 | formulas, you need to know
something about the term "range name."
| | 00:09 | Now, the some worksheets might have
many, many range names; some, only a few.
| | 00:14 | I want to give you the pluses and minuses.
| | 00:17 | Here is the situation in column C.
Here is a formula here for a new salary for
| | 00:21 | just the first person.
| | 00:22 | If you work with this kind of data, you
probably know, or are familiar with, the
| | 00:26 | concept of an absolute address.
| | 00:28 | And we might need to make some changes
here to D1, how that looks, but let's,
| | 00:33 | instead of that, use a
range name for this cell here.
| | 00:37 | Now the idea behind naming a cell, or
group of cells, is that those names can be
| | 00:43 | used in formulas and many times
they clarify what a formula is doing.
| | 00:47 | So I am going to zoom in on this a bit,
so you can see it even clearer, and select
| | 00:51 | this particular cell right here.
| | 00:54 | What if, instead of using D1 here and
worrying about how to make it absolute--
| | 00:59 | make it relative, whatever--let's name cell D1.
| | 01:04 | The fastest way to name a cell--and
there are numerous ways to do this--is
| | 01:09 | simply to highlight the cell, or cells,
in question, and then to the left of the
| | 01:14 | formula bar, in the section referred to as
the Name Box as I'm sliding the mouse
| | 01:19 | over it here, simply click the down arrow.
| | 01:23 | Now you might not see anything here,
or you might see one or more range names.
| | 01:28 | There is one range name in this workbook.
| | 01:31 | It's called TaxTable.
| | 01:32 | For the moment we're not concerned
about it and what it means. But we want to
| | 01:36 | create a range name for this cell, D1.
| | 01:39 | Range names cannot have spaces in them,
| | 01:42 | they cannot begin with a number, and
take care so they do not look like cell
| | 01:46 | addresses, like D21, or E43,
or anything like that.
| | 01:51 | Typically, you wouldn't.
| | 01:52 | You want the name to be meaningful
and not necessarily too long, and you'll
| | 01:56 | see why in a minute.
| | 01:58 | So let's say that the name of this
cell here, this D1, might be a percent
| | 02:02 | increase, or percentage
change, something like that.
| | 02:04 | I want to type percent increase.
| | 02:06 | Now you can use upper and lower case.
| | 02:08 | You can also use the underscore
character to simulate the look of words.
| | 02:13 | So I'm using Percent there with a
capital P, and I'm going to use Increase with
| | 02:17 | the capital I. Just call it PercentIncrease.
| | 02:20 | So I've named to this cell.
| | 02:23 | Now had the name been there when I
wrote this formula here, I could have used
| | 02:27 | that term right here.
| | 02:28 | We could have typed it in.
| | 02:30 | And I can certainly type it in now.
| | 02:32 | If I've got a number of range names
and I want to pick them out of a list, I
| | 02:36 | can press the F3 key, click on the name in
question, click OK, and insert it that way.
| | 02:44 | If the cell in question is nearby and
it's got a name, I can just click on it
| | 02:47 | here, and we can put it in that way as well.
| | 02:51 | Now, obviously in this case the length
of the formula is longer, but it does
| | 02:55 | suggest what's going on more
clearly than a simple cell address.
| | 02:59 | And we'll simply copy this down a
column with one of the shortcuts we saw
| | 03:04 | earlier, by double-clicking.
| | 03:06 | So every one of these cells
here refers to PercentIncrease.
| | 03:10 | Now the downside of this could be
you're not the one who have made the
| | 03:14 | range name assignment,
| | 03:15 | you get this particular workbook,
you're looking here, and you happen to look
| | 03:19 | in the formula bar, or maybe double-click, and
you say, "I don't know what percent increase means?
| | 03:24 | I wonder what that means." What can you do?
| | 03:27 | Click the drop arrow in the Name Box.
That shows this all the range names in this
| | 03:32 | workbook. Click the one in question,
PercentIncrease. Click it. What does it do?
| | 03:38 | It highlights the cells that
comprise the range name. There it is, D1.
| | 03:42 | Now a minor use of this feature, and
almost beside the point when we're talking about
| | 03:47 | formulas, you can also use a range
name as a jumping vehicle, or as a go-to.
| | 03:52 | So at any time in this particular
worksheet, if you want to jump to a location, if
| | 03:57 | it has a range name, you can press F5,
double-click the range name in question,
| | 04:03 | like PercentIncrease, and
it takes us to that cell.
| | 04:06 | That's a secondary use of the feature.
| | 04:09 | You can also apply these in a
whole-scale kind of fashion.
| | 04:13 | Let's imagine in this list here what
if we need to use formulas in various
| | 04:18 | locations in this workbook, and in this
worksheet, or we need do essentially say
| | 04:24 | total for Pennsylvania or average for
Pennsylvania? What if we get somehow
| | 04:28 | assign PA as the range name for all of
this, and for the other states as well,
| | 04:34 | and possibly even at the same time
every time we use the word March in the
| | 04:39 | formula, have it
automatically refer to these cells?
| | 04:42 | In this case, we'll highlight the
entire group of cells here, and this time on
| | 04:47 | the Formulas tab, use the
choice Create from Selection.
| | 04:54 | Now we might use Top row, or Left
column, or both, depending up on situation.
| | 05:00 | In this case, we want to use both.
| | 05:02 | So I see the wording here Create
names from values in the Top row.
| | 05:08 | So we're about to create a range
name: CA and TX and FL and so on.
| | 05:13 | CA, for example, will
refer to this cells G2 to G13.
| | 05:17 | The word February we'll refer to the
cells G3 to M3. So we'll click OK.
| | 05:25 | So anywhere in this workbook if we
need a formula that's somehow refers to
| | 05:30 | example Pennsylvania's total--
no matter where it might be--
| | 05:34 | we could either type in or
by clicking here in there--
| | 05:36 | for example, "= sum(PA". Now when you
type that, you also see the range name in
| | 05:43 | your list of functions.
| | 05:45 | And we don't have to use uppercase here.
| | 05:47 | We can just type in "PA".
| | 05:48 | If it were longer, you might click on it
and press Tab; you can do it that way, too.
| | 05:51 | I'm just going to type PA and press Enter.
| | 05:54 | So what has it done?
I'll double-click to show.
| | 05:57 | Now, if you're not the one who has
created the name, and you see this, you are
| | 06:01 | scratching head saying, "I wonder what that means,"
| | 06:04 | I think you can see a potential downside here.
| | 06:06 | If you have lots of range names
within a worksheet, you're going to have to
| | 06:10 | remember what they refer to, or create
a list to show you what those names are.
| | 06:15 | So there are some pluses and minuses
associated with this, but there is a range
| | 06:19 | name now for every one of the months
and all the states, as we see here.
| | 06:23 | If you'd like to see those range names
on a worksheet, and maybe even put them
| | 06:27 | in a part of the worksheet that you
can refer back to a different times, go to
| | 06:31 | an empty portion of a particular
worksheet--and make sure you've get the rough
| | 06:35 | idea of how many you need here,
but this plenty of empty space here.
| | 06:38 | We will go into--on the Formula tab--the
Defined Names group here, Use in Formula,
| | 06:46 | at the very bottom, Paste Names.
And we can choose all these Paste List just
| | 06:52 | simply by clicking Paste List.
| | 06:54 | So there it is, and you may or may not
want to adjust the just column widths,
| | 06:57 | but it shows us the location of these.
| | 06:59 | Now, it does show them in alphabetical
order, which you might think is useful,
| | 07:03 | but when it comes to months or the
years, you might want to put them in
| | 07:07 | chronological order.
| | 07:08 | But anyway, we do see a complete list of
all the range names and what they refer
| | 07:13 | to. And by the way, usually you
don't see the word RangeNames here.
| | 07:16 | That's the name of the sheet--you see it at
the bottom--in this particular workbook.
| | 07:22 | So if this had been on the Arizona
sheet, we'd see the word Arizona there.
| | 07:27 | There is one other range name in this
workbook, and I'm not really going to
| | 07:30 | use it. But I just, again, want to
remind you that when you do see a list of
| | 07:33 | range names, and that will be quite a
bit larger in this list, click the drop
| | 07:38 | arrow here--the one that we had seen the
first time around, but we didn't point
| | 07:41 | to: PercentIncrease.
Well, that's the one we created.
| | 07:45 | How about TaxTable?
| | 07:47 | Click this. And what do we
see? There is TaxTable.
| | 07:51 | Maybe we're setting that up to be used
with salaries and calculations and so
| | 07:55 | on, but there is use of this too.
| | 07:57 | And you will see a use of this if
you take a look at the VLOOKUP movie in
| | 08:01 | this particular course.
| | 08:03 | So using range names, a decided plus
for clarifying and providing worksheet
| | 08:08 | documentation, a potential downside if
you use too many of them. But the main
| | 08:12 | point is it will make formula
writing in some cases easier and clearer.
| | Collapse this transcript |
|
|
2. Formula and Function ToolsReviewing function basics| 00:00 | The latest version of Excel, Excel
2010, has more than 400 functions.
| | 00:06 | The list has been expanded.
| | 00:08 | And anytime you need to use a
function, if you're not clear as to what's
| | 00:12 | available and the many functions that are
available in Excel, that is, you need to
| | 00:16 | go to the Formulas tab.
| | 00:18 | Now this is one of a number of
different ways to get a hand on what's available,
| | 00:22 | in terms of functions.
| | 00:24 | On the Formulas tab, in the Function
Library, you'll see major categories of
| | 00:29 | functions. Just picking any one of
these, for example, say Date & Time.
| | 00:34 | In Excel 2010, you will begin to
recognize the fact that there are some
| | 00:39 | new types of functions.
| | 00:40 | I won't go into these in detail right
now, but here is one: Networkdays.intl;
| | 00:44 | that's a new function.
| | 00:47 | Any of these that have dots in them are
likely to be new, and it's an expansion
| | 00:52 | of the capability of certain kinds of functions.
| | 00:55 | Now when you're trying to achieve a
certain objective and the formulas that
| | 00:59 | you're using just don't seem to work, or
you can't figure out how to make them work,
| | 01:04 | there are times when what you're trying
to do is already available as a function.
| | 01:11 | One example could be you're looking at
the salaries here, and you're familiar
| | 01:16 | with some basic statistics, you
certainly you have figured out how to do a sum,
| | 01:20 | an average, perhaps a median,
you want to a standard deviation.
| | 01:24 | Now the technique for doing that
isn't that involved, but it does involve
| | 01:29 | averaging these and then taking the
average difference between the each one in
| | 01:34 | the average and adding them
up and taking the square root.
| | 01:36 | I forget the details. You can certainly
put together a formula to do that manually.
| | 01:42 | But of course, many people know
that there is a function called
| | 01:45 | StandardDeviation.
| | 01:46 | So the question might be, how do you find it?
| | 01:49 | I'm still little surprised at the list
here that we don't see, at list initially,
| | 01:53 | statistical. But it is there, under More
Functions, and that would certainly be a
| | 01:58 | good place to look for a
function called StandardDeviation.
| | 02:03 | Now, it's probably not going to be
spelled that, but a good guess would be
| | 02:07 | it's going to begin with S. And it's just a
reminder as to how we find things in Excel.
| | 02:12 | This is certainly one way.
| | 02:13 | And as it turns out, we see a number of
functions that begin with STDEV, and sure
| | 02:19 | enough here is one standard
deviation based on an entire population.
| | 02:24 | You wouldn't be looking here unless
you have some sense of what this function
| | 02:27 | does, or some knowledge of standard
deviation, but it's up to you to decide
| | 02:31 | which one is the one you want to use.
| | 02:34 | These pop-ups, these descriptions here,
are rather extensive, and they tell us a
| | 02:39 | lot about potential
functions that we might be using.
| | 02:43 | So that's certainly available.
| | 02:45 | And don't overlook another possibility
for checking out functions: by clicking
| | 02:49 | the fx button in the formula bar,
| | 02:52 | you ultimately can get to the same
place that we just got to do, but perhaps
| | 02:56 | in a different way.
| | 02:57 | The approach here might be maybe
you start by looking at All functions.
| | 03:02 | Now, who knows where the functions going to be?
| | 03:06 | A good guess with standard deviation,
of course, is it would begin with S, even
| | 03:10 | if you didn't see the previous search
for it. But it's likely to be in here, and
| | 03:13 | sure enough, you'll find it here as well.
| | 03:15 | And what happens here when we click one
of these, we see a description below it,
| | 03:19 | not unlike what we saw earlier.
| | 03:22 | So we certainly see some of these here.
| | 03:25 | Another approach could be I'm not sure
what kind of a function it is, but maybe--
| | 03:30 | yeah, I will bet it's Statistical.
| | 03:32 | We could find it there perhaps more
readily because the list is smaller.
| | 03:37 | And a third way, if you didn't guess
what it began with, maybe type a brief
| | 03:41 | description. And if you type in "standard
deviation"--that's certainly the
| | 03:45 | thing that would make sense here--and click Go,
| | 03:49 | you're going to get an abbreviated list here.
| | 03:51 | Now that may not be as short as you want.
As it turns out, that's lengthier
| | 03:55 | than that I would want it to be.
But sure enough, here and there with certain
| | 03:59 | kinds of functions, you will get a
short list. And at different times,
| | 04:03 | I've found this to be very helpful.
| | 04:05 | If, for example, you were looking
for a function that would calculate the
| | 04:09 | monthly payment on a loan, you
might just type in "loan payment".
| | 04:15 | That might or might not be
enough to narrow it very much.
| | 04:18 | On the other hand, it looks like this
list is certainly shorter than the one
| | 04:22 | we saw. This is 15 or 20. But by
changing the wording here, maybe that will help.
| | 04:27 | Many times what you do next is
click here to get the brief description.
| | 04:30 | So you want to have the sense that you
can find functions, even if there is no
| | 04:35 | one around to ask, or if you don't
have a book that lists all of these.
| | 04:39 | And when you do find a function, too,
don't overlook Help on this function--
| | 04:45 | extremely valuable at times.
| | 04:47 | You can either get online or off-
line help and many, many times these
| | 04:51 | screens are valuable.
| | 04:53 | You'll notice also at the
top you can print these.
| | 04:56 | So in a certain sense, we're talking
about the basics of how to find functions,
| | 05:01 | find out what they mean, see some
of these, print out the help screen
| | 05:05 | potentially, or maybe even say, you know,
that's pretty close to what I want. Why
| | 05:10 | don't we right-click, press Ctrl+C
and then paste that into a worksheet?
| | 05:14 | You can certainly do that as well.
| | 05:16 | So there are quite a few approaches to
getting that cliched, "get a handle on
| | 05:20 | something," understand what
kinds of functions are available.
| | 05:24 | And certainly here and there,
you'll just make good guess, too.
| | 05:26 | I mean we don't necessarily have to be told.
| | 05:29 | We would probably make a good guess.
Just a little bit of knowledge would
| | 05:32 | suggest there is got to be a function
called median. Maybe I'll just type it in.
| | 05:37 | And sure enough, like a lot of
functions, that's going to work just fine.
| | 05:41 | Let's highlight this data.
| | 05:42 | I want to know the median value here. Good enough.
| | 05:46 | So whether you're typing in a function
name and making a guess or using fx or
| | 05:51 | using the Formulas tab, you'd
likely define the function eventually.
| | 05:56 | Another thing I want to point out here
too: if a function I'm about to try begins
| | 06:00 | with a letter S--or at least I think it does--
| | 06:02 | I'm going to type =. And regardless of
what the letter is, as soon as I press the
| | 06:07 | key for the first letter, I get a complete
list of all functions that begin with that letter.
| | 06:13 | And here it also, in occasions like,
type time saver too, I don't really want to
| | 06:17 | use Standardize. But if I do, I'm not
going to be typing it. I'll just click this
| | 06:21 | and press Tab, and it
pops it into place that way.
| | 06:25 | And then of course, as with any
function, once we have the function name and
| | 06:30 | parentheses, we do see the pop-up tip here.
| | 06:34 | And I would say that when you're
using functions that you have almost no
| | 06:37 | familiarity with, or maybe you
haven't seen in a long, long time,
| | 06:41 | it certainly is going to be helpful,
| | 06:44 | for example, to either press fx, and
read about the function possibly. Or, by
| | 06:50 | pressing OK, Excel will lead you
through the steps of putting in the arguments
| | 06:55 | in the appropriate places.
| | 06:57 | So take advantage of that.
| | 06:59 | It's certainly going to help for those
functions that you use only occasionally,
| | 07:02 | or maybe you've haven't
seen this in a long, long time.
| | 07:05 | It gives you that kick-start to remember.
| | 07:08 | So there is any number of different
approaches in Excel to get into functions.
| | Collapse this transcript |
| Using and extending AutoSum| 00:00 | For almost every Excel user, the most
commonly used function is SUM, S-U-M.
| | 00:06 | It's so frequently use that in Excel in the
Ribbon, we see a special button for summing twice.
| | 00:13 | We see it on the Home tab in the
Editing group on the right-hand side.
| | 00:17 | It's called AutoSum.
| | 00:19 | It's the Greek letter Sigma.
| | 00:21 | We also see it on the
Formulas tab, on the left side.
| | 00:25 | In both cases, there is a drop arrow
associated with it, which we'll also see in
| | 00:29 | a minute or so here.
| | 00:31 | The AutoSum button is designed to add
from the left or from above, and many
| | 00:37 | Excel users encounter it practically
on day one of Excel. We're in cell G2.
| | 00:42 | We want to add the cells from the left?
In either case, we can click AutoSum, and
| | 00:47 | Excel tells us what it's about to do.
| | 00:49 | And even if you were brand-new, in
terms of using functions, I think as soon
| | 00:53 | as you see what we're seeing here, you're
going to figure out what it's going to do.
| | 00:57 | It says SUM (B2:F2) and sure enough,
it's going to add up all those numbers.
| | 01:02 | And typically we do what?
| | 01:03 | We press Enter or we click the button again.
| | 01:06 | And it doesn't take you too long to get
confident with that, so that next time
| | 01:10 | around possibly if it's just a single cell,
| | 01:12 | why not double-click on
AutoSum: makes it a little bit faster.
| | 01:17 | Another thing we can do too, if we
want to total right here, we can certainly
| | 01:20 | do what we just did.
| | 01:21 | Again, Excel does sense numbers from
above and from the left, but you can also
| | 01:26 | highlight the data that
you want to have a total for.
| | 01:30 | And if there is a--as in this case, a
cell below that is empty, we can click
| | 01:35 | AutoSum once, and the total goes
below it. Or, slight different variation on
| | 01:41 | this--certainly not better,
but pretty much the same--
| | 01:43 | highlight these cells and include
the active cell there. Click AutoSum.
| | 01:49 | Occasionally, you will reach an
ambiguous situation. What if we want to add up
| | 01:54 | these cells here, we want to use AutoSum
right here, but there are numbers from above.
| | 01:59 | We click AutoSum. What happens?
| | 02:01 | Excel looks upward first.
| | 02:03 | We want to overwrite it. We simply
highlight these cells. Fast and easy.
| | 02:09 | A keystroke shortcut for this, by the
way, in all these examples is Alt+Equal.
| | 02:14 | And since often you're using the
mouse to move around, it isn't always the best
| | 02:18 | keystroke shortcut, but here and
there it is going to handy as well.
| | 02:21 | Now we might want to put totals on the
right-hand side here. And certainly one
| | 02:26 | way to do this, and a common way, is to
use AutoSum first in cell H12--nothing
| | 02:32 | wrong with that, of course--and then copy
it downward. You can do it even faster
| | 02:35 | with double-clicking.
| | 02:36 | So that's certainly a standard way.
But how about highlighting these ahead of
| | 02:39 | time first and then clicking
AutoSum once? That will do it.
| | 02:44 | And again, just to reiterate the
previous point, how about Alt+Equal?
| | 02:48 | Does the same thing.
| | 02:50 | We might just as easily want to put
totals here. Same general idea. AutoSum.
| | 02:57 | Could we put totals on the bottom and on
the right-hand side together? We sure can.
| | 03:02 | Highlight the data this way.
Press AutoSum or Alt+Equal. We're all set.
| | 03:08 | And in all these examples too, if
you wanted to do something other than
| | 03:12 | adding the cells--now that's not quite
as common as adding. But what if
| | 03:17 | we wanted to put in, for example, averages,
or we wanted to find the highest or the lowest?
| | 03:23 | Earlier I had alluded to the idea
that AutoSum, in both of its locations, is
| | 03:28 | accompanied by a tiny little drop arrow.
| | 03:30 | So let's imagine here we click that
little drop arrow and we see Average.
| | 03:35 | So what are we going to get on the perimeter
of the highlighted cells here at the bottom?
| | 03:39 | Averages. There we are.
| | 03:41 | So take advantage of that too.
| | 03:43 | Average is certainly very, very common.
| | 03:46 | And Min and Max, high and low are
also out there. Maybe back up here,
| | 03:51 | we want to know the highest
AutoSum with its drop arrow. Max. Enter.
| | 03:58 | Fast and easy. Take advantage of the
fact that AutoSum has these other choices,
| | 04:02 | and you certainly can lead into
other Functions this way as well too.
| | 04:06 | I wouldn't say that's necessarily fast, but
again, it's a sensible way to get the data.
| | 04:10 | We want to do a standard deviation maybe here.
| | 04:13 | I'll get rid of these and these. Click
the arrow for AutoSum > More Functions,
| | 04:23 | Recently Used > All, click S, down to
standard deviation, and so on. Or variance--
| | 04:30 | whatever as you want.
| | 04:31 | So I'm not making a strong case or
saying this is the best way to do it, but it
| | 04:35 | does give you entry into
functions this way as well, too.
| | 04:39 | Maybe this way. Highlight
the cells and we're done.
| | 04:46 | So AutoSum and its companion features
provide you with some quick, easy ways to
| | 04:51 | get tabulation type data
into a worksheet quickly.
| | Collapse this transcript |
| Using absolute and relative references| 00:00 | Certainly one of the most common
things you do in Excel when working with
| | 00:04 | formulas is rather than putting in a
formula repeatedly across or down multiple
| | 00:09 | cells, we enter a formula once, as in
the example here--a simple little formula
| | 00:15 | to subtract the cells--and
then we copy the formula.
| | 00:19 | Now whether you have used the word or
not, most copying of formulas in Excel
| | 00:24 | involves the idea of a relative copy.
| | 00:28 | This formula literally says K2-K3.
| | 00:32 | When we copy a formula, we copy it
relatively, unless we take steps to do
| | 00:37 | otherwise: meaning we don't want to see
the formula K2-K3. It wouldn't make any sense.
| | 00:44 | We would have the same
answer as this. It's not true.
| | 00:47 | We automatically get a feature called
relative copying, meaning the column
| | 00:53 | letters have been adjusted.
| | 00:54 | If we move one column to the right our
column references have been adjusted by one.
| | 00:59 | If we had somehow moved this down and to
the right, the row references would have
| | 01:03 | become adjusted also.
| | 01:04 | It wouldn't make sense in this context.
| | 01:06 | And so whether we say the words or not,
relative copying is what we do most of
| | 01:11 | the time in Excel. But obviously there are
situations when this is not going to work for us.
| | 01:18 | And certainly one common example is
the situation we see in column C here.
| | 01:23 | We want to put in new sales here based
on a projection where we think--or we
| | 01:28 | hope, at least--everybody's sales are
going to grow by 3%. And to make this a
| | 01:33 | little bit more interesting, in column
F we have got a total right here of all
| | 01:37 | the entries in column B--the Actual
sales--and then in column G, although it's
| | 01:43 | empty right now, the reference. This
refers to column C, the empty column C for
| | 01:48 | the moment. And this is simply a
calculation between the difference, because we
| | 01:52 | want to see how much we've grown, at least we
hope so. Based on 3%, of course we will.
| | 01:57 | So a simple little formula here to
show the new sales is the actual sales
| | 02:03 | of this year times this percent,
and then we will simply add that on to
| | 02:08 | the original amount.
| | 02:09 | So this is one of three or four
different ways to write this formula.
| | 02:13 | And we may or may not want to keep the
pennies, but let's say we do for now.
| | 02:17 | We might not want to show them, so on
the Home Tab we will simply decrease
| | 02:21 | the decimals twice. There we go.
| | 02:23 | The real totals are there, by the way.
| | 02:25 | And to copy these down the column--well
before during that, we should do what?
| | 02:29 | Check out a few of these.
| | 02:30 | Just make sure our formula is working okay.
| | 02:33 | And immediately, we see that it's not.
| | 02:35 | These are the same. Only
the first one has changed.
| | 02:39 | So what's happened?
| | 02:40 | Here is our original formula.
| | 02:42 | If we copy this formula from row 2
to row 3, the references to the row
| | 02:47 | numbers all change.
| | 02:49 | These 2s will change, and this will
change. And sure enough--if we look right
| | 02:55 | here, I am double-clicking--the 2s
became 3s, the 1 that was up here becomes a
| | 03:00 | 2, and the percentage supposedly is
coming out of E2, but there's nothing there.
| | 03:04 | And I think you know for sure it would
be a lousy solution I have to copy the
| | 03:09 | 3% into all of these cells here.
| | 03:11 | What we really need here is
something called an absolute reference.
| | 03:15 | We do not want the
reference to E1 to change at all.
| | 03:19 | We don't want it to be a relative reference.
| | 03:22 | We want this to be absolute, and we
can either type Dollar signs or press F4.
| | 03:27 | Now when you are doing this, you can
click after the address, in front of it,
| | 03:31 | between the two, or highlight all of this.
| | 03:34 | And we could have done this, or you
could have done this, right after typing this
| | 03:38 | in the original formula. Just press F4.
| | 03:41 | By no means is this intuitive.
| | 03:43 | It just automatically puts in the Dollar
signs, which has nothing to do with currency.
| | 03:48 | It simply means if we copy this
formula, this reference does not change.
| | 03:54 | You could say that doesn't
mean anything until we do copying.
| | 03:56 | I am pressing Ctrl+Enter here,
so that active cell does not move.
| | 04:00 | I will drag this down a couple of cells, just
to check it out. Looks like that's working.
| | 04:05 | How is this one look?
| | 04:06 | There we go. The reference is to cell
E1 and will be repeatedly as we copy this
| | 04:12 | anywhere. And the fast way to copy
this down the column is to double-click.
| | 04:16 | And by the way, every time you do this, too,
it's a good idea to press Ctrl+Period
| | 04:20 | a couple of times to see
how far this has got copied.
| | 04:23 | You probably know your data ahead of
time to know how far it should be copied.
| | 04:27 | This simply confirms it. Ctrl+Period
moves the active cell around the corners of
| | 04:32 | the highlighted range.
| | 04:34 | This is an absolute address.
| | 04:35 | We absolutely have to have
it here, if you pardon the pun.
| | 04:38 | There is no other way to do this
sensibly. And you'll see absolute references
| | 04:42 | needed in many different Excel
worksheets. It's one of the basic things we need to
| | 04:47 | know about formulas before
copying them, an absolute reference.
| | Collapse this transcript |
| Using mixed references| 00:00 | In this worksheet, we need to put
formulas into these highlighted cells that
| | 00:05 | tabulate the percentages of the
various quantities that we see here.
| | 00:08 | For example, the descriptors in
column A refer to different web seminar
| | 00:13 | materials. Column B has the quantity.
| | 00:16 | Now we don't know necessarily if
these are books or DVDs or what, but we
| | 00:19 | have got 4,000 of these on hand, and
they have to be distributed to our
| | 00:23 | warehouses across the country.
| | 00:25 | And we have decided, for whatever reason,
that 20% of these need to go to the
| | 00:30 | East, 25% to the Midwest, and so on.
| | 00:33 | So writing a formula for one
cell is pretty straightforward.
| | 00:37 | Let's just--as we would typically do--
start in the upper-left corner and write a
| | 00:40 | formula to calculate 20% of 4,000.
| | 00:42 | Doesn't make any difference which of
these we use first, but we are simply going
| | 00:46 | to multiply the two. There we go.
| | 00:49 | But as we think about copying this,
a thought probably occurs to us.
| | 00:54 | We want our reference to C3 to remain
unchanged because if we don't, what does
| | 00:59 | this formula really do?
| | 01:01 | It multiplies the cell
above by the cell to its left.
| | 01:05 | That's the standard
relative reference that Excel uses.
| | 01:08 | And again, just to prove that, we
will copy down here the formula, and what
| | 01:13 | is this calculation?
| | 01:14 | We don't have enough room to see it.
| | 01:15 | We know that's not right.
| | 01:16 | Well, what's happening?
| | 01:18 | It's 800 times 9,000.
Obviously that's not what we want.
| | 01:23 | So one adjustment that we would make
here would be let's make our reference
| | 01:28 | to C3 right here be absolute, and
we can do that after changing this to C3 by
| | 01:34 | simply pressing F4.
| | 01:36 | There we go. Absolute reference. Copy
down here, and actually we should have
| | 01:42 | copied that upward to.
| | 01:43 | It work just fine there.
| | 01:44 | We are all set, right?
| | 01:45 | But we also want to copy this to the
right, and how does our formula read now?
| | 01:49 | We're saying, by using the absolute
reference here that if we copy this formula
| | 01:54 | to the right, it's going to always refer to C3.
| | 01:57 | No matter where we copy
it to, it will refer to C3.
| | 02:01 | But we don't it to refer to C3.
| | 02:03 | We then want it to refer to D3 and E3 and F3.
| | 02:07 | So, the not so obvious solution--but
once you see it, you will agree it works,
| | 02:11 | for sure--is the idea that sometimes
we want some of our addresses to be
| | 02:17 | partially absolute and partially
relative. And the term "mixed reference" is what
| | 02:22 | we typically use here.
| | 02:23 | Now imagine any one of these cells--
| | 02:25 | let's just pick one at random--
and answer the following question.
| | 02:29 | Where do the percentages
come from? Row 3. How about here.
| | 02:34 | The percentages we need here, it's
going to come out of row 3, any of these.
| | 02:38 | They are always going to come out of row 3.
| | 02:41 | Where do the quantities come from?
| | 02:43 | They always come out of column B.
| | 02:45 | So let's go back to that original
formula here and change it so that our
| | 02:50 | reference here is always to row 3, but
not necessarily to column C. In other
| | 02:57 | words, we don't want the Dollar sign in
front of column C. Now you can manually
| | 03:01 | remove these if you wish, but if you
have clicked to highlight all of this
| | 03:05 | address or click behind it or anywhere
in here, simply press F4 a few times. You
| | 03:11 | see what's happening.
| | 03:12 | This toggles through the
various variations here.
| | 03:15 | We want the Dollar sign in front of the 3.
| | 03:18 | Every cell here in this group needs to
get the percentages from row 3. Whatever
| | 03:24 | follows the dollar sign is the
portion of the address that's absolute.
| | 03:29 | And so on the B4 portion of this, you
want to press F4 repeatedly so it's
| | 03:33 | the Dollar sign is in
front of the B. There we go.
| | 03:37 | That's our master formula.
| | 03:39 | We can double-click to copy it downward.
| | 03:41 | We can copy this to the right. We are all set.
| | 03:44 | So after copying the formulas, of course--and a
lot of these we can do the math in our head,
| | 03:48 | let's just check out a few of
them, maybe double-click here--
| | 03:51 | we see what the formula is.
| | 03:53 | Of course, it makes sense, and there is that $3.
| | 03:56 | There is that $B. Try this on another cell,
| | 04:00 | say this one. Same general idea.
| | 04:02 | We always see Dollar signs in
front of the reference to row 3.
| | 04:06 | We always see dollar signs in
front to reference to column B.
| | 04:10 | Now if the numbers are a little different,
and we are dealing with certain kinds
| | 04:13 | of items, and this is almost a non-Excel
issue, but we might have to alter this--
| | 04:18 | what if this is really 4010?--
| | 04:21 | are we going to get whole number answers here?
| | 04:24 | We might not be seeing this.
Perhaps some of these are decimals.
| | 04:27 | So if these are DVDs, we can't quite
cut them in half or anything like that.
| | 04:31 | So probably an adjustment--and we can
make this relatively quickly--would be
| | 04:35 | to do rounding here.
| | 04:36 | So we can select all of these at
once. Press F2 and simply introduce
| | 04:41 | rounding right here.
| | 04:42 | We would want to round these
probably to the nearest whole number.
| | 04:46 | That would probably be the best way
to do this. So, comma, zero.
| | 04:50 | And by pressing Ctrl+Enter, all of
these will change at once. There we are.
| | 04:56 | And it could also to expose the
decimals here, at least momentarily,
| | 05:00 | so we can see that we don't
have any decimal portions left.
| | 05:03 | And again, we wouldn't
ultimately need to show that,
| | 05:05 | so go back or undo.
| | 05:08 | So the idea of a mixed reference,
although not nearly as commonly needed as an
| | 05:13 | absolute reference, will be needed from
time to time. And although not difficult,
| | 05:18 | it does throw--as they say it's kind of
a monkey wrenching to things. It takes
| | 05:22 | a little bit of time to used to this,
and I would never call it intuitive, but
| | 05:26 | it certainly works properly, and it's
exactly what we need in situations like
| | 05:30 | this: a mixed reference.
| | Collapse this transcript |
|
|
3. IF and Related FunctionsExploring IF logical tests and using relational operators| 00:00 | The IF function in Excel
has an important role to play.
| | 00:04 | It can be used in a very simple fashion.
| | 00:06 | It can become quite complex.
| | 00:08 | To me it represents kind of a
threshold function, in a sense that it opens the
| | 00:12 | door to new and more powerful uses of Excel.
| | 00:15 | It's almost programming-like in nature.
| | 00:18 | In this worksheet entitled SimpleIF,
we got a scenario set up where everybody
| | 00:23 | in this list is going to get a bonus--
| | 00:25 | well, at least some of the people are
going to get a bonus. And the essence of
| | 00:28 | the IF function in its simplest form is
simply to provide multiple answers based
| | 00:34 | upon a condition: a logical test.
| | 00:37 | In English, as we were looking at the
data here, we are saying the following:
| | 00:41 | in this organization, if your Job Rating
is 4 or 5--these are the better job ratings--
| | 00:47 | you're going to get a bonus; otherwise not.
| | 00:50 | We will talk about the amounts and
how we might vary it, but let's just
| | 00:54 | state that simple fact:
| | 00:55 | if your job rating is 4 or 5, you are
going to get, let's say a $1,000; otherwise 0.
| | 01:02 | Now we can use the Insert
Function button if we want.
| | 01:06 | This function, however, plays out
pretty easily and readily on the screen.
| | 01:09 | Let's remind ourselves too that when we
type "=i", we see all the functions begin
| | 01:15 | with the letter I. If, left
parenthesis, notice the pop-up tips here.
| | 01:20 | logical_test, what might that be?
| | 01:23 | There are lots of choices here.
| | 01:24 | In our particular example, we simply
want to look at the job rating right here
| | 01:28 | in E2. And you will notice in column H,
I put out here, for reference purposes,
| | 01:33 | the symbol that might appear next.
These are called relational operators: equal
| | 01:38 | to, greater than, greater
than or equal to, and so on.
| | 01:42 | If we would like to use any of these
symbols here that has two symbols, they
| | 01:47 | must be in the left to
right order as we see them here.
| | 01:50 | So one choice here could be if this
particular job rating is equal to 4 or 5, we
| | 01:56 | can put in the symbol
greater than followed by equal to.
| | 01:59 | You can't reverse the order of
those to get the same meaning.
| | 02:03 | So this is certainly one approach right there.
| | 02:06 | Other people would say, "Well why
don't we just say greater than three?"
| | 02:10 | In this case, it makes no
difference; either way will work.
| | 02:13 | Now this is one example of a logical test.
| | 02:16 | We are comparing a cell with a value.
| | 02:18 | At other times, you might be
comparing two different cells, or how about
| | 02:22 | comparing the value of a cell with a formula,
or comparing a formula with another formula?
| | 02:28 | In other words, there are quite a few
choices here in terms of what you might be
| | 02:32 | comparing within a logical test.
| | 02:34 | You can also test for text as well.
| | 02:37 | But in this example, that's our logical test.
| | 02:40 | Now as soon as I put in the comma, you
will notice that the bold print below
| | 02:44 | will change into the next
portion of the IF function.
| | 02:48 | In its basic form, the IF function has
two answers: one for when the logical
| | 02:53 | test is true, one for when it's not true.
| | 02:56 | This example here, the value is 1,000.
| | 02:59 | Now, even though we see the word value
there, don't limit the options here to
| | 03:04 | a single typed in value. What we might
have here as a result could be a formula
| | 03:11 | or it could be a reference to another
cell that has a value in it or it could
| | 03:15 | be reference to a cell that has text in it.
| | 03:18 | And if we want to put text here as an
answer, we can do that as well too, as long
| | 03:22 | as we embed it within double quotes.
| | 03:24 | So maybe that's what we would like to
do for the answer for when it's false.
| | 03:27 | Now again, as soon as I press comma, you will
see how the bold print shifts to this portion.
| | 03:33 | Let's say the answer is a 0. We could put in 0.
| | 03:36 | If we want to put in a text display, the
display is nothing instead of 0. Double
| | 03:43 | quote, double quote. That will display nothing.
| | 03:46 | If we want to put in an entry
that says No Bonus, do it this way.
| | 03:51 | Now you will notice also that I made
the column wider. The column ultimately
| | 03:55 | will not need to be this wide, but in
order for us to see the function as we are
| | 04:00 | preparing it, that's why I made it
plenty wide here. But that's not necessary.
| | 04:04 | Do we really have to put it
in the right parenthesis here?
| | 04:07 | If we have only a single set of
parentheses--as many functions do--we don't have
| | 04:12 | to type the final closing
parenthesis; simply press Enter.
| | 04:15 | So in the first case of course, based
on our rules, this person gets no bonus.
| | 04:20 | Every time you are trying functions of
this type, until you get more familiar
| | 04:23 | with them, we want to test
them out on a few cells as well.
| | 04:26 | So I will drag it down here.
| | 04:27 | So many, many times as I press F2,
looking at just the first one here, the IF
| | 04:32 | function can be simple,
| | 04:33 | it can be straightforward,
and it gets the job done.
| | 04:36 | Now again, we would
eventually make the column narrower.
| | 04:38 | This is one option, one
approach to the IF function.
| | Collapse this transcript |
| Creating and expanding the use of nested IF statements| 00:00 | In its basic form, the IF function
provides us with two different answers.
| | 00:05 | However, you may have a situation where you
need to provide three answers or four answers.
| | 00:11 | In this worksheet called NestedIF, we
want to introduce the idea that you need
| | 00:15 | to sometimes expand the IF function to
provide more than simply two answers.
| | 00:21 | In this particular organization, a
bonus is going to be provided for people who
| | 00:25 | have a job rating of 4 or 5.
| | 00:27 | Say that's going to be $1,000.
| | 00:30 | But we are also going to provide
bonuses, at least initially, for the people who
| | 00:34 | have a job rating of 3.
| | 00:35 | That's going to be a different bonus.
| | 00:38 | And for the moment let's say no bonuses
for the people who have job rating of 1 or 2.
| | 00:43 | So let's start off with the simple idea:
=if. Again the basic structure provides
| | 00:48 | us with three arguments: a logical test,
the answer for when the test is true,
| | 00:53 | and the answer for when the test is false.
| | 00:55 | Simple basic starting point here is
to click B2 or type it. If it's >3, the
| | 01:03 | answers is going to be $1,000.
Now, even though you can't visit or watch a
| | 01:09 | function as it's being performed, you
could say that the logic right now for
| | 01:14 | this cell B1 is jumped over the 1,000.
| | 01:18 | It's waiting after the
comma to decide what to do.
| | 01:22 | What we want to check now is to
see if this rating is equal to 3.
| | 01:28 | So here's an IF again inside of an IF.
| | 01:30 | It's called the nested IF.
| | 01:32 | So at this point, we are only
considering--and you could imagine how this will
| | 01:36 | play out in different cells--
| | 01:38 | we are only looking at
those job ratings 1, 2, 3.
| | 01:41 | Now we are trying to check to see if the
job rating equals 3, and if that's true,
| | 01:48 | our answer is going to be say 500.
| | 01:51 | If it's not true, in other words if B2
happens to be equal to 1 or 2, then our
| | 01:56 | answer is zero in this case.
| | 01:58 | So we need a right parenthesis, which
must be typed here to conclude this inner
| | 02:03 | IF, and we need another right
parenthesis for the outer IF.
| | 02:06 | This is a nested IF.
| | 02:08 | So, a little more involve now.
| | 02:09 | We have got three possible
answers: 1,000, 500, or zero.
| | 02:14 | I am going to press Ctrl+Enter so that
the active cell does not move downward,
| | 02:19 | and then double-click the lower right-
hand corner to see our results here.
| | 02:23 | And eventually, the column will be made narrower.
| | 02:26 | Simply here we do want to see the
function as we look at it, as I press F2, so we
| | 02:31 | can see all of it more clearly.
| | 02:33 | And we are going to expand this as well.
| | 02:34 | So you see the results here.
| | 02:36 | In every case where the job rating is
4 or 5, the bonus is 1,000, but if
| | 02:41 | it's not, the logic checks to see if the
entry is equal to 3. And if it is, we can
| | 02:46 | provide a bonus of 500.
| | 02:48 | Now even though you might quibble
with the idea that people who have a job
| | 02:51 | rating of 2 here are going to get a bonus,
| | 02:54 | let's insert that into the function as well.
| | 02:57 | So in the inner IF here, where we
see 'if B2=3, the result is 500',
| | 03:04 | if it's not, instead of providing a 0
after this comma right here before that
| | 03:09 | final 0, let's put in another IF to
check to see if this cell equals 2. And if
| | 03:18 | it is, we will give these people
a token $100 bonus. Comma. If not, a 0.
| | 03:24 | So here's as IF inside of an IF,
inside of an IF, and in earlier versions of
| | 03:30 | Excel, the most nested IFs
you could have would be 7.
| | 03:33 | Now imagine that. Here are two of
them, and it's pretty unwieldy.
| | 03:37 | Maximum seven in prior versions.
In Excel 2007 and in Excel 2010, maximum
| | 03:43 | 64, believe it or not.
| | 03:46 | Now I wouldn't wish that on anybody, but
nevertheless, you can provide additional
| | 03:51 | nested IFs as needed. And now we have
four possible answers. And as I press
| | 03:56 | Ctrl+Enter, we will see some
adjustments here and the results nesting.
| | 04:01 | And by the way, you can do nesting
with other kinds of functions as well.
| | 04:05 | It shouldn't be set out as a goal, but
on the other hand, you do need certain
| | 04:09 | answers at certain times, and this
ability to nest functions will work for you.
| | 04:13 | I would suggest too that when
you're doing something like this that you
| | 04:17 | essentially move either left or right,
or top to bottom. That might vary the way
| | 04:21 | you think of these entries, but we're
dealing with--over here--the 4's and the 5's
| | 04:26 | then the 3's then the 2's and then
ultimately the 1 that gets 0 here.
| | 04:31 | So you could certainly approach
these from the other direction, but this
| | 04:34 | certainly makes sense here.
| | 04:36 | But don't reverse the order of the logic.
| | 04:38 | You want it be real clear how this is working.
| | 04:41 | We have got four possible
answers now by using nested IFs.
| | 04:44 | This is two nested IFs.
| | Collapse this transcript |
| Using the AND, OR, and NOT functions with IF to create compound logical tests| 00:00 | If you need to use the IF function in
conjunction with different columns in a
| | 00:04 | worksheet, sometimes you need to
create what's called a compound condition.
| | 00:09 | In English, lets say the following:
| | 00:11 | We wanted to give a bonus to people on
this list here who have a job rating of 4
| | 00:15 | or 5 and who have a status of being full time.
| | 00:20 | In other words, only full-time people
are eligible for a bonus, but they must
| | 00:24 | also have a good job rating.
| | 00:26 | So there is a function in Excel called
And. There is a similar function called Or.
| | 00:33 | Sometimes these functions can stand alone.
Sometimes they can be used with other functions.
| | 00:38 | Many different kinds of functions can be nested.
| | 00:42 | The If function by itself, which is
quite powerful, doesn't really give this
| | 00:47 | capability that we are looking for by itself.
| | 00:49 | So in English, we like to say, again, if
your job rating is 4 or 5, and your status
| | 00:56 | is full time, we are going to
give you a bonus; otherwise not.
| | 01:01 | I'm typing the word "And" right now,
and you might be saying, "Well, yeah but
| | 01:04 | shouldn't that go between the conditions?"
| | 01:07 | Well, let's say we might like it too, but
that's not how was function works.
| | 01:11 | We want to state now not just
necessarily two conditions, but maybe three,
| | 01:15 | maybe four, maybe five.
| | 01:16 | So let's put in the first
condition that we mentioned.
| | 01:19 | It doesn't make any difference to the
order of these, but let's indicate that
| | 01:22 | we want the job rating here to be greater than 3.
Of course, that means 4 or 5 in this scenario.
| | 01:27 | We have only the ratings 1 through 5, comma.
The other condition that we are interested
| | 01:33 | in here is that the status
here be equal to ''Full Time.
| | 01:39 | And you want to make the entry here
exactly the way you see it in column D. Now,
| | 01:47 | the reason we don't put the word AND
between the two is that if we have a third
| | 01:51 | condition, a fourth condition, a
fifth condition, we simply use the comma to
| | 01:56 | separate those, rather than having to
putting the word AND over and over and over again.
| | 02:01 | So though it's most common to have
only two conditions, it's certainly is
| | 02:05 | possible to many more.
| | 02:06 | I believe it goes as high as 31 here.
| | 02:08 | I am going to put right parenthesis.
If both of these conditions are true, comma, the
| | 02:15 | answer is 1,000 and if
they're not, comma, the answer is 0.
| | 02:21 | Now that inner function, potentially stand-
alone function, has its set of parentheses.
| | 02:26 | We want to make sure that the outer set
matches. Always have the same number of
| | 02:31 | opened left and right parentheses.
Right parenthesis. Enter.
| | 02:36 | The answer here is 0.
| | 02:38 | This person has neither the
current job rating or the correct status.
| | 02:42 | Let's double-click and fill in the column here.
| | 02:43 | I think you can quickly see what's going on.
| | 02:46 | Those who get the 1,000, for example,
in row six here, Daniel White here has a
| | 02:51 | status of full time job rating of 4.
| | 02:53 | The person above, Bobby Mendoza, has a
good job rating, but isn't full time.
| | 02:58 | Person in row two is full time,
but not a good job rating.
| | 03:02 | Once again, as we look at the function
here for row two, we see how it's playing out.
| | 03:07 | And as you get used to these,
they make perfect sense.
| | 03:08 | They are not difficult to set up, but it
does make the function a bit longer looking.
| | 03:13 | And once again too, the column
here's wider that it ultimately needs to be,
| | 03:16 | but we want to see how the function
looks as we are preparing it here.
| | 03:19 | So it's a good idea to
temporarily make the column wider.
| | 03:23 | Now if the logic changes in the sense
that this organization says we are going
| | 03:27 | to give you a bonus if either your job
rating is good or your status is full
| | 03:33 | time, you might question the wisdom of
that. But we use the word OR here, and as
| | 03:38 | we change all these here,
I'm pressing Ctrl+Enter.
| | 03:41 | Now, the rules have changed so that if
either condition is true, the bonus of
| | 03:46 | $1,000 is awarded. And we see how this
is changing, and you could say this is a
| | 03:51 | more popular decision
here by management for sure.
| | 03:53 | Many, more people were getting the bonus now.
| | 03:56 | And here and there, you will run
into situations where maybe we have got
| | 04:00 | ANDs and ORs mixed.
| | 04:02 | What if we now say you are going to
get a bonus if either you have a good
| | 04:06 | job rating or you've got a combination of
full time and some many years of service.
| | 04:13 | I am going to put the word AND in here,
and within AND we want to put in comma
| | 04:21 | years. Suppose it's greater than 10
or greater than or equal to 10.
| | 04:26 | Now trying to say this in English
sometime, you will find yourself talking to
| | 04:30 | your monitor. What are we about to say here?
| | 04:32 | Either you have a good job rating,
so here is the Or, if this is true, or
| | 04:40 | you have a combination of these two
characteristics, two criteria here, your
| | 04:45 | status is full time, and
you've been here 10 or more years.
| | 04:49 | And again, on a case-by-case basis we can
look at some of these and figure out what's going on.
| | 04:54 | This person has a good job rating.
| | 04:55 | We don't care what the status
is. This person has a good job
| | 04:59 | rating. Automatically.
| | 05:00 | Now this person here doesn't have a
good job rating, but is full time and has
| | 05:05 | more than 10 years of service.
| | 05:08 | And so, you can check these
out one by one what's going on.
| | 05:11 | Here's a person who doesn't have a good
enough job rating but is full time but
| | 05:14 | doesn't have enough years.
| | 05:16 | And here and there, as you think
these out, you can get increasingly used
| | 05:19 | to structuring these.
| | 05:21 | If you encounter these suddenly out
the blue, they take a little bit time to
| | 05:25 | figure out, but there's quite a lot of
creativity that goes on here. And when
| | 05:29 | it's your data, and you really know
what's you want to do, these ring true
| | 05:33 | pretty quickly. You always want
to test them out on a few cells before
| | 05:37 | copying them down to the entire
column, like I have been doing here.
| | 05:40 | Now there is another capability in
here too that I would more or less steer
| | 05:44 | you away from, but from time-to-time,
you might want to use this, or at least
| | 05:47 | knows that it exists.
| | 05:49 | Sometimes you want to check for the
negation, or the opposite of a condition.
| | 05:53 | If we backtrack a little bit and
say we simply want to make sure that
| | 05:57 | everybody gets a bonus who is full
time but nobody else, the best way,
| | 06:02 | undoubtedly, would be to say you know
if your status equals full time then we
| | 06:07 | will give you a $1,000.
| | 06:09 | That's certainly would be
the best way to say this.
| | 06:11 | And that would be the
appropriate way to say it right there.
| | 06:14 | But if we were somehow put in this,
now this will definitely be awkward here,
| | 06:21 | and then reverse it--
| | 06:22 | now I think maybe I am loading this a
little bit in the opposite direction,
| | 06:24 | but I think you could see this would not be
the best way to do this, and yet this will work.
| | 06:29 | If it's not the case of someone who
is full time, the bonus is 0, but if it
| | 06:34 | is, it's 1,000. But occasionally you will see
that word, and of course that means negation.
| | 06:40 | A better way to do this possibly is to remove
this and change this symbol to be not equal to.
| | 06:47 | That's the less than arrow followed
by the greater than arrow, and take out
| | 06:51 | the parenthesis here.
| | 06:52 | So here is another way to do it.
| | 06:56 | So we see various uses here of using AND
and OR, but certainly less important the
| | 07:00 | not function, but certainly different
ways to structure a condition inside of an
| | 07:04 | IF function to give you
greater capability and creativity.
| | Collapse this transcript |
|
|
4. Lookup and Reference Functions Looking up information with VLOOKUP and HLOOKUP| 00:00 | Some of Excel's most powerful functions
are known under the heading LOOKUP functions.
| | 00:05 | They're widely used for looking up
information from tables, and these tables
| | 00:10 | might be in different worksheets--
maybe even in different workbooks.
| | 00:15 | In the setup in column G, on this
worksheet called Lookups, we're about to
| | 00:20 | figure out a tax rate here based on
information that we might see in a table
| | 00:25 | that looks like this, which is
oriented vertically, or in a table that looks
| | 00:30 | like this, which is oriented horizontally.
| | 00:33 | I think you can as you look at the data
back and forth here, these tables, in a
| | 00:38 | certain sense, are identical, and they
are in terms of content, but certainly
| | 00:42 | not in terms of layout.
| | 00:44 | In column G, if we'd like to figure out
the tax rate of the salaries that we see
| | 00:49 | in column F, possibly we
could use an IF function.
| | 00:53 | If you have used an IF function, I
think you know almost immediately how
| | 00:57 | unwieldy this would become.
| | 00:59 | The function would be horrendously long.
| | 01:02 | You'd have to have about 12
nested IFs to come up with all these
| | 01:06 | different answers here.
| | 01:08 | The VLOOKUP function, the HLOOKUP
function, which we're about to cover in detail,
| | 01:12 | both alternately perform the same task.
| | 01:16 | If you look at the salary in F2, which
is 41,639, you can see that that will
| | 01:22 | fall into place here between numbers.
| | 01:25 | The bigger issue though at first
though is, when you're setting up a
| | 01:29 | table, should you create vertically
structured table or a horizontally structured table?
| | 01:35 | In all my experience with Excel, and I
would imagine in most people's instinct,
| | 01:39 | if they happen to look at these two
together, I think immediately most people
| | 01:42 | would choose to lay out the data the
way we see it here in columns A and K--
| | 01:47 | in other words, vertically.
| | 01:49 | So the appropriate choice to be using in
column G here will be a VLOOKUP function.
| | 01:55 | However, in a worksheet that already
exists and maybe has some formulas built
| | 01:59 | into it already--maybe you inherited
this worksheet--there might already be some
| | 02:04 | functions that are using this table
here, either to look up data or for a
| | 02:09 | reference point, and maybe
you'll have to use the existing table.
| | 02:13 | But when you're laying out the data, I
think this is the much more efficient way.
| | 02:16 | Now, we're going to see in some
upcoming examples how most of the time tables
| | 02:21 | are two columns, but I wouldn't say it
is any sort of a rule, because in the
| | 02:26 | same worksheet, off to the right, even
know we won't be using this data, here's a
| | 02:29 | table over here that involves
calculating a tax rate by looking up information
| | 02:35 | in a table that includes quite a few columns.
| | 02:38 | It could even have more.
| | 02:40 | So don't in any way to limit yourself
to the idea of the tables that are used
| | 02:44 | for look up purposes or
only two columns or two rows.
| | 02:48 | But the initial idea here is when you
are setting up tables, you think about
| | 02:53 | which layout is likely to be best.
And I think most of the time it's likely to
| | 02:56 | be vertical. And that means that a
VLOOKUP is generally preferable to an
| | 03:01 | HLOOKUP, but sometimes you have to make
the adjustment and accommodate existing data.
| | 03:06 | So there are other possibilities
here as well for structuring this data.
| | 03:10 | There are two other aspects to LOOKUP
functions that we want to mention before
| | 03:13 | we actually try these, and that's the
idea that sometimes a LOOKUP is based on
| | 03:19 | finding data in what we call an
approximate way. We see the 41,639.
| | 03:26 | Are we seeing that number here?
| | 03:28 | Well, of course not.
| | 03:29 | It's highly unlikely, although possible,
that these salaries are going to match up
| | 03:34 | perfectly with the numbers.
| | 03:35 | We're trying to find
numbers that fall between others,
| | 03:39 | not trying to find them exactly.
| | 03:41 | On the other hand, there could be
situations where you want to look up data.
| | 03:45 | Maybe it's someone's name.
| | 03:47 | You need to find it in a list.
Or someone's Social Security number, you're
| | 03:51 | trying to look it up in a list.
| | 03:53 | In those cases, close enough isn't good enough;
| | 03:56 | it's got to be exact.
| | 03:58 | So, there are other kinds of LOOKUP
functions too, and they could be either
| | 04:02 | VLOOKUPs or HLOOKUPs, but sometimes
you need to take into account whether the
| | 04:07 | information has to be
found exactly or approximately.
| | 04:12 | Many times when we're talking about an exact
match, we're talking about text or ID numbers.
| | 04:17 | Excel has a number of LOOKUP
functions that allow us to find data based on
| | 04:23 | tables structured either
vertically or horizontally.
| | Collapse this transcript |
| Finding approximate matches with VLOOKUP | 00:00 | In column G of this worksheet called
ApproxMatch, we need to look up the tax rate
| | 00:05 | for this salary. Without knowing how
Excel or Excel's functions operate here,
| | 00:11 | just using your day-to-day knowledge
of how we tend to work with tables,
| | 00:14 | a salary of 41,639, as we're looking
at the tax table here in columns J and
| | 00:20 | K, 45,000 is too big.
| | 00:22 | This salary hasn't reached that.
| | 00:24 | So most people, as they look at this
would say, well, I guess the tax rate would
| | 00:27 | be 6%, and we're not going to
get into any issue of prorating here.
| | 00:32 | We want to use Excel's VLOOKUP
function here to look up information, for
| | 00:37 | example, from cell F2, and look
vertically in the left column of a table.
| | 00:44 | By definition, VLOOKUP means search
vertically in the left column of a table.
| | 00:49 | The table might be on this worksheet, in
another worksheet, or in another workbook.
| | 00:54 | Then the VLOOKUP function gives us the
opportunity to tell it which column has the answer.
| | 01:00 | So the table is not just the left
column of course, but the other column, and
| | 01:05 | possibly another and another column.
| | 01:07 | What we'd like to be able to do here,
as quickly as possible, is show how the
| | 01:11 | VLOOKUP function will find information.
| | 01:14 | Nothing will work smoothly if this
information is not in ascending order.
| | 01:21 | There are two basic kinds of VLOOKUPs.
| | 01:24 | The one we're talking about now is what
we sometimes refer to as an approximate
| | 01:28 | match, meaning we're not trying to
find this number exactly in the table.
| | 01:33 | We don't see that number there, but it
certainly falls between two others, and
| | 01:38 | because it hasn't reached this
level, we want our answer to be 6%.
| | 01:42 | For the next person here, makes
56,469, hasn't reached this level.
| | 01:47 | Therefore, it's going to be 8%.
| | 01:48 | Now, VLOOKUP essentially does all the work.
| | 01:52 | If we're trying to describe this function
as intuitive, that's really not very close.
| | 01:57 | This isn't really intuitive, but
it's relatively straightforward.
| | 02:01 | I'm going to type it, and we'll also
introduce the concept here or the idea that
| | 02:05 | perhaps a range name should be used with this.
| | 02:09 | The information is
structured in the appropriate way.
| | 02:12 | Anytime you're trying to use VLOOKUP
for an approximate match, the information
| | 02:16 | must be in ascending order if
you hope to get coherent answers.
| | 02:21 | The other columns might not be, but certainly
many times, as in this case, they are also.
| | 02:26 | So, in cell G2, we can simply
start with =vlookup, left parenthesis.
| | 02:33 | The first portion of this is
the value we're trying to look up.
| | 02:37 | It's cell F2, comma, the table_array--
these yellow cells here--comma. The next
| | 02:48 | pop-up choice, column index number,
isn't nearly so obvious, but it means the
| | 02:53 | second column of the table in this case.
| | 02:55 | We want to get our answers
out of the second column.
| | 02:59 | Now, we're not using an exact match here,
| | 03:01 | so we don't need this forth argument
that's referred to as range_lookup.
| | 03:05 | So we're not trying to do an exact match here.
| | 03:08 | The function is complete.
| | 03:09 | I'll just press Ctrl+Enter
here, and there's the answer:
| | 03:13 | it is 6%, as you would have expected.
| | 03:17 | It hasn't reached this value.
| | 03:19 | It's above 35,000, the answer is 6%.
| | 03:22 | If we hope to be able to copy this down
the column, I think a lot of you would
| | 03:26 | know here that we need to make the
reference to the table here absolute.
| | 03:30 | So certainly one way to do this would
be to highlight the address of the table,
| | 03:35 | press F4 to make it an
absolute reference, Ctrl+Enter again.
| | 03:41 | Then we can copy this down the column
either by dragging or double-clicking.
| | 03:46 | And so we have correct answers, and of
course, you always want to be checking
| | 03:48 | out one or two of them.
| | 03:49 | In every case here, that reference to the
table has remained constant or absolute.
| | 03:56 | In a strict sense, nothing wrong with
this, but if we give this table a range
| | 04:01 | name, it's going to provide better
documentation and make the function easier to use.
| | 04:06 | We'll simply highlight these cells.
| | 04:09 | The fastest way to apply a range name here is to
the left of the formula bar, in the Name Box,
| | 04:15 | we'll click the drop
arrow and type the range name.
| | 04:19 | The range name ideally
describes what we're doing.
| | 04:22 | It cannot contain spaces.
| | 04:23 | So, TaxTable right there.
| | 04:27 | We see that in J2, but that's just coincidental;
| | 04:29 | I happen to put the name there
because that's what it should be called.
| | 04:32 | TaxTable, no spaces.
| | 04:34 | You can use underscore.
You can shift case in here.
| | 04:37 | You cannot begin a range name with a number.
| | 04:39 | It makes good sense to use the name though.
| | 04:41 | Let's go back to our first function in G2.
| | 04:45 | Instead of using this, why not use TaxTable?
| | 04:49 | You can either type this or press F3
to get a list of them or possibly simply
| | 04:54 | highlight the cells in question, and if
a name has been applied there, the name
| | 04:59 | pops into the function.
| | 05:01 | We can reenter this. Recopy it.
| | 05:04 | It's a lot easier to read.
| | 05:07 | If you encounter this and didn't know
where TaxTable was, you could easily click
| | 05:10 | the drop arrow over here, highlight
the phrase TaxTable, and there it is.
| | 05:14 | The beauty of this, of course, is if we
make the percentage changes in column K,
| | 05:20 | we don't have to rewrite any of the functions;
| | 05:21 | they automatically adjust.
| | 05:23 | If you need to make changes to the
TaxTable, if you tack items onto the end,
| | 05:27 | that's not the best way to do this.
| | 05:30 | If somehow the breakpoints start to
change, and we have more levels, it's better
| | 05:34 | to insert from within.
| | 05:36 | If we start to get too unbearable there,
you might have to redesign the entire table.
| | 05:40 | But if we wanted to add more, always
insert from within. Then you don't have to
| | 05:44 | reassign the range name.
| | 05:46 | But there's no question
this is fast and efficient.
| | 05:48 | Once again, the tables could
be in different worksheets or in
| | 05:52 | different workbooks.
| | 05:53 | It could be much, much longer than this,
and there are even situations where you
| | 05:57 | have multiple columns.
| | 05:58 | VLOOKUP doesn't provide a good paper
trail, in the sense that it doesn't really
| | 06:03 | tell you what it's doing.
| | 06:04 | So if you only use it occasionally, you
might want to take your time every time
| | 06:08 | you use it. But there's no question
that's efficient and fast, and it certainly
| | 06:13 | is much, much better than a long,
complex, ridiculously unwieldy IF function.
| | 06:18 | So, it's a great tool to have to
look up information from a table.
| | Collapse this transcript |
| Finding exact matches with VLOOKUP| 00:00 | In this worksheet entitled ExactMatch,
we'd like to use column F here to convert
| | 00:06 | the scores we see in column E--
the ratings--into a numerical score.
| | 00:11 | There's a table over in columns A and B.
Excellent is 99, Very Good 92, and so on.
| | 00:18 | This Fair rating that we see here
in E2 should be a 71. And the VLOOKUP
| | 00:25 | function that's already in place isn't
working, and there's a reason, but it
| | 00:30 | should give us an answer of 71.
| | 00:32 | It currently is giving us the answer 99.
| | 00:35 | What's different here?
| | 00:37 | Unlike examples with numbers, if you're
looking up text information, or if they
| | 00:42 | are numbers of an ID type--for
example, Social Security numbers, Employee
| | 00:47 | Numbers--LOOKUP can't be an approximate.
| | 00:50 | We can't say, "Oh, that Social
Security number is close enough," and we can't
| | 00:54 | say that here either.
| | 00:55 | We're not trying to find how close
the word Fair is to something else;
| | 00:59 | we need to find it exactly.
| | 01:02 | So, when a VLOOKUP function or an
HLOOKUP function is using an exact match
| | 01:07 | scenario, as we're looking at
here, we need a fourth argument.
| | 01:11 | As it now stands, this VLOOKUP is
accurate in every respect, except it lacks
| | 01:16 | that fourth argument.
| | 01:17 | We're trying to look up the word Fair
in this table, located in cells A2 to B8.
| | 01:24 | We want to get the answers out of the
second column, comma, and the pop-up, as
| | 01:29 | soon as I clicked comma you saw it.
| | 01:31 | TRUE means approximate match.
| | 01:33 | We don't want that here;
we want the word FALSE.
| | 01:35 | You can either type the word FALSE, or
put in the number zero. It doesn't tell
| | 01:40 | you that on the screen.
| | 01:42 | And to me the word FALSE somehow suggests
that maybe something isn't working or failed.
| | 01:47 | So, it's a little bit strange as to why
we use these words, but FALSE certainly
| | 01:50 | will work here, and we
will get the correct answer.
| | 01:54 | Having used this many-
many times, I just use zero.
| | 01:57 | It also has a nice correspondence
with another function we will see called
| | 02:00 | MATCH, and it certainly is
less typing. There we go.
| | 02:04 | And before copying this, since we don't
have a range name, we need to make this
| | 02:08 | an absolute address.
| | 02:09 | We'll simply press F4 here, and then
Ctrl+Enter, and then simply double-click or
| | 02:15 | drag to make this work properly.
| | 02:18 | So, in every case here, we
are seeing the correct answers.
| | 02:21 | Anytime you need to make the match be exact,
| | 02:24 | what that means is, unlike when in an
approximate match, if you have an entry
| | 02:29 | here, suppose this entry said So-so,
well that's a nice thing to say possibly,
| | 02:35 | but that doesn't fit in.
| | 02:37 | It's not anywhere in the table. And what
else can Excel do here in this function
| | 02:42 | but give us an N/A, not applicable.
| | 02:44 | Because we've got this 0 out here--
remember it could be FALSE or 0, either way--
| | 02:50 | this means an exact match.
| | 02:52 | We didn't find this in the list.
| | 02:55 | Imagine a situation where
maybe you have thousands of these.
| | 02:58 | If there's a trailing
space here, look what happens.
| | 03:03 | So a quick workaround on these, if
you did have trailing spaces, is to use
| | 03:07 | another function, one of the text functions.
| | 03:10 | We want to look at the trimmed version of this,
| | 03:13 | the one that takes off spaces.
| | 03:15 | So we can use a function called TRIM
here, and use it in a creative way here.
| | 03:20 | This was going to give us the TRIM
version, and that does work. And of
| | 03:25 | course ideally, we would copy that
downward and also upward to cover other
| | 03:29 | potential uses of it.
| | 03:30 | It would also tackle leading spaces
right here, for example, put in a leading space.
| | 03:36 | Because we've got TRIM in place here, it,
in a sense, you could say corrects the entry.
| | 03:40 | It doesn't really correct the entry,
but it does use a corrected version of it
| | 03:45 | in here to find the answer.
| | 03:46 | So, sometimes you have to deal with that as well.
| | 03:49 | But the main focus here is this
idea that when you're trying to look up
| | 03:52 | information, and it must be exact,
| | 03:55 | you need to have a fourth argument in a VLOOKUP.
| | 03:59 | If you're using HLOOKUP, the same rules apply.
| | 04:02 | In that scenario of course, you're
looking up data in a row, across the top row,
| | 04:07 | but there, too: the 0 or the
word FALSE means an exact match.
| | 04:12 | Not exactly intuitive--in fact, not even
in close--but that's what has to be done
| | 04:16 | when you're using the
VLOOKUP to find an exact match.
| | Collapse this transcript |
| Nesting LOOKUP functions| 00:00 | In this worksheet called NestedVlookup,
we've got a couple tables in columns J, K,
| | 00:06 | and also in columns M through U. And over in
columns D, E, and F, we see a list of entries.
| | 00:14 | The first person here lives in Colorado,
has 5 dependents, and we want to look up
| | 00:19 | the tax rate for this particular person.
| | 00:21 | Not all of the pieces have yet
fallen into place, but let's just do this
| | 00:25 | manually for the moment.
| | 00:26 | This person is in Colorado.
| | 00:28 | Let's look in column J, and this
tells us which region Colorado's in: MT,
| | 00:34 | presumably mountain.
| | 00:35 | Once we know which region this
particular person lives in based on the state, we
| | 00:41 | can then refer to column M.
Here's mountain right here.
| | 00:43 | This person has 5 dependents.
| | 00:45 | We see that, and so the tax rate--here's
the column for dependents right here--is this.
| | 00:51 | How can we pull all this together?
| | 00:53 | If you've worked with the IF function,
you no doubt know about nested IFs,
| | 00:57 | if you've reached that stage perhaps.
Same thing can happen with the VLOOKUPs.
| | 01:02 | Here, I wouldn't say this is a goal,
but sometimes you do need an efficient way
| | 01:06 | to look up data in a
multiple nested kind of way.
| | 01:10 | Let's first figure out
which region this state is in.
| | 01:15 | It's a simple VLOOKUP with an exact match.
| | 01:18 | We're looking up this value here, F2, comma.
| | 01:24 | Typically, we highlight
all of the data in a table.
| | 01:27 | For example, we could be highlighting
from J2 over to K, and all the way down to
| | 01:32 | the bottom here, down to row
52. Nothing wrong with that.
| | 01:34 | But take advantage of a nice shortcut in Excel.
| | 01:37 | If there's nothing else in these
columns below this, why not use J, K--
| | 01:40 | in other words, both columns together?
| | 01:44 | The notation is easier to read.
| | 01:45 | It's simpler, falls into place nicely.
| | 01:48 | Comma. Where is the answer
from this table that we want?
| | 01:52 | It's coming out of the second column.
| | 01:54 | That's column K. So we put in a 2,
not a K. And we want this to be an
| | 01:58 | exact match. Comma.
| | 02:00 | We can type either FALSE or 0.
| | 02:03 | We're about to find out, not the tax
rate yet, but the region that Colorado's
| | 02:07 | located in: that's MT for mountain.
| | 02:11 | For the moment, think of just MT by
itself. By using MT, we should be able to
| | 02:17 | find information out of the table on
the right, columns M through U; when we
| | 02:22 | find MT, then we should be able to go
over into this column to get answers.
| | 02:27 | So, think of this as being the value
to look up inside of another VLOOKUP.
| | 02:33 | This is the value we want to look up.
| | 02:35 | So we precede this with VLOOKUP.
| | 02:43 | And so this is the value to be looked
up. Comma. And where is the table we're
| | 02:47 | looking up information in now?
| | 02:50 | It's this table right here.
| | 02:52 | In other words, we're trying to find the
MT in that table. Comma. And which column?
| | 03:02 | Well, it's going to come out of the
column that has a 5 in it, in this first case.
| | 03:07 | But which column is that?
| | 03:09 | It's the sixth column.
| | 03:11 | So, this starts to get a little tricky.
| | 03:13 | On a case-by-case basis, when you're
doing any kind of a VLOOKUP, if you're
| | 03:17 | trying to look up a column numerically,
sometimes you have to do some reverse
| | 03:21 | logic--think it out a little bit.
| | 03:23 | If someone has 5 dependents, the
answer's going to come out of the sixth column.
| | 03:28 | If it's 2 dependents, it
comes out of the third column.
| | 03:31 | So, a little bit deductive logic here.
| | 03:34 | The column that we need is one
more than the number of dependents.
| | 03:39 | So we'll put in E2+1.
| | 03:43 | So that tells us which column we need.
And now, because we're trying to find MT
| | 03:49 | exactly--that's what the first VLOOKUP gave us--
| | 03:52 | we need an exact match. Comma. Zero.
And a final right parenthesis. Enter.
| | 04:01 | And sure enough, that's the answer that we
saw earlier, and again, checking back and
| | 04:05 | forth, Colorado was MT.
| | 04:07 | We look over here, MT.
| | 04:10 | We look in the column that
has 5 dependents. It's 0.3.
| | 04:13 | There we see the answer.
| | 04:15 | If we hope to copy this down the column,
probably what we'll want to do here
| | 04:19 | is make this be an absolute reference.
But in the case here, we don't have to
| | 04:23 | change that at all.
| | 04:24 | So, maybe a better approach here
might be, instead of making this be M3:U9,
| | 04:30 | what if we simply make that be
columns M through U? Pressing Enter here
| | 04:37 | shouldn't change a thing,
| | 04:38 | if we copy this down a few cells just
to check it out. How about the person in
| | 04:43 | Kansas who has 2 dependents.
| | 04:46 | There's Kansas from the MW Region.
| | 04:49 | MW is right here: 2 dependents, 0.7.
| | 04:51 | Actually, we're not seeing the whole
display there, but that looks like it's correct.
| | 04:57 | Column O here. We'll increase
that a bit. There we go, 0.72.
| | 05:01 | We see that.
| | 05:02 | So it is working properly, so we
could copy this down the column.
| | 05:05 | It's just an alternate way of
displaying this without having to use the
| | 05:08 | absolute reference.
| | 05:09 | We're using entire columns here.
| | 05:12 | But the key point here
really is the nested VLOOKUP.
| | 05:15 | The first VLOOKUP here tells us which
region a particular state is in based on
| | 05:21 | looking up information in columns J and K,
and then we take that information and
| | 05:26 | use it in the other table to the
right to pull out the tax information.
| | 05:30 | So these can get quite involved at
times. And again, the saving grace many
| | 05:34 | times is you know your data well enough
to control it properly, and you have a
| | 05:38 | sense of what's going on.
| | 05:39 | So, nested VLOOKUPs, although not on
everybody's radar, should be something
| | 05:43 | you're at least aware of. And it
accentuates the idea that you get a lot of
| | 05:47 | creativity when it comes to nesting functions.
| | Collapse this transcript |
| Finding table-like information within a function with CHOOSE| 00:00 | In this worksheet called Choose, in
column B we would like to put in the quarter
| | 00:05 | for each of the dates that we see in
column A. Many of you are familiar perhaps
| | 00:10 | with the function called MONTH,
=month, and we apply this to a date cell.
| | 00:16 | It's going to return the number of the month--
| | 00:17 | in this case, of course, 3.
It's the third month for March.
| | 00:21 | We possibly could look up what the
quarter for this is based on information the
| | 00:26 | way we are seeing in columns D, E,
and F. But by getting the number, that
| | 00:30 | doesn't quite work.
| | 00:31 | What we could do at a LOOKUP here on
these two columns and then when we see a
| | 00:35 | three, then we know the
quarter is going to be a one.
| | 00:38 | Or possibly you know how to write a
mathematical formula here that simply takes
| | 00:43 | the quarter, maybe uses the MOD function,
or divided by three, or there is some
| | 00:48 | technique for coming up
with the number that way.
| | 00:50 | There is also another LOOKUP type
function called CHOOSE, and it's similar to
| | 00:57 | the VLOOKUP and HLOOKUP, at least in
terms of concept, but it's radically
| | 01:00 | different in how it's set up.
| | 01:02 | The CHOOSE function allows us to essentially
embed all the answers in the actual function.
| | 01:07 | Now let's start with the idea that
this function here is valuable because it
| | 01:13 | tells us which quarter a month actually it's in.
| | 01:15 | I want to put the word CHOOSE in front of this.
| | 01:18 | This is the function.
| | 01:19 | The CHOOSE function begins with some value
that's either calculated or picked up out of a cell.
| | 01:27 | For this very first case, we know this
is going to be a 3, but of course what
| | 01:31 | could it be? Any number
from 1 through 12. That's it.
| | 01:35 | Those are the only possibilities here.
| | 01:38 | After placing a comma here, we now put
in the 12 different answers translated.
| | 01:44 | For example, if MONTH(A2) is 1--meaning
January--then we want this to be first quarter.
| | 01:50 | If it's 2, it's first quarter.
| | 01:52 | If it's 3, it's first quarter.
| | 01:54 | So for the first three answers here we want 1.
| | 01:58 | So if MONTH(A2) happens to be
equal to the 3, here is our answer.
| | 02:02 | If it's equal to a 2, here is our answer.
| | 02:05 | What if it's equal to 4? That's April.
| | 02:08 | What does that mean? Second quarter.
| | 02:11 | So now we're going to have three 2s,
and you can figure out the rest of course,
| | 02:14 | three 3s and three 4s.
| | 02:18 | We are providing 12 answers.
If MONTH(A2) happens to be equal to the 7, what's
| | 02:23 | our seventh choice here?
One, two, three, four, five, six.
| | 02:27 | There it is, and what does
that mean? Third quarter.
| | 02:30 | Closing parenthesis. There we go.
| | 02:34 | Double-click and we see what's happening.
| | 02:36 | So you can easily see what's going on there.
| | 02:40 | If you work for the federal
government, or possibly other organizations
| | 02:43 | where the fiscal year doesn't match
the chronological year, you want to
| | 02:47 | change these numbers.
| | 02:48 | So in the federal government, for
example, January, February, March are in
| | 02:52 | the second quarter.
| | 02:53 | So if these happened to be equal to 1, 2, or 3,
| | 02:56 | in other words, if this happens to be
equaled 1, 2, or 3, it's the second quarter.
| | 03:01 | So our first three answers here
will not be 1s, but they will be 2s.
| | 03:04 | Of course, at the other end of the
spectrum here, if the answers are 10, 11, or
| | 03:11 | 12--meaning October, November, or
December--then these are in the first quarter.
| | 03:16 | So we see how this plays out.
| | 03:19 | So if your fiscal year begins in October,
here are the kinds of answers you would want.
| | 03:25 | Perhaps the heading might say FY
quarter, but that's how it will play out.
| | 03:30 | So you can use the CHOOSE
function for a variety of situations.
| | 03:33 | It's not nearly as capable as VLOOKUP
table could be, but for certain kinds
| | 03:37 | of situations, it's compact, and the big
advantage is we don't need any external table.
| | 03:42 | We don't need anything like we're
seeing in columns D, E, and F. The Choose
| | 03:46 | function has all of our answers
embedded in the actual function.
| | Collapse this transcript |
| Locating data with MATCH| 00:00 | In this worksheet called MATCH, column E
has a list of Social Security numbers.
| | 00:05 | Let's imagine that the lists in
columns A and B might be in a different
| | 00:09 | worksheet--maybe even a different
workbook--and what we would like to be able to
| | 00:12 | do here is to see if this Social
Security number--and the rest of them, of course--
| | 00:18 | are found in the other list.
| | 00:20 | Now first thought might be, it sounds
like VLOOKUP. But the purpose of the
| | 00:24 | VLOOKUP is to not only find a
match, but to return another value.
| | 00:29 | Let's say that we simply want to know
whether if this is found over in column B,
| | 00:35 | which again could be on
another workbook, another worksheet.
| | 00:38 | We use a function called MATCH.
| | 00:42 | The MATCH function starts off
looking very similar to a VLOOKUP function.
| | 00:46 | Here is the LOOKUP value. And by the
way, the entries in column E don't truly
| | 00:50 | contain hyphens, nor do the ones in
column B. The hyphens are in the format,
| | 00:55 | not the actual content.
| | 00:57 | So they do match up in
terms of their layout. Comma.
| | 01:00 | Where are we looking?
| | 01:02 | We can highlight the cells from B2
downward, but since nothing else is in
| | 01:06 | column B, let's use the
entire column reference, column B.
| | 01:10 | The third argument in a
MATCH function is the match type.
| | 01:13 | That certainly isn't obvious, but
as I press comma, look what happens.
| | 01:18 | We want an exact match,
so we're going to put in 0.
| | 01:20 | Now you notice 1 means less
than, -1 means greater than.
| | 01:26 | These only make sense when the cells
you're trying to look up contains numbers of
| | 01:31 | a computational nature,
| | 01:33 | perhaps salaries or tax
rate--something like that.
| | 01:37 | You're trying to find numbers that fall
between, above, or below a certain level--
| | 01:42 | in this case 0.
| | 01:43 | You can either click this
or type the 0. Type it.
| | 01:46 | There we go.
| | 01:47 | Are we finding this number here?
| | 01:49 | Is it in that list in column B?
| | 01:52 | Yes, but what does that mean? 17.
| | 01:55 | It's in the 17th position
of the LOOKUP array location.
| | 02:00 | So in this case, since we've chosen
column B, it's in B17. There it is!
| | 02:05 | Right down there. Duke Mantee 145-69-6388.
There it is, right there. We see that two.
| | 02:11 | It's in the 17th location.
| | 02:13 | Now what if it were not found?
| | 02:15 | What if this number were different here?
| | 02:16 | Maybe that's 7 on the end
there. This is not found.
| | 02:20 | So there are many times when the MATCH
function's purpose is simply to tell us
| | 02:25 | whether something was
found in a different location.
| | 02:29 | It's certainly falls under that broad
spectrum what we call LOOKUPs, but it's
| | 02:32 | different than VLOOKUP.
| | 02:33 | It can be used in other creative ways as well.
| | 02:37 | Moving off to the right here, in columns
J, K, and L, we see a list of names, and
| | 02:43 | there is also another list out here in
columns P and Q. Now again, imagine how
| | 02:48 | sometimes you need to match up data
from different worksheets, different
| | 02:51 | workbooks. Of course, in this case they're on
the same worksheet, just for ease of display.
| | 02:57 | We want to find out if Yvonne
Randall here--or as we see the name here
| | 03:01 | Randall Yvonne--is found in this
list, but notice how the lists are
| | 03:06 | structured differently.
| | 03:08 | Over here, we see names:
last name, comma, first name.
| | 03:11 | Here's Randall, Yvonne.
| | 03:14 | Surely, it's the same person, isn't it?
| | 03:16 | But how do we provide the match here?
| | 03:18 | We actually have to use the MATCH
function to construct the concatenation--as
| | 03:24 | it's sometimes called--of these two cells.
| | 03:26 | So let's start with MATCH here and put
these two together by using a technique
| | 03:34 | called concatenation.
| | 03:36 | We want to take the last name, which is in
J2, followed by ampersand. That means and.
| | 03:42 | So we want the word Randall and within
double quotes here comma space double quote.
| | 03:49 | This is the same style of layout we see
in column P: the last name, then a comma,
| | 03:54 | space, and the first name.
| | 03:57 | Where is that found here? K2. Comma.
| | 04:01 | So let's take this Randall, comma,
space, Yvonne and see if we can find it in
| | 04:07 | column P. And we must find
an exact match here. Comma, zero.
| | 04:14 | Did we find it? Yes, we did.
| | 04:17 | Row 13, there is the name, Yvonne Randall.
| | 04:21 | Since we again used the entire column
references rather than cells, we don't
| | 04:24 | have to worry about absolute addressing here.
| | 04:26 | We will just double-click
to copy this down the column.
| | 04:30 | There is no John Gilligan
in that list to the right.
| | 04:33 | How about Rene Hood?
| | 04:35 | Pretty close, right?
| | 04:35 | Well, obviously, Rene is not spelled
the same way, and of course, that's why
| | 04:39 | we don't find this.
| | 04:41 | So once again, were using the MATCH
function to locate the relative position or
| | 04:46 | the nonexistence of a match in a certain list.
| | 04:49 | We'll see it in another movie, how we
can also use MATCH with other functions to
| | 04:54 | take this a step further. But many,
many times the purpose of the MATCH function is
| | 04:59 | to simply display whether we
have found something or not.
| | Collapse this transcript |
| Retrieving information by location with INDEX| 00:00 | We're looking at a sheet called INDEX,
and that's the name of a function we
| | 00:03 | want to talk about.
| | 00:05 | A valuable tool in Excel's arsenal of
LOOKUP functions is the INDEX function.
| | 00:10 | The INDEX function allows us to pull
information out of a table, provided we
| | 00:15 | give the row and column reference.
| | 00:17 | So let's imagine that the list that
we're looking at here in column C through
| | 00:22 | J--this list right here--contains
various prices for mailing packages, for
| | 00:28 | example, to different zones.
| | 00:30 | So maybe you're in zone 1, and you
have to mail packages to different zones
| | 00:34 | across the country. And we've got sort
of an arbitrary--maybe these are pounds
| | 00:40 | or maybe it's just some kind of a
measure that shows package size.
| | 00:42 | Here is a list here that says we're talking
about Size 3, and it has to go to Zone 6.
| | 00:52 | So we can see that it should be $35.29.
| | 00:56 | Let's imagine we want to provide a price
here, no matter what these numbers are,
| | 01:00 | as long as they're within the appropriate range.
| | 01:03 | So we know looking ahead here in this one
example that the answer should be 35.29.
| | 01:08 | We'll make that a different color
here for the movement. There you go.
| | 01:11 | We will make it yellow.
| | 01:12 | We need the function here that's going
to pull information out of this table.
| | 01:16 | It's the INDEX function.
| | 01:19 | Throughout Excel there are a number
of functions that use row and column
| | 01:22 | references. And in all cases, the row
reference always comes before the column reference.
| | 01:28 | RC, row column.
| | 01:31 | First of all, the INDEX function asks us to
refer to the actual table location. Here it is.
| | 01:36 | That's it. Select it. Comma.
| | 01:41 | The row reference here,
it's these rows 1 through 5.
| | 01:45 | The size here is giving us the row
number. That's what they pertain to.
| | 01:49 | Now if we're doing this just manually,
we could type in a 3, but let's pick it
| | 01:53 | up out of this cell here
to give it some flexibility.
| | 01:55 | That's the row reference. Comma.
And it has to go to Zone 6.
| | 02:00 | That's the sixth column.
| | 02:01 | We see it here. And that
information is in cell D10,
| | 02:04 | so we'll just click there, and we're done.
| | 02:07 | So at the intersection of the third row
and the sixth column in this table--and
| | 02:13 | table goes from C3 through to J7--
| | 02:15 | we want to get our answer here. And sure enough,
| | 02:18 | of course, we're getting $35.29.
| | 02:22 | So the INDEX function gives us the
ability to pull data out of a table based on
| | 02:28 | the column and row reference.
| | 02:30 | Now a slightly larger
application of this is in column O here.
| | 02:35 | It's based on the same table, but we
want to pick up information from this table
| | 02:39 | here based on its size and its shipping zone.
| | 02:43 | Here are various items here that have
been shipped are about to be shipped.
| | 02:47 | We simply want to provide that opportunity here.
| | 02:50 | This might work a little bit
faster and a little bit better,
| | 02:53 | it could be a little bit clearer
if we give this a range name first.
| | 02:56 | So maybe we'll select this data here
and simply call it shipping table.
| | 03:02 | Click the drop arrow. Type in "ShippingRates".
| | 03:12 | We want to use the INDEX
function here in cell O2 =index.
| | 03:19 | Let's use that range name.
| | 03:20 | Now we can type it in, but since the
cells are already being named, we can
| | 03:23 | highlight this. The name
will pop in automatically. Comma.
| | 03:27 | Now which row is going to have the data?
| | 03:30 | In row 2 here, when we looking around at
this particular item, its size is noted
| | 03:36 | in column M. So the row number we pick
up from this cell right here, M2, which
| | 03:41 | happens contain a 5, comma, and the
shipping zone in this case also a 5, but in
| | 03:47 | this case the 5 refers to
the column. It's Zone 5.
| | 03:50 | It's going to come out of
column G. So let me click here.
| | 03:55 | Now looking ahead here, as we look
at this, looking at the table to left
| | 03:59 | that they are both 5s, it's going to be
37.39. You can see that ahead of time.
| | 04:04 | We complete the entry here.
| | 04:06 | As we complete it, we see that entry, 37.39.
| | 04:10 | It's in the G column right here.
| | 04:14 | There we go, where they
intersect. Right there, 37.39.
| | 04:18 | So the INDEX function is pulling out
information from a table based on a
| | 04:22 | column and a row reference.
| | 04:23 | I will just double-click to
copy this down the column.
| | 04:26 | Since we have a range name, we don't
have to worry about using the Dollar sign
| | 04:30 | or those absolute references.
| | 04:31 | So every one of these is
working in the same kind of way.
| | 04:34 | In this case, we are getting the answer
14.69 that's coming out of the shipping zone 2.
| | 04:38 | We see that over here. There it is, 14.69.
| | 04:42 | That's the answer we're getting.
| | 04:44 | So the INDEX function allows us to pull
information out of a table based on row
| | 04:49 | and column references.
| | Collapse this transcript |
| Using MATCH and INDEX together| 00:00 | In this worksheet entitled MATCH-INDEX,
we want to show you two different ways
| | 00:04 | to use the MATCH and INDEX
functions together to pull out appropriate
| | 00:09 | information from a table.
| | 00:11 | In column A, we see the
words "April" and "DVD Drives."
| | 00:15 | Eventually, we might even want to use
data validation here to create a drop list
| | 00:20 | to allow us to be a little bit more flexible.
| | 00:22 | But let's just imagine we want to be
able to change these and then come up with
| | 00:26 | the appropriate sales figure
for that month and that item.
| | 00:30 | Let's first of all focus on April
only to recognize its location here.
| | 00:37 | It's the fourth entry here. =match.
| | 00:42 | April is what we're looking for.
Comma. And where are we looking?
| | 00:46 | In these cells right here.
| | 00:48 | By the way, we might want to choose total out
there, so we're including that cell as well.
| | 00:53 | We need an exact match.
| | 00:54 | So what does this tell us?
| | 00:57 | April is in the fourth
location of this range right here.
| | 01:02 | Similarly, with DVD Drives we also want
to use the MATCH function to find that
| | 01:07 | bit of information--comma--in these cells.
| | 01:11 | Comma, zero. We're looking for an exact match.
| | 01:14 | Where is DVD Drives found in this list?
| | 01:18 | It's in the third position from the
beginning of the list, if we choose exact match.
| | 01:23 | Using the INDEX function, we can refer to
the cells we're looking at for the values.
| | 01:30 | They're right here. Comma.
| | 01:33 | And we're trying to get information
out of the fourth row for April--comma--and
| | 01:38 | the third column--Enter--4565.
| | 01:40 | We're looking at April right here, and
DVD Drives and where they intersect, 4,565.
| | 01:49 | That's the answer we've got.
| | 01:51 | Nothing wrong with doing this separately.
| | 01:53 | In fact, sometimes that's a good
idea to build these separately.
| | 01:57 | What we might also do, after being more
familiar with this, is essentially turn
| | 02:01 | this into one formula by taking this
MATCH function, highlighting just this
| | 02:07 | portion of it, pressing Ctrl+C, and then Escape.
| | 02:11 | Let's plug it into this formula here.
| | 02:14 | So instead of this referring to B3,
we'll make it refer to--as I press Ctrl+V--the
| | 02:20 | function as we saw in B3.
| | 02:22 | Obviously, it makes this longer, and
you don't necessarily need to do this.
| | 02:26 | But if we really do want to turn
this into one function, we will again do
| | 02:30 | the same thing here.
| | 02:31 | Take this information, edit it, copy
just this portion of it, Escape, plug
| | 02:37 | that into here as well, instead of the B4,
and press Ctrl+V to paste that information.
| | 02:43 | A much, much longer function, but
now I have the complete answer, and we
| | 02:47 | don't need these cells.
| | 02:48 | So it's just a question of
whether you want to do that or not.
| | 02:51 | We could put it over here or wherever.
| | 02:53 | Eventually put in data validation
there if you wish, but it does show how
| | 02:57 | we can nest these functions in a creative
way to pull out information from this table.
| | 03:03 | Now, over in columns L, M, and N
imagine this represents a huge table, perhaps
| | 03:10 | on another worksheet.
| | 03:12 | In a different location, you've got a
list of Social Security numbers, and you
| | 03:15 | need to look up someone's name.
| | 03:18 | You want to know who is associated with
this particular Social Security number.
| | 03:23 | It so happens that we're trying to
look up here--because your first thought
| | 03:26 | might be of VLOOKUP--
| | 03:28 | we're trying to find this information, but
it's not in the left column of a table.
| | 03:33 | Potentially, maybe we could move this
to become the left column of the table,
| | 03:37 | but you can't always do that.
| | 03:39 | Maybe this table is controlled by
someone else that's in a different workbook.
| | 03:43 | Maybe this table is used by a variety
of different functions already, and you
| | 03:47 | can't alter the order of the columns here.
| | 03:51 | So we need to find out, first of
all, where this exists in the list.
| | 03:56 | And we use the MATCH function here to
find of this value--comma--in this list.
| | 04:05 | Now once again, we might be tempted to
use the entire column, but it looks like we've
| | 04:09 | got an empty row above it.
| | 04:10 | Let's still try it anyway. Click here. Comma.
| | 04:14 | We need an exact match 0.
| | 04:16 | Is this Social Security
number found, and if so, where?
| | 04:20 | It's in the twelfth position.
| | 04:21 | We see it right there.
| | 04:23 | We've got that match, but
now let's go pick up the name.
| | 04:26 | We need to use the INDEX function to
pull information out of the first column.
| | 04:32 | Here it's column L. 12th row.
| | 04:35 | So for the moment, we'll put this in a
separate column and then put them back together.
| | 04:40 | So armed with this information, we
know which row this is coming out of.
| | 04:45 | We need to use the INDEX function now.
| | 04:47 | So where are we looking?
| | 04:48 | Now the first thought might be, we're
looking in these three columns. Well, not really.
| | 04:53 | All we're looking for is the name,
so we're just looking in column L. Comma.
| | 04:58 | Which row are we looking for?
| | 05:00 | If it were only one case, we could type in a 12.
| | 05:02 | But we're looking for the
information that we found here.
| | 05:07 | So we'll use this for the moment, in
the 12th cell downward. And which column?
| | 05:13 | There's only one column here,
| | 05:15 | so we actually don't need anything,
but it would be logically to put in an 1,
| | 05:18 | and that's okay, but actually we don't anything.
| | 05:20 | But at least this will work, and
there is our answer is Thomas Watson.
| | 05:23 | If the range that you're using for the
INDEX is only one column, we don't even
| | 05:29 | need the column reference, as I suggested,
| | 05:31 | so we'll take that out. There too.
| | 05:34 | Here too as in our previous example,
it may make sense if you work with these
| | 05:38 | for a while to
essentially do this all in one step.
| | 05:41 | Take this information here. Copy it
with Ctrl+C and escape. Plug it in here
| | 05:48 | into this location.
| | 05:49 | We will do a paste. Enter.
| | 05:52 | We don't need this anymore.
| | 05:54 | So this use of INDEX and MATCH together,
as in the previous example, allows us to
| | 05:59 | find information that we couldn't find
by using of a VLOOKUP, the most common
| | 06:04 | kind of LOOKUP likely to be used
when you have column or information.
| | 06:08 | INDEX and MATCH give us this potential
to pull together information by using the
| | 06:13 | functions in a nested way.
| | Collapse this transcript |
|
|
5. Power FunctionsTabulating information on a single criterion with COUNTIF, SUMIF, and AVERAGEIF| 00:00 | Sometimes you need to create
quick summary totals on a worksheet.
| | 00:04 | In this worksheet called
SingleCriteria, as we look at data here, you can
| | 00:08 | imagine the question popping up:
| | 00:10 | how many contract people do we have here?
| | 00:12 | How many full time people do we have?
| | 00:14 | We want to know this information.
| | 00:15 | There are about 300 rows of data here.
| | 00:18 | Sorting is not going to help us as that much.
| | 00:19 | It will pull them all together,
but we want some quick totals.
| | 00:23 | There are three interrelated
functions: COUNTIF, SUMIF, and AVERAGEIF.
| | 00:28 | They are very similar, but
work slightly differently.
| | 00:31 | To get a quick count, we want to use COUNTIF.
| | 00:33 | Now maybe we want to put this
information temporarily in column F. The COUNTIF
| | 00:39 | function: just based on its wording,
| | 00:42 | you can probably sense pulls together the
concept of counting, along with an IF function.
| | 00:47 | It isn't strictly an IF function,
but it uses that kind of logic.
| | 00:52 | So a different way to state this might
be, in English: if an entry in column B
| | 00:57 | equals contract, then let's count it.
| | 01:01 | We use that as an example.
| | 01:02 | So where we are looking?
| | 01:02 | We are looking in column B.
Comma. What are we looking for?
| | 01:07 | Two ways to do this.
| | 01:08 | We might within double quotes
put in where we are looking for.
| | 01:11 | Now we can do this with numeric
information, but first time look here,
| | 01:14 | we're looking a contract.
| | 01:16 | We are looking to see how many times
this appears in column F. 78 times.
| | 01:23 | We have got 78 contract people here.
| | 01:25 | I have got a list over here of the 4
kinds of statuses that we have here, so
| | 01:30 | maybe we'd make this a
little bit more expansive.
| | 01:32 | Instead of using this, why don't we
simply refer to Half-Time over here?
| | 01:37 | Then we'll both copy this up and down.
| | 01:39 | So we have 36 half-time people.
| | 01:43 | We saw earlier it was 78 contract.
20 hourly. Drag this upward.
| | 01:46 | So what we have got here
is four bits of information.
| | 01:49 | Just looking at this one for the moment,
we are looking in column B, and how
| | 01:53 | often do we see what we currently
see in H1--in other words, how many
| | 01:56 | full-time people do you see? 162.
| | 01:58 | That works out pretty nicely.
| | 02:01 | If it is a text entry, refer to it
within double quotes as we first saw, or by
| | 02:06 | cell references we saw it this way.
| | 02:08 | Now, what if it's a numerical entry?
| | 02:10 | =COUNTIF. Looking now in column C.
I doubt if you really want to find out
| | 02:17 | who is here exactly 10 years, but if
you did, you could click column C, comma, 10.
| | 02:25 | I don't know if there are
any, but we will find out.
| | 02:26 | 16 people have been here 10 years.
| | 02:30 | I think more likely what you would want to
be able to do here is to pick up a range.
| | 02:34 | You notice off to the right I have
got this indicated here just for reference.
| | 02:37 | Suppose we want to know how many
people have been here more than 10 years.
| | 02:42 | Here we need to actually embed this
within double quotes. Double quote greater
| | 02:48 | than 10 double quote. 146.
| | 02:54 | So different ways to use this, and I
think you can see how fast this is and how
| | 02:58 | straightforward it is.
| | 02:59 | Now the companion function to this,
the first one is called SUMIF.
| | 03:03 | We might want to know, after having
found out how many contract people there are
| | 03:08 | here, how much their salaries add up to?
| | 03:11 | The SUMIF and AVERAGEIF functions
start with the basic concept of COUNTIF and
| | 03:17 | then extend it into
different kinds of information.
| | 03:19 | For example, we are trying to find not
just how many people are contract, we got
| | 03:26 | that part nailed already. Now, I am just
going to click on cell H3 here to pick
| | 03:32 | up the word Contract.
| | 03:33 | Now we are about to say, every time we
find someone who's contract status--comma--
| | 03:39 | let's go into column D, grab that
salary, and keep adding these up.
| | 03:43 | Or in other words, how much are
we paying these contract people?
| | 03:47 | And sure enough, if we wanted to get
this for the other list, will give the copy
| | 03:50 | that downward or change the reference, and so on.
| | 03:52 | So the SUMIF function has three
arguments to it. It starts off in the same
| | 03:57 | way that COUNTIF does.
| | 03:59 | Here is where we were looking.
Here's what were looking for--in this case contract.
| | 04:03 | Let's go to their salaries and add them up.
| | 04:05 | I am just going to copy this
downward, make it a little bit simpler.
| | 04:09 | Now of course, what's that referring to?
| | 04:10 | That's the hourly people.
| | 04:12 | What if we want to know the
average salary of the hourly people?
| | 04:15 | Instead of SUMIF we used AVERAGEIF.
| | 04:21 | The average salary of these hourly
people here is 28,000. And once again, in
| | 04:25 | both cases of course, we could be
looking at different criteria, but the
| | 04:29 | functions play out in similar ways.
| | 04:31 | I actually use AVERAGEIF a lot more than SUMIF.
| | 04:33 | AVERAGEIF is relatively new;
| | 04:35 | it was introduced in Excel 2007.
| | 04:36 | It has been around for a while.
So these are good functions for tabulating
| | 04:42 | information typically out of a database
kind of list of information. COUNTIF,
| | 04:46 | SUMIF, and AVERAGEIF.
| | Collapse this transcript |
| Tabulating information on multiple criteria with COUNTIFS, SUMIFS, and AVERAGEIFS| 00:00 | In this worksheet called
MultipleCriteria, we want to show you three
| | 00:04 | interrelated functions. And just as
there is a COUNTIF, SUMIF, and AVERAGEIF
| | 00:11 | function, there is also a
corresponding set, ending in the letter S: COUNTIFS,
| | 00:17 | SUMIFS, and AVERAGE IFS.
| | 00:21 | These allow us to search for multiple criteria.
| | 00:24 | For example, we want to know the
account of how many of our full time people
| | 00:31 | have a job rating of 5.
| | 00:34 | If we simply wanted to count how many
people are full time, we'll use a COUNTIF.
| | 00:39 | And notice that I'm typing here we
do see the functions play out here.
| | 00:43 | We want to use COUNTIFS.
| | 00:44 | I'll just click it here and then
press tab. Pop that into place.
| | 00:49 | You'll notice here it says criteria range
1. Although we can't say the rest of it,
| | 00:53 | that's going to be criterion,
even though it is plural there.
| | 00:57 | And then we can have
another set and another set.
| | 00:59 | So, let's just start off simply
here. What are we looking for?
| | 01:02 | We are looking for, in column
B--comma--the full time people.
| | 01:08 | Double quote, Full Time.
| | 01:12 | This possibly could be referred to in
a cell off to the right. Comma. What also
| | 01:16 | are we looking for?
| | 01:17 | We are looking in column C. Comma.
What we are looking for here? Job Rating 5.
| | 01:24 | So the first pair is we are looking for
the full time people and those who are
| | 01:31 | full time and have a job
rating of 5; the two go together.
| | 01:35 | In other words, we are not going to
find contract people with a job rating of
| | 01:38 | 5 or full time people with the job rating of 3.
| | 01:41 | The full time people who have a job rating
of 5, how many are there here? 32 of them.
| | 01:48 | We can have a 3rd pair, a 4th pair.
| | 01:51 | We can expand this.
| | 01:52 | How many of them have salaries over 60,000?
| | 01:55 | Another pair, possibly. Comma.
What are we looking for now?
| | 02:00 | Column D. And what's the criterion here?
| | 02:04 | Comma. Within double quotes, greater
than 60,00. No comma after the 60 in
| | 02:10 | there. Double quote.
| | 02:11 | So we are narrowing the list. We did
have 32, because we weren't including the
| | 02:17 | salaries. And what have we found now?
| | 02:21 | In this list here, we have 16 people who
are full time and who have a job rating
| | 02:27 | of 5, and they make more than $60,000.
| | 02:30 | The two companion functions, SUMIFS and
AVERAGEIFS, actually go a step further,
| | 02:37 | and they work a little bit differently.
| | 02:39 | Let's suppose that we would like to
know the average salaries of our full time
| | 02:46 | people who have a job rating of 5.
| | 02:49 | =AVERAGEIF. Here too, by the way, I could
have popped that into place with the Tab key.
| | 02:55 | But AVERAGEIFS, we start by indicating what?
| | 02:58 | The field we are trying to tabulate.
Maybe we are trying to find the average salary.
| | 03:04 | There we go.
| | 03:05 | Even this says a range. Now we have
pairs of criteria and multiple pairs perhaps.
| | 03:12 | So we are looking for the
average salary of what, or of whom?
| | 03:16 | Those whose status is full time.
So column B, comma "Full-Time". That's 1 pair.
| | 03:26 | We can stop right there.
| | 03:27 | That could be it, but let's put in another pair.
| | 03:31 | Job Rating, and then a comma, 5.
| | 03:33 | If it is a numerical value like this,
you don't have to put it in quotes.
| | 03:38 | So we simply want to know the average
salary for our full time people who have a
| | 03:42 | job rating of 5, and there it is, 59766.
| | 03:47 | By the way, if we want to know the total
salary here of our full time people who
| | 03:51 | have a job rating of 5, we just
change the word AVERAGE to SUM.
| | 03:56 | We would make it a SUMIFS.
| | 03:57 | It too works in the same fashion here, where
| | 04:00 | we begin with the field that we are
tabulating. But here's a more involved
| | 04:03 | situation off to the right.
| | 04:05 | We have got a whole bunch of items
here, and they need to be shipped.
| | 04:07 | They have got different sizes, they go to
different zones, and here's the cost here.
| | 04:13 | We want to know, in this area right
here, how much money we have spent for
| | 04:17 | shipping these packages based on the
zone that they have gone to and the
| | 04:22 | size of the package.
| | 04:24 | So this is going to be a little bit
more involved, but it is going to be using
| | 04:26 | the SUMIFS function. =SUMIFS. And we
want to add up the data from column L. Now
| | 04:35 | because we would like to copy this
function into other cells, and we want to
| | 04:39 | make sure that the information that
we're adding is always coming out of column
| | 04:43 | L, we want to make that in absolute
reference, so we press F4. Comma. In pairs.
| | 04:49 | What are we first looking for?
| | 04:51 | We want to make sure that we are
adding up, in this row right here, just the
| | 04:55 | data for size 1s.
| | 04:57 | So we click column J. That's where the
sizes are located. And here too, we want
| | 05:02 | this to be an absolute reference. Press F4.
| | 05:05 | What are we looking for in column J?
| | 05:08 | Those that are size 1.
| | 05:09 | I am going to click on P3 here
after putting in the comma. Right there.
| | 05:15 | Now because we are going to be copying
this down the column, we want to make
| | 05:19 | sure that it stays in column P, not
row 3. So here we'll press F4 a few times,
| | 05:25 | using a relative reference, always
making sure that this portion of our formula
| | 05:30 | is coming out of column P. So this pair
right here means we're only trying to
| | 05:35 | tabulate information that's
coming of the column J for size 1. Comma.
| | 05:40 | Now we have got another pair that we need to
put in, and this relates to the shipping zone.
| | 05:47 | And so we are looking in column K. This
too needs to be an absolute reference.
| | 05:51 | We will press F4. Comma. And now we
need to make a reference to the row where
| | 05:56 | the zones or put in, and
that's right here in row 3, up above.
| | 06:00 | I am going to click on Row 2 Q2, and
press F4 in such a way that we indicate we
| | 06:05 | always want this to come out of
row 2, so I am pressing F4 repeatedly.
| | 06:09 | You see the dollar sign here.
| | 06:12 | So we are finally finished.
| | 06:13 | What are we trying to do here?
| | 06:14 | We are trying to tabulate all that
information out of column L and picking out
| | 06:20 | where the size here--
| | 06:22 | that's column J--is equal to 1, and
also out of column K here. The Shipping
| | 06:29 | Zone is from zone 1.
| | 06:31 | So I'm going to press Enter here and double-
click to copy this down the column and
| | 06:37 | across the various rows here.
| | 06:39 | In another words, what we're saying here is
we spent $460 on various mailings to zone 6,
| | 06:46 | if the package was size 4. We might want
to totals on the bottom here, and on the side.
| | 06:51 | You can certainly do that.
| | 06:52 | We did that very quickly here, just by
highlighting these cells and pressing
| | 06:55 | AutoSum. We're pulling
together the data in that way,
| | 06:58 | readjusting the column width
here, and so on. We've got this information.
| | 07:03 | We see this grand total right here,
if you highlight these cells here.
| | 07:07 | Of course, you're also seeing this down
in the status bar at the bottom of the
| | 07:11 | screen, and of course, the real final
check on this is to click column L. What's
| | 07:15 | the total shipping cost of
all these items? There it is.
| | 07:19 | You see it: $8,668.54.
| | 07:23 | It is the same total we have here.
| | 07:25 | So this table--somewhat painstakingly
created--uses the SUMIFS function to gather
| | 07:32 | data from multiple
criteria in columns J, K, and L.
| | Collapse this transcript |
|
|
6. Statistical Functions Finding the middle value with MEDIAN| 00:00 | In creating summary information from a
list of data, it's not uncommon to want
| | 00:04 | to know an average, and also a median.
| | 00:07 | Median is a common measure.
| | 00:10 | I see it frequently used when
talking about housing prices. And let's
| | 00:13 | contrast it with average.
| | 00:14 | What does MEDIAN do?
| | 00:15 | We are looking for the median salary here.
| | 00:18 | I am going to click column F. As always,
when you can click a column instead of
| | 00:22 | highlighting cells, it's going to be faster.
| | 00:24 | What's the median salary here?
| | 00:25 | What does this mean?
| | 00:26 | What we will not see is the fact that
Excel will take all the numerical data in
| | 00:31 | column F and sort it and
pick the one out of the middle.
| | 00:35 | Now what if it's an even number of
entries? It will take the two middle ones
| | 00:38 | and average them and come up with the number.
| | 00:40 | There's the median salary, the
one that's in the in the middle.
| | 00:44 | Average, which can sometimes be
misleading, particularly in smaller lists
| | 00:48 | typically is very close here, but
you know the mechanism for average.
| | 00:52 | It's also called mean. Click here.
| | 00:55 | We are going to take all the salaries, add
them up, and divide by the number of entries.
| | 01:00 | And an unusually high salary
in this list might skew this.
| | 01:03 | So I see what's happening here.
| | 01:05 | But median is fast and easy, and we
can use it for larger lists as well.
| | 01:09 | There is a list off to the
right here, some 60 entries.
| | 01:12 | What's the median value in there?
| | 01:16 | Highlight the list. Enter. It's 497.
| | 01:20 | So it's from this list here, the 60
entries, it simply sorts them, finds the
| | 01:25 | middle two, and averages
those to come up with an answer.
| | 01:27 | So that's the MEDIAN function, contrasted
with AVERAGE: a commonly used Excel
| | 01:32 | statistical function.
| | Collapse this transcript |
| Ranking data without sorting with RANK| 00:00 | Here is a worksheet called Rank. And in
columns A and B, we see Employee Names and Salary.
| | 00:05 | We would like to know the rank of each
salary compared to the entire list.
| | 00:09 | We can easily do this by sorting, but
there are times when you don't want to sort.
| | 00:14 | We want to keep this list in alphabetical
order, but we do want to know the ranking here.
| | 00:18 | In Excel 2010, the RANK function,
which has been around for a while, is still
| | 00:24 | available, but there are two variations on it.
| | 00:27 | For compatibility reasons, Excel has
kept--and will keep--the Rank function.
| | 00:32 | But as I'm typing this, notice, what also
we are seeing here on the pop-up tip.
| | 00:36 | There is a choice called RANK.EQ.
| | 00:39 | It's the same as RANK.
| | 00:41 | You can use either one.
| | 00:43 | If, however, you are in an
environment where people are using Excel 2007,
| | 00:47 | you probably want to continue
these RANK. But they work the same way.
| | 00:50 | RANK.EQ returns the rank of a number
in a list of numbers, its size relative
| | 00:55 | to the other values.
| | 00:56 | If more than one value has the same rank,
the top rank of that set of values is returned.
| | 01:03 | I think rather than worrying about what that
really means, let's show you what it means.
| | 01:07 | So we use for RANK.EQ or RANK.
| | 01:09 | In this case, I will just choose RANK.
| | 01:11 | What are we looking at first? Cell B2,
comma, compared with the entire list in
| | 01:17 | column B. Notice the word "order"
out here. We are going to ignore that.
| | 01:21 | When we do ignore this,
you will see how this works.
| | 01:24 | It works in what we call a descending order.
| | 01:26 | This is the 71st highest salary.
Double-click to copy this down the column.
| | 01:32 | You can see here, here's the highest salary.
| | 01:35 | It has the order of 1.
| | 01:37 | Notice that two salaries are identical here.
| | 01:40 | They are sharing the second place,
and that means that in this list here of
| | 01:44 | about 96 entries, we do not have a rank of 3.
| | 01:49 | These you could say occupy the 2nd and 3rd slot.
| | 01:52 | The next ranking we would
see in order here would be 4.
| | 01:56 | We might temporarily see how this
plays out, just by sort by salary.
| | 02:00 | Click here and I will simply click
ZA on the Data tab here to sort these
| | 02:05 | in descending order.
| | 02:06 | Now remember, we don't need to do this,
sometimes we cannot do this, but I want
| | 02:11 | to expose the salary rank column in a
slightly different way. And there I think
| | 02:14 | you can see what's happening:
| | 02:16 | the 1, two 2s, the 4, and so on, and
two 6s as well, but no 7, so they are
| | 02:21 | sharing the 6th and 7th position.
| | 02:23 | Some people prefer to
show this in a different way.
| | 02:25 | I am going to use this column here to
show you a variation on RANK, and that's
| | 02:31 | the one we will saw but
didn't talk about: RANK.AVG.
| | 02:35 | If more than one value has the same
rank, the average rank is returned.
| | 02:39 | Let's choose this variation here.
| | 02:42 | And the number we are looking at again
is the entry out of column B. Comma.
| | 02:47 | We'll put B here, and we will
just complete that. That's 1.
| | 02:54 | Now, we might have to change the display here.
| | 02:56 | Let's go the Home tab, choose the comma
button here, and perhaps general format.
| | 03:01 | I am going to press Ctrl+Shift+Tilde to
make this general format even more revealing.
| | 03:06 | You see the difference here.
| | 03:07 | This is using RANK.AVG.
| | 03:09 | Here's the more standard use of RANK.
| | 03:12 | So if you want it like this, there we go.
| | 03:14 | Since these are sharing the second
and third positions, those numbers are
| | 03:18 | average. The average of 2 and 3 is
2.5. We see that's being displayed there.
| | 03:22 | It happens here too.
| | 03:23 | Four of these entries share the 11th position.
| | 03:26 | This is how it looks using RANK or RANK.EQ.
| | 03:29 | This is how it looks with RANK.AVG.
| | 03:32 | You can also reverse the order of
these in all cases here by putting in
| | 03:35 | the third argument.
| | 03:37 | So in this example right here, if we put
in comma, you'll notice the prompt here:
| | 03:41 | "Rank numbers as if reference were
sorted in descending order," 0 or blank that's
| | 03:47 | what we saw earlier is Descending.
Let's choose Ascending order here. Let me
| | 03:51 | just either tab in it or type a non-
zero entry and then re-copy this, and you
| | 03:56 | see what's happening here.
| | 03:58 | And so this which had been
first, now is at the very bottom.
| | 04:01 | So depending upon the kinds of
numbers that you are looking at and the
| | 04:04 | information you are looking at, I think you
want to experiment a bit with the order here.
| | 04:09 | Now again, we emphasize at the beginning
here there are certainly times when you
| | 04:13 | do not want to sort the data.
| | 04:15 | So I am going to put this data back in
the order that it had been, and we could
| | 04:18 | imagine having done everything that we
did here without ever sorting the data.
| | 04:22 | But it did bring it up temporarily.
| | 04:24 | Sometimes when you're experimenting with
this too, it might be easier to--if you
| | 04:28 | don't use it very frequently--to kind of
get your bearings on this, work with the
| | 04:31 | smaller lists say lists like we are
seeing over here and again experiment with
| | 04:35 | RANK and RANK.AVG. And with the smaller
list, I think you'll have a better sense
| | 04:39 | of how it might work.
| | 04:41 | But there is no question that this is
a valuable function for determining the
| | 04:44 | rank of numbers from a list, and
potentially a huge list as well.
| | Collapse this transcript |
| Finding the magnitude data with LARGE and SMALL| 00:00 | Finding the highest value in the
list is simple and straightforward.
| | 00:03 | You don't have to sort the list.
| | 00:05 | There is a function called MAX.
| | 00:06 | Here it's being used in cell I2
in this worksheet called Large.
| | 00:11 | What's the maximum value
in column F? There it is.
| | 00:15 | We don't know where it is.
We don't care about that for the moment.
| | 00:18 | We just want to know what it is.
| | 00:19 | And sure enough, for the lowest value,
it's MIN, but what happens if you want to
| | 00:24 | know the second highest,
or the third, or the fourth?
| | 00:27 | You might want to have create a list, possibly.
| | 00:30 | I don't think you would necessarily
suspect that there is a function that
| | 00:33 | handles this, but there is.
| | 00:34 | It's called LARGE. And, of course,
you could imagine there is a companion
| | 00:40 | function called SMALL.
| | 00:42 | Where are we looking here?
| | 00:43 | We are looking in column F. Comma.
What are we looking for?
| | 00:47 | We are looking for maybe the second highest.
| | 00:50 | We will put in a 2. Enter.
| | 00:52 | That's the second highest salary.
| | 00:53 | If you needed to share the top five, one
way to do this--and there are certainly
| | 00:58 | other ways possibly by way of a filter--
| | 01:00 | we could put a 2 in right here, and
then holding down the Ctrl key, simply
| | 01:05 | create a list down here through 5.
And now I will make this reference here,
| | 01:09 | to cell J3 instead of the 2. And, of course,
on this one, we will get the same answer.
| | 01:14 | Then we can simply double-click to copy
down here, and now we have the second,
| | 01:19 | third, fourth, and fifth salaries.
| | 01:20 | So in each case here, we are simply
using LARGE and if we use SMALL, of course,
| | 01:24 | we can easily reverse this.
| | 01:26 | We will get these from the bottom of
the list, and those salaries that way.
| | 01:32 | So, easy-to-use functions, the kind of
function when I first saw this, I thought I
| | 01:36 | will never use this, but every so
often I seem to need it, and it comes in
| | 01:39 | handy. And there's no other way to do
this other than by sorting the data.
| | 01:42 | So it's a potentially
powerful tool. Easy to use, too.
| | Collapse this transcript |
| Tabulating blank cells with COUNTBLANK| 00:00 | In this worksheet called COUNTBLANK,
column G has some blank entries.
| | 00:05 | Not everybody in this list has benefits.
| | 00:08 | We want to be able to tabulate this information.
| | 00:10 | Now certainly we can use a filter to
show just those people with benefits or
| | 00:15 | just those people without benefits;
| | 00:17 | there is a built-in capability of
filtering to do that for us. But sometimes we
| | 00:21 | just need to tabulate the information.
| | 00:23 | We want to know how many blanks are there.
| | 00:25 | So there is a function called equal COUNTBLANK.
| | 00:27 | This is one of those longer functions,
so as we type =C, perhaps we will
| | 00:31 | find in the list here, scroll down,
use the Tab Key, pop it into place there.
| | 00:36 | There it is COUNTBLANK. Press Tab. There it is.
| | 00:40 | And where are we are looking?
| | 00:41 | We are looking right here.
| | 00:42 | Now you might be tempted to click column
G--and I will, in a bit--but let's just
| | 00:46 | highlight the data here.
| | 00:47 | It's about a hundred rows,
so doesn't take too long.
| | 00:49 | How many blanks cells do
we have in here?
| | 00:51 | Enter. There we go, 28.
| | 00:54 | In other words, 28 people here
do not have benefits in this list.
| | 00:59 | I mentioned that we might possibly want
to click column G as we do this, because
| | 01:03 | we are looking in column G. But I
will point out here--and you'll see
| | 01:07 | immediately, of course, what's happening--
| | 01:08 | this is looking through the entire
column and all those cells below our data
| | 01:13 | here, which are empty, are going to get counted.
| | 01:17 | So that's a huge number.
| | 01:19 | Now for point of contrast, we see up
here how many rows there actually are in
| | 01:24 | an Excel worksheet in Excel 2010. And it's
pretty close to this, but there's a difference there.
| | 01:30 | Now the difference, you can probably quickly
see, is 72, and that's not what we want either.
| | 01:34 | So if you wanted to use the entire
column reference here--say the list were a
| | 01:39 | few hundred, a few thousand--
| | 01:41 | instead of dragging over this, you
might want to piece together a formula.
| | 01:45 | It will be a little tricky at first,
but what you want to recognize is that if
| | 01:50 | you have got data here where all of
the cells within a list are occupied for a
| | 01:55 | given column, like column A here,
| | 01:58 | we could build a formula that
uses that particular capability.
| | 02:01 | It might look something like this.
| | 02:03 | We start with this idea here--in
other words, we need this information--but
| | 02:08 | along with it, we would want to
subtract the information that we see up here.
| | 02:13 | So I am going to put in K1 right there. Minus.
| | 02:16 | Now we are still not there, because
if we subtract, that's not really the
| | 02:20 | answer we are looking for.
| | 02:22 | So the other item that we need to put
into the mix here is simply a function
| | 02:26 | that will count--COUNTA--the number
of entries in one of our other columns.
| | 02:32 | It can be column A, column B, any of
these up here that have complete entries.
| | 02:36 | I will just use maybe column B here,
| | 02:39 | and then put in a minus. And we are not
quite there, but let's see what answer
| | 02:44 | we get here, and you know that's not correct.
| | 02:47 | So what do we need to do?
| | 02:48 | Simply put in left
parenthesis here and at the end.
| | 02:53 | Now this is a little bit contrived
perhaps, a little bit more than you thought
| | 02:55 | we needed to do here,
| | 02:57 | but if the list that you're trying
to use here is quite large, this saves
| | 03:03 | dragging across a huge list to come up
with the cells that you want to look at.
| | 03:08 | That's we did up here, and there it
made sense, because it wasn't so large.
| | 03:12 | But here, even though this is a little
bit involved, it will get us there using
| | 03:16 | the COUNTBLANK Function in
combination with that total row count and the
| | 03:22 | COUNTA Function.
| | Collapse this transcript |
|
|
7. Date FunctionsUnderstanding Excel date/time capabilities in formulas| 00:00 | Many Excel users initially overlook the
ability of Excel to handle information
| | 00:05 | related to dates and times.
| | 00:07 | Let's just start with a simple example here.
| | 00:09 | In column B, in this worksheet called
Dates and Times, we've got a starting date
| | 00:13 | and an ending date.
| | 00:14 | Maybe this represents a project--a long
-term project for sure. Maybe it's a
| | 00:18 | construction project.
| | 00:20 | How many days have elapsed?
| | 00:21 | Of course, we can put in any dates we
want here. And by the way, the entire date
| | 00:26 | system in Excel actually begins January
1, 1900 and goes until the year 10,000,
| | 00:33 | but a simple subtraction of these two cells.
| | 00:36 | Now if you recognize the dates,
actually have a value--and you wouldn't
| | 00:40 | necessarily know that at first--
| | 00:42 | January 1, 1900 has the value 1,
January 2, the value 2, and so on.
| | 00:46 | When you enter a date, the value
is being stored there. So when we
| | 00:50 | subtract dates, we start by typing
equal, and we use the later date first,
| | 00:56 | minus the earlier date, this example here.
| | 00:59 | How many days have elapsed here? 2320.
| | 01:02 | Try that with different dates.
| | 01:03 | You will be surprised
how easy and fast it works.
| | 01:06 | Now of course, that includes weekends,
and that's what we want to do. And I
| | 01:09 | will show you a workaround a bit later on how
you can tabulate just working days here as well.
| | 01:14 | We can also use date math in a different way.
| | 01:17 | We installed a particular
item on the 15th of May in 2009.
| | 01:20 | It has got a lifespan of 1,500 days.
| | 01:24 | When will the product life end?
| | 01:25 | In this case equal, the
starting date here plus 1500.
| | 01:31 | There we are: June 23 in 2013. And of
course, going the other way, 90 days ago,
| | 01:37 | if this is the current date or
whatever the date might be, 90 days prior to
| | 01:40 | that, equal this date, minus 90.
| | 01:44 | And if you need to use today's date in
a calculation--and that could mean that
| | 01:49 | you are setting up a dynamic total--
| | 01:51 | you can use a function called TODAY.
| | 01:53 | =TODAY and you need only
type left parenthesis. Press Enter.
| | 01:57 | At the time of recording,
this is the date: 11/10/2010.
| | 02:02 | If I close this file and
save it, open it tomorrow,
| | 02:06 | it's going to say 11/11,
and so on. It is dynamic.
| | 02:09 | It's the TODAY Function.
| | 02:11 | There is also a function called NOW,
equal N-O-W. And here too you might use this
| | 02:15 | in certain circumstances.
| | 02:17 | We need to only type the
opening parenthesis and then Enter.
| | 02:20 | Here the typical display gives
us the time along with the date.
| | 02:24 | We can choose to leave in this format
here, the way it looks, or right-click and
| | 02:28 | perhaps change the format to be either
a time or a date, using some of the many
| | 02:33 | built-in formats available here.
| | 02:37 | We can also work with times as well.
| | 02:40 | In column F, there is a
check-in time and check-out time.
| | 02:43 | Notice that these presume,
based on what we are seeing here,
| | 02:45 | they are on the same day. Equal. Check-
out time minus check-in time--in other
| | 02:51 | words a later time minus an earlier time.
| | 02:54 | How much time has elapsed?
| | 02:55 | Now strangely enough, when you do subtract times,
the answer at first throws you a little bit.
| | 03:01 | We really don't want to see the AM there.
| | 03:04 | The answer actually is correct, but it
is a little bit unsettling, and we wouldn't
| | 03:07 | leave it in that form.
| | 03:08 | So here too, a quick right-click >
Format Cells. And in the Time category here--
| | 03:14 | second one, not obvious at first perhaps,
but this does not include the AM, PM--
| | 03:19 | We get this kind of result here.
| | 03:21 | And of course, if this did go beyond
12 hours, if we are talking about a
| | 03:24 | different situation or
maybe this is initially 2:13 AM,
| | 03:28 | then the time elapsed here
is 14 hours and 28 minutes.
| | 03:33 | And although we can't literally use
these in a calculation, we can calculate
| | 03:38 | the difference for these kinds of
entries that cross multiple days.
| | 03:42 | And here you've got to do a little bit of
work. But let's say we put in the date
| | 03:45 | first, 11/18/10, space, and how do we type 6 PM?
| | 03:53 | We could type 6:00 PM,
| | 03:55 | we could put in 18:00, and
believe it or not, even 6 P, Enter.
| | 04:01 | And here, similarly, 11/20/10, space. And just
for variation here, I am going to type in 15:00.
| | 04:11 | That's 3 PM.
| | 04:12 | Different way to do it.
| | 04:13 | That's going to work fine, too.
| | 04:15 | Then we can subtract these, so equal,
the later time minus the earlier time.
| | 04:21 | So looking ahead here, that's about two
days or so, but what kind of an answer
| | 04:25 | are we are going to get?
| | 04:26 | You might get something like this, and
this is going to throw you a little bit too.
| | 04:29 | What do we need to do here?
| | 04:31 | We need to format this as a time using 13:30.
| | 04:37 | Now that's surprising too, isn't it?
| | 04:40 | Are we crossing two days?
| | 04:41 | Surely it's more than 21 hour. What
you wouldn't know necessarily here, and
| | 04:45 | what you have to use in certain
situations if you're dealing with times of
| | 04:49 | day and differences,
| | 04:50 | if those differences exceed 24 hours or
48 hours or 72 hours and so on, you will
| | 04:56 | get a multiple, or a leftover amount. And
the format we need for this, that's just
| | 05:02 | not so obvious, is this one here that has
a 37 in it, believe it or not. Click OK.
| | 05:07 | So there's the actual answer.
| | 05:08 | Its 45 hours, and it does throw
people at first when that happens.
| | 05:12 | By the way, when it comes to times,
times are actually portions of a day.
| | 05:17 | And when we look at a time like this, even
though you don't see what's behind the scene,
| | 05:21 | if you were to press on the Home Tab,
for example, the Comma button, that's
| | 05:25 | actually 0.09, or I could say
9% of the day, two hours in.
| | 05:30 | And so times actually are recorded as
percentages of the day, or a portion of the day.
| | 05:36 | The unit of measure in the daytime
system is one equals a single day.
| | 05:40 | We almost never look at these numbers,
although occasionally they do appear in
| | 05:45 | calculations if there's a formatting issue.
| | 05:47 | I am going to press Ctrl+Z here to go backward.
| | 05:49 | One other issue that may throw you:
| | 05:51 | look at the date in cell B12 here, 12/3/30.
| | 05:56 | If you had typed that in, were you
thinking 2030, or were you thinking 1930?
| | 06:02 | Well, regardless of what you are
thinking, look in the formula bar or
| | 06:05 | double-click here, and what
are we seeing? It is 1930.
| | 06:08 | If you're typing date entries and you
use a two-digit year, all numbers from 30
| | 06:14 | through 99 are interpreted in the 20th century.
| | 06:18 | All entries from 0 through 29 are
interpreted to be in this century.
| | 06:23 | To eliminate any doubt, type four-digit years.
| | 06:26 | Now that might be more typing than you
want to do. And I think in many, many
| | 06:30 | business situations, much of the
time you don't worry about this.
| | 06:34 | But what will happen, probably five
years down the row, ten years, perhaps some
| | 06:38 | where, Microsoft will make another
executive decision and say, automatically
| | 06:42 | when you type a two-digit year, and
they will probably bump up this boundary
| | 06:47 | here. Maybe they will make it from 0-
39 is this century and so on, so there
| | 06:51 | might be a change there.
| | 06:52 | Just be very careful when you're
putting in dates that might overlap this
| | 06:56 | kind of a timeframe.
| | 06:57 | So as we've seen, Excel has the
ability to handle date and time math, and we
| | 07:02 | will see see upcoming functions as well.
| | 07:05 | This is a capability that if you
haven't seen it, you owe to yourself, because
| | 07:09 | there's some real power here, and the
ability to analyze data based on date and
| | 07:13 | time information is one that
most Excel users will find valuable.
| | Collapse this transcript |
| Identifying the day of the week with WEEKDAY| 00:00 | In this worksheet called Weekday, we want
to know the day of the week for the sales.
| | 00:05 | Imagine this organization sells heavy equipment.
| | 00:07 | They don't have sales every day.
| | 00:09 | We're trying to see if there's some
kind of pattern about which days of the
| | 00:12 | week sales occurred on.
| | 00:14 | Excel has a function called WEEKDAY.
| | 00:19 | We want to know the weekday of this cell in A2.
| | 00:23 | The answer is a little disappointing.
| | 00:24 | 2 actually means Monday, 1 means
Sunday, 3 means Tuesday, and so on.
| | 00:30 | And we can certainly get used
to using the numbers, possibly.
| | 00:34 | Here's how they play out in
the rest of the worksheet.
| | 00:36 | This is on Friday, here's the
Friday, here's the Thursday, and so on.
| | 00:39 | You can get used to using this, but it
certainly would be better if we could
| | 00:43 | format these--and we can--to display
the actual day of the week, either as an
| | 00:48 | abbreviation or as a full spelling.
| | 00:50 | By either right-clicking, pressing
Format Cells, or pressing Ctrl+1, we will go
| | 00:56 | to the Format Cells dialog box, and
the not so obvious choice here is Custom.
| | 01:02 | What we want to put into the panel
right here is either three Ds, if we'd like
| | 01:07 | to see an abbreviation like MON and TUE
and so on, or four letters to spell this out.
| | 01:13 | Click OK.
| | 01:14 | I think most people would prefer this idea.
| | 01:16 | It's a lot more readable.
| | 01:18 | Now remember, the function is still
there, and it's still doing its work
| | 01:21 | like before, but instead of showing numbers,
we're seeing actual text, which makes sense here.
| | 01:25 | So this helps us a bit in
understanding what's going on.
| | 01:29 | And imagine how this can be applied to
other kinds of data that you work with.
| | 01:33 | Sometimes you'll see some real
surprises here about what's going on.
| | 01:36 | Does it have to do with sales?
| | 01:38 | Does it have to do with orders?
| | 01:39 | Any particular day of the week, that's just
kind of jumping out of here in an unusual way?
| | 01:44 | And once you are familiar with the
WEEKDAY function, you can apply it to other
| | 01:48 | Excel features as well.
| | 01:50 | In column F are some sale dates, and
let's imagine that, manually, shipping dates
| | 01:56 | are entered here, but we want to be sure
that no shipping date is assigned here,
| | 02:00 | let's say Saturday or a Sunday, because
you don't do shipping perhaps on those days.
| | 02:06 | So, what we'd like to be able to set up
here, and we can, is a data validation
| | 02:10 | rule that uses the Weekday function.
| | 02:13 | So I'm going to click column G here, and
on the Data tab in the Ribbon, use Data
| | 02:19 | Validation. And the word "Allow" here,
every time I see it, I want it to say
| | 02:23 | require, because what we're about to do
here is to require that the setting in
| | 02:28 | column G adheres to a custom
formula that we're about to write.
| | 02:33 | This formula is certainly not obvious,
but once you see it, it will make
| | 02:37 | perfect sense. And of course, what
we're aiming for here is to prevent Saturday
| | 02:42 | and Sunday entries.
| | 02:44 | We will start by just
actually using the WEEKDAY function.
| | 02:47 | Now, you don't have to really capitalize it;
| | 02:49 | it will become capitalized
eventually anyway. But the core of this is the
| | 02:53 | following idea: the weekday of what?
| | 02:57 | Strangely enough, G1.
| | 02:59 | Now, G1 is currently the active cell,
but we have highlighted the entire column.
| | 03:04 | By inference, G1 will refer
to every cell in the column.
| | 03:09 | That's all we need to type.
| | 03:10 | So, if the weekday of G1--we want to
make sure that this is not equal to, and
| | 03:17 | that's the less than
followed by the greater than arrow.
| | 03:20 | We want to make sure
that this is not equal to 7.
| | 03:23 | That's Saturday. Comma.
| | 03:25 | And so we need to precede all
this with =and. Two criteria here.
| | 03:32 | The first one is the
weekday of G7 not equal to 7.
| | 03:35 | Now, I'm just going to highlight this
here. Because I'm a slow typist, I'm going
| | 03:39 | to press Ctrl+C, click over here, Ctrl+
V. We also want to make sure that the
| | 03:44 | weekday here is not equal to 1. That's Sunday.
| | 03:47 | Now, of course, you can do these in any
order you want. And then a right parenthesis.
| | 03:52 | So, even though that's not--as I
suggested--not the most obvious formula--this
| | 03:56 | is exactly what we want to do here.
| | 03:58 | Now, one more slight glitch here.
| | 04:00 | As we click OK, we're going to get a
message that threatens us a little bit:
| | 04:04 | The formula currently evaluates to an error.
| | 04:07 | Now, that simply means that literally
cell G1 doesn't fit this. It doesn't make any
| | 04:13 | sense here, but we're ignoring that.
| | 04:15 | It's got text in it.
| | 04:16 | We just click Yes and move on.
| | 04:17 | All right, so here's the Shipping Date.
| | 04:19 | I'm going to put in a date: 1/23/10.
| | 04:20 | Is that okay? Yes.
| | 04:25 | Oops! No, it's not.
| | 04:26 | Now, we don't necessarily know,
based on this message, what went wrong.
| | 04:31 | If you're the one that created it, you
might, but you might want to consider
| | 04:34 | rewriting the message here.
| | 04:36 | So, for whatever reason, that's wrong.
| | 04:38 | Let's try another date. Let's retry.
| | 04:40 | Let's try the 22nd.
| | 04:42 | Looks like that's okay.
| | 04:43 | Now, if we were curious, of course, we could
figure this out kind of quickly. That's a Friday.
| | 04:49 | It looks like that previous day was a Saturday.
| | 04:51 | So, you saw how it works.
| | 04:53 | If you'd like to control what the
message actually says--and we do this for the
| | 04:58 | whole column--revisit Data Validation,
and if you want the message to be
| | 05:02 | meaningful, you can jump right into
Error Alert here, and that's okay.
| | 05:06 | You see this prompt again.
| | 05:08 | We'll provide the message,
and something along the lines.
| | 05:11 | I'm being a little cryptic here.
| | 05:12 | Data entered is Saturday or Sunday,
is Saturday or Sunday - re-enter.
| | 05:19 | Now, some people of course get a
little gleam in their eye when they realize
| | 05:22 | this is going to pop up on
the screen in the dialog box.
| | 05:25 | Time to get clever or cute or whatever,
but this is a direct message, and we
| | 05:29 | click OK. And again, we see
this, but we'll try this again.
| | 05:32 | This time we will put in the 23rd
just to see that message. There it is.
| | 05:36 | So you do have control over that as well,
but the key idea is using this WEEKDAY
| | 05:41 | function in this data validation rule,
to make sure that we're not putting in
| | 05:45 | dates that are on a certain day of
the week. And we saw how valuable that
| | 05:49 | function was used also in column B here.
| | 05:51 | So it's a function to keep an eye on.
| | 05:53 | Anytime you're analyzing data--whether
it relates to orders, or sales, or even
| | 05:57 | in a non-business environment--
knowing day of the week is a valuable tool.
| | Collapse this transcript |
| Counting working days with NETWORKDAYS| 00:00 | In this worksheet called NETWORKDAYS,
we're going to use a function called--
| | 00:05 | strangely enough--NETWORKDAYS.
| | 00:07 | We want to know how many working
days exist between the two dates.
| | 00:11 | Now, notice that I've put in
these dates twice in two columns here.
| | 00:16 | We want to show the basic way of doing
this, and a reminder for some of you that
| | 00:19 | we simply can subtract two
dates to get the number of days.
| | 00:23 | This is not ultimately what we want, but for
contrast, I'm going to show the difference.
| | 00:27 | Equal a later date minus an earlier
date. How many days between the two here?
| | 00:32 | Counting both the
beginning and ending date, 95 days.
| | 00:36 | Well, in most environments, we're
not talking about a seven-day working
| | 00:41 | week, but a five-day.
| | 00:42 | So let's use the function and remember
on longer functions you might as well
| | 00:48 | click here. And by the way,
NETWORKDAYS has an addition in Excel 2010.
| | 00:53 | You may want to explore a
function called NETWORKDAYS.INTL, meaning
| | 00:58 | international, because weekends occur on
different days in different parts of the world.
| | 01:03 | We're going to use NETWORKDAYS.
Just click it here and press Tab.
| | 01:07 | The starting date is A3,
comma, the ending date is here.
| | 01:12 | For the moment, we're
going to ignore the holidays.
| | 01:14 | How many working days
between those dates? It's 68,
| | 01:18 | not counting Saturdays and Sundays.
| | 01:21 | Now, some holidays
occurred between these two dates.
| | 01:24 | Let's do this again.
| | 01:24 | I'm simply going to copy this downward.
But this time I'm going to make an
| | 01:28 | adjustment, and you'll notice in
column E, we have some holidays, and we can
| | 01:31 | refer either to the entire column or
maybe just the relevant dates, either way.
| | 01:36 | What are the work dates overlapping here?
| | 01:37 | What do they involve?
| | 01:38 | This chunk right here.
| | 01:39 | So do it this way or highlight
the whole column, either way.
| | 01:42 | Make sure we include the ones that are relevant.
| | 01:45 | And now, what's going to
be the difference? 66 days.
| | 01:48 | And so we can see how this will play out
over projects, for example, that cross
| | 01:52 | holidays here, and so on.
| | 01:54 | The difference being sometimes you
want to focus on the holidays, sometimes
| | 01:58 | not, but it quickly gets
us to where we need to get.
| | 02:02 | Now, if you're trying this on a short
timeframe--for example, I'll just make
| | 02:06 | up a date here, 11/8/10 and 11/15/10.
| | 02:14 | Now, those are two consecutive Mondays.
| | 02:17 | Let me just copy this
particular formula down here.
| | 02:20 | I'll do this by dragging with the
Control key, put the formula right here.
| | 02:24 | Now, that's 6 days.
| | 02:25 | Do recognize that it's counting
the beginning and the ending day.
| | 02:29 | I think most of the time that's
probably what you want to do, but if this
| | 02:32 | project started on noon on one Monday
and ended on noon on the following Monday,
| | 02:37 | well, that's only five days.
| | 02:39 | So, here and there as you use this
function, you might want to subtract one.
| | 02:43 | But in other respects, it's a great function.
| | 02:45 | It gets the job done, it quickly lets
us know the amount of working days--not
| | 02:49 | counting Saturdays and Sundays--and more
appropriate, not counting those holidays as well.
| | 02:53 | And one small point here too: if a
holiday falls on a weekend, as July 4th did
| | 02:59 | in 2010, it does not get discounted
twice, but just once, because it's a
| | 03:04 | weekend day.
| | Collapse this transcript |
| Determining a completion date with WORKDAY| 00:00 | In tabulating the length of projects in
many typical work environments, we don't
| | 00:05 | want to include weekend days.
| | 00:07 | Let's must remind ourselves
that the function called WORKDAY--
| | 00:10 | and we're on a worksheet called WORKDAY--
allows us to tabulate an ending date. And we
| | 00:16 | may or may not want to include holidays
here, but lets just point out that if we
| | 00:20 | simply begin a project on June 10, 2010,
and it's 60 days, we could easily make
| | 00:27 | the mistake of simply taking these two
cells and adding them to come up with an
| | 00:32 | answer. But that certainly
does include weekend days.
| | 00:35 | If you aren't a seven-day work
environment and the project starts on June 10th,
| | 00:39 | and it's 60 days long, then the
last day truly is August 9th.
| | 00:44 | But let's talk about the idea that in
many environments it's a five-day week.
| | 00:48 | So we want to without painstakingly
counting those weekend days and not including
| | 00:53 | them in our list here, we will choose =WORKDAY.
| | 00:57 | Here's that starting date.
Comma. Here's the project length.
| | 01:01 | I am not counting
Saturdays and Sundays this time.
| | 01:03 | When will the project end?
| | 01:04 | And there we see it. On September 2nd.
| | 01:08 | Now there are some holidays involved here,
and we have got a list of holidays in
| | 01:12 | column A. We can either highlight the
relative ones as we use this function--
| | 01:16 | I will just copy this down and re-adjust it--
| | 01:18 | but we want to use the WORKDAY function
here to not include those holidays as well.
| | 01:23 | Now July 4 in this particular entry
here has a weekday. I'll use this function.
| | 01:31 | Weekday of 1: it's a Sunday.
| | 01:32 | That's not going to get discounted twice,
but we do want to make sure that other
| | 01:36 | holidays that might occur here are not
going to be included--maybe labor day.
| | 01:40 | So editing this function, comma, let's
not include the holidays here.
| | 01:45 | And because I included the A1 there, that
didn't work, so we just want to use the relevant days.
| | 01:51 | You can highlight all these, even though
it includes dates well beyond the range
| | 01:54 | we are interested in. There we go.
| | 01:55 | So it's only a one-day difference, and
that's probably because July 5th, which is
| | 02:00 | on Monday, was a holiday in this
particular working environment.
| | 02:04 | So this plays out very similarly to the
NETWORKDAYS function that you might've
| | 02:08 | seen in a previous movie.
| | 02:09 | But WORKDAY allows us to calculate not
only project lengths, but I think you can
| | 02:13 | imagine using this with other
similar kinds of data as well.
| | 02:17 | It doesn't count weekend days and where
appropriate also omits holidays
| | 02:22 | in the calculation.
| | Collapse this transcript |
| Tabulating date/time differences with DATEDIF| 00:00 | A powerful Excel function, and one that
strangely undocumented in Excel, is called DATEDIF;
| | 00:07 | that's the name of the
worksheet we are looking at here.
| | 00:09 | In columns A and B, we have got
some starting and ending dates.
| | 00:12 | We want to know how much time has elapsed.
| | 00:15 | In column E, you'll notice the letters y,
m, d. You probably quickly you are figuring
| | 00:19 | out what that means: years, month, date.
| | 00:21 | We might want to track elapse time
strictly on the basis of how many years it's been,
| | 00:26 | how many months it's been,
| | 00:27 | how many days, or maybe how many
months since the last yearly anniversary,
| | 00:33 | how many days since the last yearly anniversary,
| | 00:35 | and so on. Here is the function DATEDIF.
| | 00:37 | Now before doing this, I want to point
out that if I said there is a function
| | 00:42 | called DATEDIF and conversation got
interrupted--we didn't go much further at
| | 00:46 | the point--and you're trying to look
this up later, you might go to the Formulas
| | 00:50 | tab, here are Date & Time functions, and
you will not find DATEDIF. It's not here.
| | 00:57 | Or what if you say, "Well, I know if I
click fx, I can find any function I want,"
| | 01:01 | you'll click the Insert Function button here.
| | 01:04 | You narrow it down by Date & Time.
But maybe you have done this previously.
| | 01:08 | Maybe not. Maybe you are looking at all of them.
| | 01:09 | You will click the letter D here.
| | 01:12 | There is DATE but no DATEDIF.
| | 01:14 | You don't find it here, and
you don't find it here either.
| | 01:17 | It's nowhere to be found,
and yet it's available.
| | 01:21 | Let's look at =DATEDIF.
| | 01:23 | Now as I am typing in here too, we don't see
a pop-up below DATEDIF. Left parenthesis.
| | 01:29 | We don't even see a prompt as to what to put in.
| | 01:31 | Let's put in the starting date
that's in cell A2 in this example, comma
| | 01:36 | the ending date, comma.
| | 01:38 | If we like this in years--and look ahead
there, how many years is that? Just over six--
| | 01:43 | then we'll put it within
double quotes, the letter y.
| | 01:46 | Upper or lowercase doesn't make any difference.
| | 01:49 | We are done here. The answer is six.
| | 01:51 | If we wanted to know the number of
months, we'll put it in m instead. And sure
| | 01:56 | enough, if we want days, d.
| | 01:59 | So those are pretty quickly obvious
ones you can use to them. And if we wanted
| | 02:02 | to know how many days it's been since
the last yearly anniversary, you can
| | 02:06 | probably do the math in your head there.
| | 02:07 | That's going to be 26. We'll put in yd.
| | 02:11 | How many days has it been
since the last yearly anniversary?
| | 02:14 | There it is. And you can experiment
with those other choices out there as well.
| | 02:18 | Now something else to be pointed out here:
think of this as working in the same
| | 02:22 | way that we use our birth dates.
| | 02:24 | For example, the start date here
is June 3rd, what if the ending date
| | 02:28 | would June 1st or 2nd?
| | 02:31 | A quick look here says, oh that's
been six years. Well, not quite.
| | 02:34 | Go into the function here and
make this be simply y again.
| | 02:39 | And we see what's happening: five years,
because we haven't reached the secure
| | 02:43 | level. In other words, it doesn't round up.
| | 02:45 | Think of this as what we do with our
birthdays. If you are 39 years and 11
| | 02:50 | months, well you are 39. Same idea here.
| | 02:53 | Now in columns G and H, this
is a not uncommon situation.
| | 02:58 | You might have a column called
Hire Date, say it's an HR kind of list.
| | 03:03 | You want to know how many
years a person has been here.
| | 03:06 | Now in this example, you don't want
to be constantly recalculating this or
| | 03:10 | putting it in manually.
| | 03:11 | You want it to be up to date all of the time.
| | 03:13 | So take advantage of the fact that the
TODAYS function will work with today's
| | 03:19 | date and always be accurate.
| | 03:21 | So here is DATEDIF, and as in the
previous examples we want to put in the
| | 03:25 | starting date right here, comma, and
then today's date with the function TODAY.
| | 03:30 | Now at the time of this recording, it's
November of 2010, and we want to know
| | 03:35 | how many years it's been here.
You can probably do the math in your head.
| | 03:38 | It's 15 years, right?
| | 03:39 | I need a right parenthesis. There we
go. Number of years. And we will just
| | 03:43 | copy this down in the column, and you can
quickly check out a few of them here and there.
| | 03:47 | It makes good sense. And by the way,
it's before November 18th, so in the example
| | 03:52 | here even though I am in the year
2010, that's not three years yet.
| | 03:55 | Now the advantage of this
is this might be a huge list.
| | 03:58 | This goes down to row 240, or whatever.
| | 04:01 | You could say on the average if I open
this file everyday, on most days, one of
| | 04:06 | these will have changed--
at least every so often one will.
| | 04:09 | We don't obsess or worry about that.
But this is a dynamic way to have this
| | 04:14 | field always be up to date, using this
great function called DATEDIF. And I have
| | 04:19 | yet to find out why this is not
documented, but use it to your advantage, and
| | 04:23 | experiment a bit with some of the
other capabilities using ym, yd, md.
| | 04:28 | I think for most people they are the
most frequent use of this would be to
| | 04:30 | calculate years the way
we see it being used here.
| | 04:33 | I think it's a really valuable function.
| | 04:35 | I use it all of the time.
| | Collapse this transcript |
|
|
8. Math FunctionsWorking with rounding functions | 00:00 | Excel has any number of rounding
functions, and they are displayed here in
| | 00:04 | column I. Let's take a look at some of these.
| | 00:06 | The most obvious and the most frequent
one to be used is likely to be--for most
| | 00:10 | people--the function called ROUND.
| | 00:13 | Now, let's look at something
pretty basic and yet something that many
| | 00:16 | Excel users overlook.
| | 00:18 | In column A is a simple formula
in A7 that adds the cells above.
| | 00:23 | And no real mysteries here.
| | 00:24 | Nothing unusual going on.
| | 00:26 | And certainly I don't think anyone would
display this in a rounded form, but you
| | 00:31 | can do this, and here is where
the mistake comes in sometimes.
| | 00:34 | And I think in this example, it's so
obvious that you wouldn't do it, but we'll
| | 00:37 | show you other situations for this might happen.
| | 00:39 | Someone makes the decision to say,
"Well, we should just round this display.
| | 00:42 | We don't want to see the decimals."
| | 00:44 | On the Home tab, in the Number group,
you may well be aware of a button that
| | 00:48 | decreases the display of decimals,
and that is the way to say it: Decrease Decimal.
| | 00:53 | Show less precise values.
| | 00:55 | Now we are not changing the value here,
but as I click this, keep your eye on
| | 00:59 | column A. Now, who would
ever leave this in place?
| | 01:03 | Five times five is not 23,
and yet what's the real value here?
| | 01:08 | Did we really change anything?
| | 01:10 | We changed the appearance but not the content.
| | 01:13 | It's pretty obvious that we
wouldn't leave it this way.
| | 01:15 | Probably what we might do, or at
least one of the things we could consider
| | 01:18 | doing, is press the comma, either leave
it like this, or possibly show just one
| | 01:22 | decimal, so that it makes sense.
| | 01:24 | Now let's show how this might be misused.
| | 01:27 | We are going to calculate a new price
for this item here, and all rest in this
| | 01:31 | column here, by simply writing a formula
to take the current price times and all
| | 01:36 | these items here are going to be
increased by 4.36%. That's in G1 here.
| | 01:42 | We want to copy this down the column,
so we'll press the F4 key to make that be
| | 01:46 | an absolute address.
| | 01:47 | We'll add this on to the original price
and here is our answer, and we'll copy
| | 01:52 | this down the column.
| | 01:53 | Now to the right of this is a
formula, and it actually calculates this
| | 01:57 | amount times 10,000.
| | 01:59 | But you're seeing this and
saying, "Well, wait a minute here.
| | 02:02 | Wouldn't that be 90,000?"
| | 02:04 | Well, this suggests something is a
little strange here. Is that really $9?
| | 02:08 | Let's show more decimals.
| | 02:10 | Let's see what's happening here.
| | 02:12 | As I show more decimals by increasing, the
calculation to the right will not change.
| | 02:18 | So I am not changing the value here;
| | 02:20 | I am changing the display.
| | 02:22 | So the real value of this new price is not
just $8.99, but there is .58 cents left over.
| | 02:30 | It's actually there.
| | 02:32 | So what should we do in the situation?
| | 02:34 | We will not be using the
buttons here to change the amount.
| | 02:37 | What we really need to do is to use a
function called ROUND that truly will change this.
| | 02:43 | We put ROUND in front of this and then
left parenthesis, and we can round this
| | 02:47 | to any number of different digits.
| | 02:49 | If we put in comma 2, we are rounding
this to the nearest two decimals or in
| | 02:54 | common parlance, the nearest penny.
| | 02:56 | That's probably what we want to do.
| | 02:58 | And as I press Enter here, the result
truly will be $9 in that calculation, and
| | 03:04 | F2 will be exactly 90,000.
| | 03:08 | And of course, we eventually would
redisplay this with only 2 decimals, and
| | 03:12 | adjust our other entries as well.
| | 03:14 | Now just a quick look, on some of
these as we increase the decimal, we see what's going on here.
| | 03:18 | Now we truly would want to
round those to the nearest penny.
| | 03:21 | Now, in column L we see a similar kind of
calculation with salaries. Same idea here.
| | 03:26 | We want to show that existing salary
times a certain percent, and then add on to
| | 03:31 | the original salary.
| | 03:32 | And you might be thinking, "Well
who cares about the pennies here?
| | 03:35 | Why don't we just get rid of them somehow?"
| | 03:36 | Well, we certainly could do that.
| | 03:38 | And in a calculation like this--by the
way, if we want to copy this, we here too
| | 03:42 | would make this absolute with the F4 key.
| | 03:44 | But let's consider how we might want
to round this particular set of numbers.
| | 03:49 | We might want to round yearly salaries
to the nearest dollar, and in that case
| | 03:53 | we wouldn't use 2, but
comma 0, to the nearest dollar.
| | 03:58 | You can see what's happening there.
| | 04:00 | Drag down a few to see what's
happening to the nearest dollar.
| | 04:03 | Notice in the second case we are about to
change that into 69,533, one below it: 80,096.
| | 04:10 | So this is, again, truly changing
the values by using the ROUND function.
| | 04:16 | I have seen salaries in some
organizations that are calculated to the nearest $100.
| | 04:20 | Let's hope that the people seeing the
calculation don't see the original numbers maybe.
| | 04:25 | But we will make this be a -2.
| | 04:28 | Now there could be times when you want
it to override, or change, the meaning of
| | 04:33 | rounding, so that the rounding goes up or down.
| | 04:37 | So on the example here--I am
going to press Ctrl+Z to go back for a
| | 04:40 | second here--this is 265.
| | 04:41 | If we choose a function called ROUNDDOWN,
this is going to end up being 37,200.
| | 04:48 | Possibly we want to do this.
| | 04:50 | Not tell our recipients necessarily. ROUNDDOWN.
| | 04:54 | So it overrides standard rounding rules
here, that 80,096 goes down to 80,095.
| | 05:02 | We are rounding to the nearest dollar.
| | 05:04 | Now if we do this with 100, meaning we
use a minus -2 here to the nearest $100,
| | 05:10 | it's certainly going to
be a more dramatic change.
| | 05:12 | This moves down, and then as I drag
this downward, you see the 80,095.
| | 05:17 | What is it going to be? 80,000 exactly.
| | 05:20 | And sure enough, there is the opposite of this;
| | 05:23 | that's ROUNDUP, a more popular
decision with this list for sure, but see
| | 05:27 | what's happening there.
| | 05:28 | So you want to explore that a little bit.
| | 05:30 | ROUND is certainly the most common.
| | 05:31 | This allows us to override standard
rounding rules by moving up or down.
| | 05:36 | And in all these cases, too, you are
going to control how many decimals.
| | 05:39 | Now less like to be used, but you
want to be aware that they do exist, are
| | 05:42 | three related functions.
| | 05:44 | Think of these as being parallel
to ROUND, ROUNDUP, and ROUNDDOWN.
| | 05:48 | And this has to do when we are dealing
with values that are not multiples of 10,
| | 05:52 | or decimally oriented is a better way to say it.
| | 05:54 | Maybe on the pricing here, for whatever
reason, we want a calculation that uses
| | 05:59 | the 4.36% as a starting point, but we
want to take the result and round to the
| | 06:04 | nearest nickel, for example.
| | 06:06 | So we'll use MROUND here, and then
instead of the 2 here, we'll put in .05.
| | 06:11 | Now the example here it's still
going to take it to $9. That's okay.
| | 06:15 | But it's going to make some changes
here and there, as we round these to the
| | 06:19 | nearest nickel, and we
see what's happening there.
| | 06:22 | And sure enough, if you like to round
upward, no matter what, it's not MROUNDUP.
| | 06:26 | It's actually called CEILING.
| | 06:28 | That will take us to the next five cents upward.
| | 06:31 | And that's certainly has a specialized
use, but we could be using that there.
| | 06:36 | And so the next one, for example 3.35,
a lot of these are going to stay the
| | 06:40 | same, but some of these
will go upward. There we go.
| | 06:41 | That one is changing. So.
| | 06:45 | And sure enough, the opposite of CEILING,
in real life as it is here, is FLOOR.
| | 06:49 | So some of these you might
want to go the opposite direction.
| | 06:52 | So that's in parallel
with the ROUNDDOWN function.
| | 06:55 | And certainly less likely to be used,
but another possibility here is INT,
| | 06:59 | meaning integer, and this function
simply truncates or throws away pennies.
| | 07:04 | That keeps just the integer value.
| | 07:06 | Possibly you could use it here, if we
use INT, again thinking integer and with
| | 07:12 | no number out here at all whatsoever, we
simply are in effect throwing away the pennies;
| | 07:16 | that's all it does.
| | 07:18 | You might look up, on your own, ODD and EVEN.
| | 07:20 | I'll just--a quick look at these two.
| | 07:22 | I rarely use these, but here is an example here.
| | 07:24 | I want the next odd number.
| | 07:27 | ODD here simply picks the next odd number
from this value looking upward. Same thing here.
| | 07:33 | And sure enough, there is one
down here called EVEN as well.
| | 07:36 | But the main focus of these is to
recognize the idea that there are times when
| | 07:40 | you need to change the result of a calculation.
| | 07:43 | By no means do you want to rely upon
Formatting buttons available in the Ribbon.
| | 07:47 | These functions actually
change the result of formulas.
| | 07:51 | And know the ones you should be using
when you run into these accounting issues:
| | 07:55 | ROUND, ROUNDUP, and ROUNDDOWN, and the
companions for non-decimally oriented
| | 08:00 | information MROUND, CEILING and FLOOR.
| | Collapse this transcript |
| Finding the remainder with MOD and using MOD with conditional formatting| 00:00 | If you have that extra moment and you're
exploring some of the many functions in
| | 00:03 | Excel--most of us don't
have the time to do that--
| | 00:06 | but if you went to the Formulas tab
and were looking at some of the math
| | 00:09 | functions, I don't think you would be
initially attracted to, or have any reason
| | 00:14 | to go to, a function called MOD.
| | 00:16 | If you see the description, it looks
a little vague: "Returns the remainder
| | 00:20 | after a number is divided by a divisor."
| | 00:23 | And why would you ever want to use that?
| | 00:25 | That was certainly my rationale for many years.
| | 00:27 | Then I saw a situation where
it was the perfect function.
| | 00:31 | Here's a situation here where in column
A we've got the names of some items, and
| | 00:35 | we've got so many of them left over.
| | 00:37 | There's 162 of these. Maybe this
company is consolidating or it's moving its
| | 00:41 | distribution center.
| | 00:42 | They have got 162 of these items.
| | 00:45 | Now these items are all different, and
they do have containers that we can put
| | 00:49 | them into, but for this particular
item we can only get 16 per container.
| | 00:54 | If we start using the containers to
put these items in here, how many are we
| | 00:58 | going to have left over?
| | 01:00 | In other words, if we divide this by 16,
you know it's not going to come out even.
| | 01:04 | We are going to have two of them left over.
| | 01:06 | And of course, we want to
take care of all these at once.
| | 01:08 | So what we are talking about here?
| | 01:09 | The function called MOD.
| | 01:11 | It calculates the remainder in a division.
| | 01:14 | Here's the number we are
looking at. Comma. Here's the divisor.
| | 01:18 | It's not going to tell us how many boxes,
| | 01:20 | how many containers we need;
| | 01:22 | it's going to tell us how
many are going to be left over:
| | 01:25 | two. Of course, some of these you can do
the math in your head; others you can't.
| | 01:29 | So let's double-click.
Copy this down the column.
| | 01:31 | Here and there, of course,
we have got a perfect fit.
| | 01:33 | 168 divided by 24 is 7.
| | 01:36 | We don't care about that, but
how many are left over? None.
| | 01:38 | You see what's happening
here. So it's an ideal use.
| | 01:42 | It's dividing these and then
calculating the remainder for us.
| | 01:45 | How many items are we going to have left over?
| | 01:48 | I guess we have got quite a few.
| | 01:49 | One more and we could fill up a container.
| | 01:52 | Now there's another
application here too, and not so obvious.
| | 01:55 | Sometimes you want to format a
worksheet so that every other row is of a
| | 02:00 | certain color possibly.
| | 02:01 | Many of you know that perhaps the better way
to do this would be to go to the Insert tab--
| | 02:06 | you can also get the here on a
Home tab--and turn this into a table.
| | 02:11 | Now you may not want some of the side features,
| | 02:13 | but we see what's happening here.
| | 02:14 | And if you don't like
those colors, well, go for it.
| | 02:16 | You got 62 other choices out here.
| | 02:19 | Have fun with that.
| | 02:20 | Let me press Ctrl+Z to undo this.
| | 02:22 | But sometimes you want control of it:
Maybe you are going to be printing this.
| | 02:24 | You might be using it for display.
Maybe you want every fifth row to be a
| | 02:28 | certain color, or every tenth row, or whatever.
| | 02:30 | Let's select the entire worksheet and
use conditional formatting in combination
| | 02:36 | with the MOD function.
| | 02:37 | This is on the Home tab.
| | 02:39 | Conditional formatting is not build in
to any of the standard capability here,
| | 02:43 | but we do have the ability to
create what's called a new rule.
| | 02:48 | In this particular dialog box
here, choose Use a formula to determine
| | 02:52 | which cells to format.
| | 02:54 | Now in English, here's what we are about to say.
| | 02:56 | If the row number of a cell is evenly
divisible by 5--and of course that means
| | 03:01 | row 5, row 10, whatever--then we
want to make that row yellow, blue, or
| | 03:05 | whatever we want equal.
| | 03:07 | Now the entire worksheet is selected,
but the active cell is in cell A1.
| | 03:11 | So that's the cell we will use in the
rule. Not an obvious thing, but once you
| | 03:15 | use it, you will get comfortable with the idea.
| | 03:17 | Equal. And we want to use the MOD function.
| | 03:20 | Then row, the row number of the cell
A1 comma 5, meaning we want to take the row
| | 03:28 | number of every single cell in this
worksheet, one by one as it gets
| | 03:33 | encountered, and essentially divide it
by five. And when the remainder is 0--
| | 03:38 | in other words, that's when it's
evenly divisible by 5--we don't put in
| | 03:42 | the division symbol.
| | 03:43 | When it's equal to zero,
then it's evenly divisible by 5.
| | 03:47 | Then we want to apply a format.
| | 03:49 | Let's just say yellow. Click OK.
| | 03:51 | Again, the more you look at this, the
more it makes sense. But if you only see
| | 03:55 | it occasionally, you have to
kind of think it out a little bit.
| | 03:57 | Even though we're only using A1, we have
selected the entire worksheet. Think of
| | 04:02 | it as a surrogate or substitute
for all the cells in the worksheet.
| | 04:05 | Every time every single cell is evaluated,
its row number is divided by 5 and if
| | 04:11 | the remainder is 0, we are going to
make that cell yellow. And there it is.
| | 04:16 | Of course, if you want every fourth row
or every third row, you just tweak that
| | 04:20 | slightly and you use the
number 3 or 4 instead of 5.
| | 04:23 | So you see a different
use of the MOD function.
| | 04:26 | So either in that example, or in the
example we used here, sometimes you will
| | 04:30 | encounter functions and have no idea
where you might want to use them, and yet
| | 04:34 | this makes perfect sense.
| | 04:35 | If you are a mathematician, you
might easily gravitated toward this little
| | 04:39 | faster, but nevertheless it works just great.
| | Collapse this transcript |
| Building random number generators with RAND and RANDBETWEEN| 00:00 | There are two interrelated
mathematical functions called RAND--
| | 00:04 | that's the name in this worksheet, by
the way--and RANDBETWEEN. And although they
| | 00:08 | appear to have specialized uses,
| | 00:09 | there are two common uses
that you might to consider.
| | 00:12 | Here's a database-type list.
It might be thousands of rows.
| | 00:15 | Sometimes with lists of data, we
need to do some casual spot-checking.
| | 00:20 | We could be a little bit
more methodical about that.
| | 00:22 | But the point might be that we might
want to randomize the order of this
| | 00:26 | list: Maybe our idea of quality
control is simply to review three or four of
| | 00:31 | these every month or so.
| | 00:32 | Maybe this has to do with orders.
| | 00:34 | Pick a column to the right here, an
empty column, and put in the function =RAND.
| | 00:39 | This is one of those functions that has
parentheses but nothing between them, and
| | 00:42 | when you're typing this you
need only put in left parenthesis.
| | 00:45 | This will generate a
random number between 0 and 1.
| | 00:47 | Now, mathematicians have
all kinds of usage for this.
| | 00:51 | It doesn't make any difference how it's displayed.
You can use the Comma button if you really care.
| | 00:55 | That's not really important,
but you could do that.
| | 00:58 | As we copy this down the column, we
are putting a different random number
| | 01:02 | in each one of these.
| | 01:03 | Now, we might sort this list based on
what's in column I. We do want to give it
| | 01:08 | a temporary heading here, but just
put in rand or rr or anything, just to make it
| | 01:12 | match up with the others.
| | 01:13 | By clicking here and sorting this list--
and we can do it really fast off of the
| | 01:17 | data tab by choosing AZ or ZA--
| | 01:20 | we are going to rearrange the order of the
list based on those entries that are in column I.
| | 01:23 | And as you look at the list now, it
appears to be in no apparent order.
| | 01:28 | It's certainly not in order by Social
Security number, nor department, and so on
| | 01:32 | as we move across here.
| | 01:34 | We want to sort it again?
| | 01:35 | We can just click this A all over again.
| | 01:38 | Every time we do this, the
numbers get regenerated.
| | 01:40 | So ultimately, we don't leave
them here; we get rid of it.
| | 01:43 | So I am going to just click here and
press delete. And again, it's the function called RAND.
| | 01:47 | Now there is another situation. I perhaps
am more likely to use this than some of you,
| | 01:51 | but I'm setting up a situation here.
| | 01:53 | I need some sample data.
| | 01:54 | I need it kind of quickly.
| | 01:55 | And the data I'm working with here
perhaps has to do with sales or profit.
| | 01:59 | It's for group here.
| | 02:00 | We might be talking about items or dollars.
| | 02:03 | I just want some random numbers here,
| | 02:05 | so I can work with the data a
bit, maybe turn it into a chart.
| | 02:08 | I want a bunch of numbers between say
100 and 900. =RANDBETWEEN, a lower number--
| | 02:15 | let's say its 100--comma, a higher number, 900.
| | 02:19 | Now since I highlighted all these data
at once, a nice little shortcut here is I
| | 02:23 | am going to press Ctrl+Enter, and we
have got a bunch of random numbers.
| | 02:27 | Now previously, this was formatted in a
strange way. I forgot about that cell? Just
| | 02:32 | on the Home tab here, click.
Probably don't need the decimals.
| | 02:36 | There we go, looking like that:
| | 02:38 | a bunch of random numbers.
| | 02:40 | Now here, too, as with RAND, these are
dynamic. If I click down here or anywhere and
| | 02:45 | do something else or use another
| | 02:47 | command--I am just going to press a number
and press enter here--and watch: all
| | 02:50 | those numbers changed.
| | 02:51 | So if you want to essentially freeze
these--because they're still functions and
| | 02:55 | every time you make a
worksheet change they change,
| | 02:57 | if you are going to be using these
for a sample or something--simply turn
| | 03:01 | them into pure values by using the right
mouse button after you've selected this range.
| | 03:06 | Drag this elsewhere, and then right
back on top of itself with the right mouse
| | 03:09 | button, Copy Here as Values Only.
| | 03:12 | So I've simply turned them into their pure results.
| | 03:14 | So anytime you need sample data,
data within a certain range, use the
| | 03:18 | RANDBETWEEN function.
| | 03:20 | And here's another way to use it as well.
| | 03:22 | You can use us for dates.
| | 03:24 | I need some sample dates
here between these two dates.
| | 03:27 | Maybe it's just for these cells =RANDBETWEEN.
| | 03:33 | Now in this case here, what I really need to do is
make this column wider so we can see it better.
| | 03:37 | There we go. =RANDBETWEEN. Here's our starting date.
| | 03:43 | Now since I am going to
copying this down a column,
| | 03:45 | I am going to press F4 here because I
want that date to stay there. Comma. Here's the
| | 03:50 | ending date. Also press F4 to make that an
absolute address. Enter. Maybe copy it down here.
| | 03:56 | A random date between the two.
| | 03:58 | We can change the format to be anything we want.
| | 04:00 | So all these dates are going to be
in the year 2010 or the year 2011,
| | 04:05 | and possibly even day one of 2012,
because that's in the list as well. And for the
| | 04:10 | moment, again, this is live.
| | 04:13 | It's active, you could say. Its dynamic.
If we make other changes anywhere in the
| | 04:17 | worksheet, all these will change.
| | 04:19 | So possibly you want to leave it
that way, but if you want change them,
| | 04:22 | just like we did before, highlight
these with the right mouse button, drag them
| | 04:26 | into another column or row, right
back on top of themselves, let go, Copy
| | 04:31 | Here as Values Only.
| | 04:32 | So using RANDBETWEEN and RAND, two
mathematical functions, give us some tools for
| | 04:38 | not only creating data, but also
adjusting and sorting data as well.
| | Collapse this transcript |
| Converting a value between measurement systems with CONVERT| 00:00 | If you work with certain kinds of
engineering or math worksheets, you will need
| | 00:05 | to use--and frequently use,
perhaps--the CONVERT function.
| | 00:09 | On the screen here are some of its
capabilities in columns G and H, and it's
| | 00:14 | the ideal function for making conversions
across different kinds of measuring systems.
| | 00:19 | Certainly a common one for those who live
in the United States particular near
| | 00:22 | Mexico or Canada is this
conversion from kilometers to miles.
| | 00:27 | In cell B2, for example, we might want to see
what 180 km is equal to in miles. =CONVERT.
| | 00:36 | Now there is an improvement in
this function, too, in Excel 2010.
| | 00:38 | For example, after selecting the item
that we are trying to convert, comma, then we see
| | 00:45 | a rather substantial list of items to pick from.
| | 00:49 | Now strangely enough, on this first
example, we're not seeing the one we want;
| | 00:53 | it's for kilometers.
| | 00:55 | However, there's one for meters and all
we can do here to make this slightly
| | 00:59 | faster--although you certainly could
have typed it by now--is to click Meter,
| | 01:03 | tab this into place, put a K in front of it.
| | 01:06 | In another words, we are taking
the 180 and by indicating here, that's
| | 01:10 | the kilometer measure. Comma.
| | 01:12 | We want to convert this to miles.
| | 01:14 | There's miles right there. Click there. Tab.
| | 01:17 | So 180 km is 111.8 miles.
| | 01:21 | This would be the reverse over here.
| | 01:22 | We have got 89 miles.
What is that in kilometers?
| | 01:26 | Of course, the same general idea. =CONVERT.
| | 01:28 | There is the item in question now. Comma.
| | 01:31 | Now we are going from
miles, and that's right here.
| | 01:35 | We could tab that into place. Comma.
And now we want to go to kilometers.
| | 01:39 | Again, we are not seeing it,
but we are seeing meter.
| | 01:42 | Same idea, in reverse of course, with the K.
| | 01:45 | Certainly another comma, and the
same general idea. Of course, Celsius to
| | 01:48 | Fahrenheit, that sort of
thing. =CONVERT again.
| | 01:52 | Here is the number we are trying to convert.
| | 01:55 | In this case, that's the Celsius value--
we will see that in here--and Fahrenheit.
| | 02:04 | Now many of you, of course
myself included, probably typed "F".
| | 02:06 | That's going to work just as well.
| | 02:09 | This must be capitalized.
| | 02:11 | So there we go.
37 degrees Celsius is 98.6 Fahrenheit.
| | 02:16 | Again, off to the side, we will see this list.
| | 02:19 | Now if you want the full list, I would
recommend that at least once maybe click on
| | 02:23 | an empty cell, click the Fx button, or
perhaps better yet, on the Formulas tab,
| | 02:29 | pick More Functions, and
it's found under Engineering.
| | 02:32 | It's a math-like function, but it's
found in the Engineering group, right there.
| | 02:38 | If you click Help on this function, and
particularly if you are online, you will
| | 02:41 | see a huge list, eventually, of all the
various measuring systems related to
| | 02:46 | weight and mass, distance, time,
pressure, force, energy, power, magnetism.
| | 02:53 | You see all these here, Temperature,
Liquid Measure, and the various prefixes
| | 02:57 | that you can use as well.
| | 02:59 | So it's quite extensive and ideal
for those using mathematical and/or
| | 03:03 | engineering applications. The CONVERT function.
| | Collapse this transcript |
| Using the powerful new AGGREGATE function to bypass errors and hidden data| 00:00 | In Excel 2010, there is a
new function called AGGREGATE.
| | 00:03 | That's the name of this worksheet here.
| | 00:05 | Nothing is quite so annoying in
tabulating data to get an error as an answer.
| | 00:10 | Suppose, for example, in this worksheet we
want to track the total salary right here.
| | 00:15 | So an easy way to do this of course
would be to use the AutoSum button and then
| | 00:19 | simply click column C,
and we have got an answer.
| | 00:23 | Except we don't have an answer here.
| | 00:24 | Unbeknownst to us at first is farther
down the list we've got a problem here.
| | 00:29 | There's a problem there.
| | 00:30 | It looks like there's an error.
And you can see the same sort of thing about
| | 00:33 | to happen in column D.
| | 00:35 | Maybe we would like to average those percents.
| | 00:37 | Now that's potentially a risky thing to do
anyway, but if we want to do an average here,
| | 00:41 | we could certainly do this any number
of ways, but the average for column D is
| | 00:45 | going to produce a similar result.
| | 00:46 | The AGGREGATE function, a new function
in Excel 2010, allows us to ignore cells
| | 00:54 | that have errors in them. Or it
also allows us to ignore hidden rows.
| | 00:59 | We'll deal with the issue of errors first of all.
| | 01:01 | The function is called AGGREGATE. A-G--
| | 01:04 | you will see it right away
right here, of course, AGGREGATE.
| | 01:08 | What's the description?
| | 01:09 | Not very persuasive, is it?
| | 01:11 | Returns an aggregate in a list or database.
| | 01:14 | Well, it does do that.
| | 01:15 | Let's tab this into place here.
| | 01:17 | Now, the first item that we put in
there--and you can certainly type this if
| | 01:20 | you use it frequently.
| | 01:21 | For example, you probably going to
type in a 9 or a 1 most often, but we see
| | 01:25 | some other choices here.
| | 01:26 | These are the kind of things that we
can tabulate, the kind of statistical
| | 01:30 | measures we are likely to want to use here.
| | 01:32 | So in this example here, I want to use a sum.
| | 01:35 | I will just click up there and put it
9, or I could have tabbed it in as well.
| | 01:38 | We want to do a total, comma,
and we want to what? Ignore various
| | 01:44 | possibilities here that might occur in
column C. You saw the example earlier
| | 01:49 | where a typical sum didn't work.
| | 01:51 | We want to ignore the error values. That's a 6.
| | 01:54 | Now if there are hidden rows in here as
well, we might want to use option 7 to
| | 01:58 | ignore hidden rows and error values.
| | 02:01 | So in this case 6 is good enough.
| | 02:03 | We will put in the 6 there.
| | 02:04 | Now where are we looking?
| | 02:06 | In this case--and we can certainly
highlights cells--but in this case it's column C.
| | 02:11 | So we do want to add up--
| | 02:13 | that's what the 9 means--
| | 02:14 | we want to sum the numbers, the entries
in columns C, but ignore the errors, and
| | 02:20 | there is our answer.
| | 02:21 | That's the total of the entries in
columns C, ignoring any cells that have errors.
| | 02:26 | Similarly too, if we want to do an
average here, same idea again. Equal. There is
| | 02:30 | AGGREGATE. Tab it into place possibly.
| | 02:32 | This time we want to do an
average. That's a 1, comma, and here 2.
| | 02:36 | We've got error values in there. That's a 6,
| | 02:38 | just like before in the previous example.
And the range we are looking at this
| | 02:42 | time is in column D.
| | 02:44 | So, the average of those percentages
there--this time ignoring the errors--is
| | 02:48 | this and of course you would
probably display that as a percent.
| | 02:51 | Now imagine a list like this--very
similar to what we have already seen--but
| | 02:55 | imagine this is the only data in
worksheet or possibly some other columns are
| | 02:58 | going to be here and maybe
you're about to print this.
| | 03:01 | Now there is a total with the bottom right here.
| | 03:03 | Here's an average right here of those cells.
| | 03:05 | But before printing this--and maybe it's
a list of people who are going to attend
| | 03:09 | particular function or something,
and it has something to do with HR--
| | 03:13 | you don't want to show row 2 or row 4 here.
| | 03:17 | You'd like to hide them.
| | 03:18 | Now I'm ready to hide these, but keep
your eye on those two totals at the bottom:
| | 03:22 | 577,000 and an average of 41,200.
| | 03:26 | Right-click > Hide.
| | 03:28 | What's happened to those averages?
| | 03:29 | They are exactly the same as before,
and that's misleading information.
| | 03:34 | The total of these visible cells here
is not 577,000. And if you look in the
| | 03:39 | status bar right now, you'll see what
the total is. It's 486,950, and the average
| | 03:46 | of them is 40,579, not 41,216.
| | 03:52 | So what do we really want to do here
if we want take into account the idea
| | 03:56 | that from time to time we might
have hidden rows here? We will use the
| | 03:59 | AGGREGATE function.
| | 04:00 | In this case, we want to do a sum
again, that's a 9, comma, and we're
| | 04:06 | ignoring hidden rows.
| | 04:08 | That's a 5. And here's our list. There we go!
| | 04:11 | So there is that total.
| | 04:12 | We saw it previously.
| | 04:14 | It's the sum of these highlighted cells.
| | 04:16 | There are hidden rows in there,
| | 04:18 | if we bring them back, which we will
do in a bit. Let's just do that now.
| | 04:21 | We could adjust them by
bringing back the hidden rows.
| | 04:23 | We will just click. I will double-click
a row boundary and watch that 46 total.
| | 04:28 | 186,950 now becomes 531,870.
| | 04:33 | At different times, depending upon or
needs what else might be in the worksheet,
| | 04:37 | we can ignore the hidden rows.
| | 04:40 | So the AGGREGATE function is long overdue.
| | 04:43 | It's relatively easy to use.
| | 04:44 | It is a little awkward in the sense that
if you don't use it very often when you
| | 04:48 | first look at it, you don't
really have a clue as to what's going.
| | 04:52 | But if you simply remember that it's
a function that allows us to ignore
| | 04:55 | hidden rows and errors,
| | 04:58 | it's the ideal function for tabulating data.
| | Collapse this transcript |
|
|
9. Array Formulas and Functions Extending formula capabilities with arrays| 00:00 | In Excel, certain kinds of formulas
might be referred to as array formulas,
| | 00:06 | and correspondingly there is a series of
functions sometimes referred to as array functions.
| | 00:12 | However, if you happen to click the
Formulas tab in the Ribbon, and try
| | 00:17 | exploring and finding the term "Array,"
you're not likely to find this unless you
| | 00:22 | happen to run across a certain function.
| | 00:24 | So we're going to talk about various
ways to use these functions and give
| | 00:28 | you some rationale.
| | 00:29 | Let me suggest that they
are power functions, generally.
| | 00:33 | They are bit difficult to
describe except by actual example.
| | 00:38 | The term Array typically refers to a
series of data in a column or in a row.
| | 00:44 | And many, many times when we create
formulas called array formulas we're dealing
| | 00:49 | with data in parallel rows or parallel columns.
| | 00:53 | Now that's not exactly a definition,
but I think that will start to make some
| | 00:56 | sense as we look in the example
here of why we would want to use this.
| | 01:01 | In this particular short list of data
here, we're showing total price for some
| | 01:06 | orders here: 72 items ordered 52.99
each. And sure enough, here is the formula.
| | 01:11 | Pretty straightforward.
| | 01:12 | That simply shows the total.
| | 01:13 | And that's what we're doing
throughout the column here, and at the bottom
| | 01:16 | there is the total.
| | 01:18 | And many, many times you would
want to see this information.
| | 01:21 | There certainly could be other
situations, perhaps in a larger list, or maybe
| | 01:25 | rather than viewing the interim totals,
you want a quick method of getting the
| | 01:29 | entire total at once.
| | 01:31 | I'm going to put it right here.
| | 01:33 | I'm going to try something
that looks like it would not work.
| | 01:36 | I want to add up the product of every
one of these cells here--so I'm going to
| | 01:42 | put in the asterisk--times every one
of these, and I'm going to press Enter
| | 01:47 | and be disappointed.
| | 01:49 | That does not work.
| | 01:51 | And you wouldn't expect it to work, really,
if you're familiar with Excel functions.
| | 01:54 | However, I'm about to do something that
will make this work, and what I am about
| | 01:59 | to do is sounds like it's out of nowhere.
| | 02:01 | I'm going to press Ctrl+Shift+Enter, and
we are going to see the correct result here.
| | 02:08 | In fact, it's exactly the same
result we're seeing right here. It's just
| | 02:11 | formatted differently.
| | 02:13 | Now as I click back on this cell, look in the
formula bar: there are braces on either end.
| | 02:19 | I didn't type those braces.
| | 02:21 | If you click, as I'm doing here in
the formula bar or pressing Escape, I
| | 02:26 | double-click within the
cell, we don't see these.
| | 02:29 | Now it almost sounds like
I'm making this up as I go.
| | 02:32 | But I'll save it again and few
more times: array formulas give us the
| | 02:36 | capability of handling calculations
across multiple rows or columns, in kind
| | 02:42 | of a parallel technique,
| | 02:44 | but they're triggered by the fact that
we press Ctrl+Shift+Enter, not Enter.
| | 02:48 | Let's look at a few more examples. And
again, the more examples you see of this,
| | 02:52 | the more likely you are to want to use them.
| | 02:54 | In columns H and I are order
dates and shipping dates.
| | 02:58 | There are some formulas in column J
that simply subtract the two to show us
| | 03:03 | the difference there.
| | 03:04 | We might want to know the average number of
days elapsed between ordering and shipping.
| | 03:09 | And we could certainly put in an average here--
| | 03:12 | I'll do real fast--from the AutoSum
button, click Average, Enter, 17.17 days.
| | 03:19 | But there will be times when
we don't need these totals;
| | 03:21 | we just want to know the average ahead of time.
| | 03:24 | So how about the equal average this way?
And similar to our previous example,
| | 03:29 | but different this time
because we're subtracting,
| | 03:31 | we want the difference between all of
these dates, so those cells minus these cells.
| | 03:39 | Pressing Enter gets us nowhere;
pressing Ctrl+Shift+Enter does.
| | 03:45 | There is that average, and it's
exactly the average that we got before,
| | 03:48 | but the previous average required
those interim subtractions and then the
| | 03:52 | AVERAGE function here.
| | 03:53 | This works all in one step.
| | 03:55 | And once again, look in the formula bar.
| | 03:57 | You'll see those braces.
| | 03:59 | You don't see them in the cell here if
you edit it, and you don't see them in
| | 04:02 | the formula bar when you click up there either.
| | 04:05 | Now another way to use these is
based on the situation we were seeing in
| | 04:11 | columns M, N, O, P. Now this list
might be huge and might extend downward
| | 04:15 | across 10,000 rows.
| | 04:17 | If you look at this for a little bit,
one thing that's going to jump out at you
| | 04:20 | is the fact that we see some duplicates
here. Here is Brian Lyons. Now, there could
| | 04:24 | be two people with that name, but what
same building, same department, same
| | 04:29 | Social Security number, same phone number?
| | 04:31 | We see that down here
with Jessica Wilson as well.
| | 04:34 | Now, Excel has a great tool,
introduced in Excel 2007, on the Data tab, that
| | 04:39 | allows us to remove the duplicates, and we
would probably use that. Most people would.
| | 04:44 | But on the other hand, there are times
when you need to locate, or you need to
| | 04:48 | know, which records have been duplicated.
| | 04:51 | And one way to approach this would be
to write a formula--for example, here in
| | 04:55 | column L--that will say in effect, if
this cell is equal to this one, and this
| | 04:59 | equal to that, this equal to that, and
this equal to that, and so on, and we
| | 05:03 | might go all the way across into
the column V here. We could do that.
| | 05:08 | And let's start that formula and show
how there is a better way to do this
| | 05:12 | with an array formula.
| | 05:13 | Equal if, and here's how we might approach it.
| | 05:16 | And we want a whole series
of logical tests to be true.
| | 05:21 | This cell equal to this one. Comma.
| | 05:24 | This one equal to one above it. Comma.
And you're probably getting tired just
| | 05:28 | thinking about this. I know I am.
| | 05:30 | We could go on and on and on,
all the way out into column V here.
| | 05:33 | That's going to take forever.
| | 05:35 | We'll probably make a mistake along
the way anyway. Let's start over.
| | 05:39 | =if. And what if we simply say
M3 through V3? Now, I could drag across it
| | 05:46 | or maybe do this much and
change this to a V, do it that way.
| | 05:50 | If all these cells here in row 3 equal
these cells in row 2--and I'll just do it
| | 05:57 | this way and again
change that to V. There we go.
| | 06:01 | If all those recall to the corresponding
cells above, comma, we've got a duplicate.
| | 06:06 | I'll just put in double quote "Dup,"
short for Duplicate, comma, but if they are
| | 06:10 | not all the same--in other words
there is at least one difference--
| | 06:14 | then we've got a unique record here.
| | 06:16 | That's it. Ctrl+Shift+Enter. That's unique.
| | 06:21 | You can see that.
| | 06:22 | Let's double-click. Copy this down.
What are we seeing here? That's a
| | 06:26 | duplicate, sure enough.
| | 06:27 | And how do we view this? As you look in
the formula bar, again, you see those braces.
| | 06:32 | If we happened to double-click here, we
don't see them, but at least we see what
| | 06:35 | the formula is actually doing.
| | 06:37 | This array formula is comparing M16
to M15 and then N16 to N15 and O16
| | 06:46 | to O15 and so on, all the way out to column V.
There is no question about the power of this.
| | 06:52 | But once again, there is that oddity
of pressing Ctrl+Shift+Enter, which you
| | 06:57 | have to get used to, and every time
you edit these formulas you have to
| | 07:00 | remember, to make them work,
| | 07:02 | you don't press Enter as
you will do from time to time;
| | 07:05 | you press Ctrl+Shift+Enter. Array formulas,
| | 07:09 | power tools to be sure.
| | Collapse this transcript |
| Counting unique entries in a range with an array formula| 00:00 | Here's a worksheet called Unique.
And in this list--it's not sorted,
| | 00:04 | it's about 700 rows--a
thought might occur to you.
| | 00:07 | You need to know how many
different departments there are here.
| | 00:10 | Now eventually, you might want to
create a list of them, but let's just try and
| | 00:13 | answer that simple question, how
many different departments are there?
| | 00:16 | Now we could sort the data, and that
will bring all the ADC people and the
| | 00:20 | manufacturing people, put them
together, but that doesn't really count the
| | 00:23 | number of entries here.
| | 00:25 | There is an array formula
that will let this happen.
| | 00:27 | Now I expect one of these years to see
a function, perhaps called unique, that
| | 00:32 | will give us a count of
unique entries in a range.
| | 00:36 | We're looking for the number of unique
entries in column B, from B2 all the way
| | 00:41 | down to the bottom of the list.
| | 00:43 | I want to show you this formula, and
then with a smaller example, explain how it
| | 00:47 | works, because at first it's going to
strike you as being somewhat strange.
| | 00:52 | =sum(1/(, and I'm going to be
using a function called COUNTIF.
| | 01:00 | If you worked with Excel extensively, you
no doubt are familiar with this function.
| | 01:04 | We want to count all these cells
here, from B2, and I'm going to press
| | 01:09 | Shift+Ctrl+Down Arrow here just to
pick up that data and then scroll back up
| | 01:14 | quickly to the top, comma
and then enter this again.
| | 01:19 | This time maybe we'll just make it a
little bit faster. Highlight this and
| | 01:22 | press Ctrl+C. Click here, press Ctrl+V. I need a
right parenthesis and another right parenthesis.
| | 01:30 | Now because this is an array formula,
Ctrl+Shift+Enter. And one little problem in
| | 01:37 | here: now the reason we see this error
message is that I forgot to put in the
| | 01:41 | final closing parentheses.
| | 01:43 | We need the three closing parentheses.
| | 01:46 | Excel picks up on this and suggests
that as a remedy, and I see it here, and of
| | 01:49 | course I am going to click Yes.
24 unique entries in that range.
| | 01:56 | Now for some people, and perhaps
myself included a few years ago, I would be
| | 02:00 | initially curious, but not being able to
figure that out, I'd tried a few times. It works.
| | 02:05 | We'll try it on different columns.
| | 02:06 | How many unique entries in column C?
Just change the Bs to C and try it over there.
| | 02:11 | We can easily do that quickly.
| | 02:13 | Change these Bs to a C. Now I happened
to know there are four unique entries there,
| | 02:17 | but that's what we're going to
be seeing here. Make these all C.
| | 02:20 | Ctrl+Shift+Enter. Four unique
entries in column C. Press Ctrl+Z to undo.
| | 02:26 | Now if we attempt to count the
number of unique entries in a smaller
| | 02:29 | list, like in column K, the
mechanism for doing this is going to make a
| | 02:33 | little bit more sense.
| | 02:34 | At the core of this is this idea =countif.
| | 02:39 | How many times does Colorado appear
in this list, and how do we do this?
| | 02:43 | We look at the entire list
right here, comma, this cell.
| | 02:50 | How often does Colorado occur here?
| | 02:52 | Now if I want to copy this down the
column, we'll make this an absolute
| | 02:55 | reference, unless we were referring to
an entire column reference. Press F4.
| | 03:00 | So Colorado appears four
times. Double-click here.
| | 03:04 | Kentucky appears four times, California
appears five times, and so on, and so on--
| | 03:08 | a lot of repetitious information there.
| | 03:10 | Now on any one of these, suppose we--
and you saw on that on other formula,
| | 03:14 | how we divided by one.
| | 03:16 | It's the reciprocal of it.
| | 03:17 | What concept does this introduce?
| | 03:20 | What we're looking at is
1/4th of the Colorado entries.
| | 03:25 | This is 1/4th of the Kentucky entries.
| | 03:27 | This is 1/5th of the California
entries, 1/3 of the Ohio entries.
| | 03:32 | As I highlight all of these and look
at the bottom of the screen, what do we
| | 03:35 | see in this status bar?
| | 03:37 | These numbers add up to four.
| | 03:39 | So how many unique entries do we have here?
| | 03:41 | We've got four of them.
| | 03:43 | Now zipping back into cell I2 for the
moment, I'll go over here and actually
| | 03:48 | put a space in front of this for the
moment and press Enter so we can see it.
| | 03:52 | Make this column wider.
| | 03:55 | What if we now take, with
this in mind, expand this?
| | 03:59 | So what are we about to do here?
| | 04:00 | We're going to put in the word "sum," just
like we see it over there in the column
| | 04:04 | I. And the only difference we make here
is instead of simply comparing K2 to all
| | 04:09 | of these, we use K2:K17.
| | 04:14 | In other words we want to handle all
of them by way of those array techniques
| | 04:18 | that we've seen here, and now
Ctrl+Shift+Enter gives us our answer.
| | 04:22 | So it takes a little while to get there,
but I would suggest for many people
| | 04:26 | they don't really need to know the details
exactly as to how this works, but you saw it here.
| | 04:30 | The main point is this does work, and I've
used it many, many times over the years.
| | 04:35 | And I too, like a lot of people didn't
understand it at first, and still from
| | 04:38 | time to time we have problems
explaining it, but there is no question it's a
| | 04:41 | great tool for tabulating the
number of unique entries in a range.
| | Collapse this transcript |
| Determining frequency distributions with FREQUENCY| 00:00 | A commonly used statistical
measure is what we call a frequency or
| | 00:04 | frequency distribution.
| | 00:06 | In this list of salaries--we've got
hundreds of them--we might want to see a
| | 00:10 | breakout based on an arbitrary list, for
example, as we see in column D every 10,000.
| | 00:16 | In column E, what we would like to get
is a count of how many of these salaries
| | 00:20 | are below 10,000, up to and including
10,000 in this cell; and in this cell, those
| | 00:27 | salaries above 10,000 up to
and including 20,000; and so on.
| | 00:31 | I'd emphasize again the fact
that this list here is arbitrary;
| | 00:35 | they don't have to be equally spaced.
| | 00:37 | They could be every 5,000, or
they could be an unusual interval.
| | 00:41 | But we want our results to go into
all of these cells, and we've scoped out the
| | 00:46 | range of salaries here that
indicates the complete entries. =FREQUENCY;
| | 00:51 | there it is.
| | 00:52 | Tab it into place. And the first entry here
is all of these salaries. To make this faster,
| | 00:58 | I'm going to click in cell B2, hold down
the Shift key, and press Ctrl+Down Arrow.
| | 01:03 | It goes because all the way down to
row 621. Comma. The cells that we are looking at
| | 01:10 | that define the intervals are
referred to as a bins array.
| | 01:14 | I'm going to highlight these cells right here.
| | 01:17 | Since this is an array function, I'm
going to press Ctrl+Shift+Enter, and
| | 01:23 | we're going to get answers in every
one of those highlighted cells.
| | 01:26 | And there's our count.
| | 01:27 | Four of these salaries are
up to and including 10,000.
| | 01:30 | Now, just to emphasize how that break
occurs, I want to take this salary here
| | 01:36 | and make it to be 10,000 exactly.
| | 01:38 | Currently, it's in the list below;
| | 01:40 | it's counted in those 32, but as I
make this 10,000 and press Enter, watch the
| | 01:45 | two numbers change into 5 and 31.
| | 01:48 | See what's happening here.
| | 01:50 | Now, this could be the start of other
kinds of analyses. If we simply were to
| | 01:54 | highlight this and press Alt+F1,
we're going to get a chart here and
| | 01:59 | potentially this is a histogram.
| | 02:01 | We can alter this, make the columns
wider, and label it properly, and so on.
| | 02:05 | But what's happening here is that the
cells in column E all have the same entry.
| | 02:11 | If you start clicking on separate
cells here, notice how--and you can see it
| | 02:14 | in the Formula bar--they are identical.
| | 02:17 | So that looks a little strange at first.
| | 02:18 | If you've never seen these,
that would throw you a little bit.
| | 02:20 | But you saw how easy it was to create the list.
| | 02:24 | Now, I wouldn't suggest that you'd be
constantly manipulating this, but if, for
| | 02:27 | example here, if you jump in and
start changing the intervals, you will get
| | 02:31 | different answers. But what if you say,
well, I want to do this every 15,000,
| | 02:36 | something like that?
| | 02:37 | So this is going to be maybe 15, 30, 45,
60, 75, 90, 120. Maybe we don't need
| | 02:45 | these. Could we just get rid of those?
| | 02:46 | You'll get a message like this:
| | 02:48 | "You cannot change part of an array."
| | 02:51 | So if you want to restructure this and
have more or fewer entries here, you'll just
| | 02:55 | you have to delete all of this at once
and then redesign it. You saw how quickly
| | 03:00 | we were able to create this list.
| | 03:02 | It's using an array function called FREQUENCY.
| | Collapse this transcript |
| Flipping row/column orientation with TRANSPOSE| 00:00 | We're looking at a worksheet called
Transpose, and it's a reminder that there
| | 00:05 | are two features in Excel that go by that name.
| | 00:08 | One is the ability to actually
transpose a list of data, changing its
| | 00:13 | row-column orientation into
column-row, or vice versa. There's also a
| | 00:17 | function called TRANSPOSE.
| | 00:19 | Let's look at both of them.
| | 00:21 | Here is a list. Perfectly reasonable.
| | 00:24 | We might want to continue and alter
this a bit by including the remaining six
| | 00:29 | months of the year, and that means it's
going to be quite wide. And the thought
| | 00:32 | occurs, from time to time: would this
have been better had we put the months down
| | 00:37 | in column A perhaps.
| | 00:39 | Well, first of all, without in any
way destroying this, let's consider and
| | 00:43 | show how we can transpose this data in
such a way that we will see it in these
| | 00:50 | three columns down here.
| | 00:52 | Now, is this going to be a better layout?
| | 00:54 | Maybe, maybe not. But it's easy to
explore, and I found myself using this over
| | 00:59 | the years in a variety of situations,
and not necessarily always accepting the
| | 01:04 | newer view or the transposed
view, but it's easy to get to.
| | 01:07 | Let's highlight this data, right-click, and copy.
| | 01:11 | We never want to paste this on top of it.
| | 01:14 | Say, right here, we'll just right-
click and Paste Special. And in 2010,
| | 01:20 | we've got these Preview buttons that
are going to be helpful, and there's a
| | 01:23 | Transpose button right there.
| | 01:25 | You see what's happening down below.
| | 01:26 | That's exactly the same data we have from above.
| | 01:29 | So I want to click this. And not only
has the data been transposed, but the
| | 01:34 | formula up here in H4, which tabulates
or as the data from the left has been
| | 01:40 | transposed into the formula here in
B15, that takes those same numbers and
| | 01:46 | adds them from above.
| | 01:47 | Now, you are not going to keep both
of these around probably, although you
| | 01:50 | could. But they are not linked together
in any way. But it does suggest, and I
| | 01:56 | think sometimes you want to experiment
with this, sometimes the way you lay out
| | 01:59 | data, particularly if you done it in a
hurry, might not be the best way, consider
| | 02:03 | transposing it and then decide which
one is better and go with that one.
| | 02:08 | I sometimes try this feature on large
lists as well, just to get a different
| | 02:12 | perspective on things. And you can
certainly transpose the data onto a
| | 02:16 | different worksheet.
| | 02:17 | So that certainly worth exploring.
But I am going to press Ctrl+Z here to undo
| | 02:21 | this and talk about a function called TRANSPOSE.
| | 02:24 | It could be that you would like to
have a transposed version of this that is
| | 02:30 | linked to this original data.
| | 02:32 | It might be on a different worksheet.
| | 02:34 | As we set up, maybe we'll just put it down here.
| | 02:36 | Now the first thing we do here is to
highlight this range, and as we do, if you
| | 02:41 | look to the left of the formula bar in
the Name box, you will see that it says
| | 02:45 | 4Rx9C, meaning four rows by nine columns.
| | 02:51 | Once we've seen that, we want to
highlight the reverse range. Not four rows by
| | 02:57 | four columns, what do we want?
| | 02:59 | We want nine rows by four columns.
| | 03:03 | Now, we're going to type
=transpose( and refer to the original range.
| | 03:09 | Now this is an array function, meaning
we press Ctrl+Shift+Enter, and there we
| | 03:17 | have the information.
| | 03:18 | Now, it needs to be formatted, but
this cell here is not really 1570;
| | 03:24 | it's--what is it?
| | 03:25 | It's a reference to these cells up here.
| | 03:28 | As we look at this though, it
doesn't refer to the specific cell.
| | 03:31 | It refers to, as I double-
click, all of those cells.
| | 03:34 | So it looks a little bit strange.
| | 03:36 | Now, I have to admit, over the years,
I've only used this once or twice, but
| | 03:40 | it's the stuff of some creativity,
and perhaps this would make sense on a
| | 03:44 | different worksheet.
| | 03:45 | This date will continue to
remain in sync with the data here.
| | 03:49 | What I'd probably do if I'm going to be
using this is add Dollar signs here.
| | 03:54 | Take these and use Comma format.
| | 03:56 | That cleans up substantially. And just to
show what does happen, if I change this
| | 04:02 | 150 here, of course, it's going to change here.
| | 04:04 | Maybe this was a mistake. I'll make it
be 155, and as soon as I press Enter,
| | 04:09 | it's going to have impact below her.
And it changes the totals here because
| | 04:13 | that's dependent upon the cell up in
the upper-right in column H, and so on.
| | 04:18 | So, this is a reflection of the data
here, but it's a transposed version of it.
| | 04:22 | So I think you can see the value of that.
But equally valuable is what we saw prior to this;
| | 04:27 | that's just the ability to transpose data.
| | 04:30 | This function that we just saw here
is an array function, so you must press
| | 04:35 | Ctrl+Shift+Enter to make it work.
| | Collapse this transcript |
| Building analysis via regression techniques with TREND and GROWTH| 00:00 | In this worksheet called TREND,
we see a chart off to the right.
| | 00:04 | There are two array functions that
are going to be valuable if you know
| | 00:09 | something about regression analysis.
| | 00:11 | Now you don't have to be a statistical
genius here, but just have a rough or
| | 00:15 | vague familiarity with those concepts.
| | 00:18 | Many people who use charting in Excel
are familiar with the idea that you can
| | 00:21 | easily add a trend line to a chart
like this for some analytical reasons,
| | 00:27 | right-click on the actual line
here, and choose Add Trendline.
| | 00:32 | Now it automatically will
show you a linear trend line.
| | 00:36 | We are seeing this, this
so-called straight line.
| | 00:38 | I am going to click Exponential over
here to show you what that looks like.
| | 00:42 | Now the value of this is it's fast,
and it's easy, but if you actually want
| | 00:46 | to have numbers to go with it, for
example, in columns C and D, this isn't
| | 00:51 | going to help too much.
| | 00:52 | Now you could display R-squared value
here, and you have to know something about
| | 00:56 | regression analysis to make this work.
| | 00:58 | So I am going to take a
little bit of time to get there.
| | 01:00 | So I am going to close this and
undo by pressing Ctrl+Z to go back to
| | 01:05 | the regular display.
| | 01:06 | I'm also going to click on the chart to
emphasize, as you know to the left here,
| | 01:11 | that this chart is designed to show
data from columns B, C and D. Pick up the
| | 01:16 | labels from column A. So columns C
and D, although they are empty for the
| | 01:20 | moment, will be displayed in the chart
as we enter the numbers using an array
| | 01:25 | function called TREND.
| | 01:28 | In other words, we would like to
see numbers that will produce that
| | 01:32 | trendline right here in column C,
numbers that are loosely and closely
| | 01:37 | associated with this list.
| | 01:39 | So we highlight this entire group of
cells here, and we use the array function
| | 01:43 | =TREND, left parenthesis, and we
need to only show these cells right here.
| | 01:50 | And since this is an array function,
I'm going to press Ctrl+Shift+Enter, and
| | 01:56 | there we see that line depicted.
| | 01:58 | Now we see numbers associated with
this trendline. And similarly, if you'd
| | 02:04 | like to have an exponential line as well--
and you certainly could have one or the other--
| | 02:08 | we are going to use the same concept here,
but use the array function called GROWTH.
| | 02:15 | And it, too, will be based upon the
values in column B. =GROWTH, left
| | 02:19 | parenthesis, highlight all these cells here.
| | 02:23 | You could click here, and Shift+Ctrl+
Down Arrow, Ctrl+Shift+Enter to complete
| | 02:29 | the entry, and there is
that exponential growth line.
| | 02:33 | So, valuable tools. You might use them
in combination with a trendline concept,
| | 02:38 | or as we saw here, avoiding that
approach, but simply creating the numbers
| | 02:42 | and having those numbers appear in the chart.
| | 02:45 | So in either case here, we have got the
situation where every one of these cells,
| | 02:49 | as we look at it, looks exactly like
the one above it in column C; same thing
| | 02:53 | true in column D. And just as we saw
with the FREQUENCY function, you can't come
| | 02:58 | along and delete just one of these.
| | 03:00 | So this is an array function
throughout the entire set of cells right here
| | 03:05 | in this range.
| | Collapse this transcript |
| Combining multiple functions in arrays| 00:00 | If you are trying to use Excel's Lookup
capabilities, you're probably going to
| | 00:03 | be using the VLOOKUP or HLOOKUP
functions, and yet there will be times when these
| | 00:08 | functions don't give you everything you
need, and you might have to turn to some
| | 00:12 | variation using array formulas and functions.
| | 00:16 | In column D is a relatively
straightforward use of the VLOOKUP Function, but
| | 00:21 | doing something maybe you haven't seen.
What we are trying to do is to take
| | 00:24 | those names in columns A and B and match them
up with the entries as we see them in column G.
| | 00:30 | Now this might have more importance if--
you can imagine--both of these lists or
| | 00:35 | thousands of entries long, and they
might have been in separate worksheets
| | 00:38 | and workbooks. So all we are doing
in this function--and we did this in
| | 00:42 | previous movie on VLOOKUP--
| | 00:44 | we are simply concatenating.
| | 00:46 | For example, on that first
situation there Randall, space Yvonne.
| | 00:50 | We are trying to find that in column G
and when we do, we go into the second
| | 00:54 | column and pick up the answer. And sure
enough, we get a correct answer there.
| | 00:58 | It's the ID number 891.
| | 00:59 | There it is right down there.
| | 01:01 | Now the reverse of this is much more difficult,
and it will require the use of an array formula.
| | 01:08 | And the starting point here is a little tricky.
| | 01:10 | We are trying to find Margarita Roy,
and you see how the name is entered here.
| | 01:14 | But over in columns A and B, it
split into last name and first name.
| | 01:19 | So let's start with the idea that the
MATCH function will allow us to pull
| | 01:24 | together information, but you probably
have not used it as an array formula.
| | 01:29 | We are trying to take the entry right
here, Roy, Margarita, and match it up with
| | 01:35 | data that we're seeing in columns A and B.
And we will look throughout column A,
| | 01:40 | and we want to put that together with--
and we have to do this within double
| | 01:44 | quotes--a comma and a space
and the entry in column B.
| | 01:51 | So what we are building
here is all the As and Bs.
| | 01:54 | We are putting them together
separated by a comma and a space.
| | 01:57 | We are trying to match Roy,
Margarita with that new construction.
| | 02:02 | And we got to make sure this is an exact
match, so ,0. And if we press Enter here,
| | 02:08 | we are not going to find what we want.
| | 02:10 | But we are talking about
array formulas, array functions.
| | 02:14 | We press Ctrl+Shift+Enter, and it's found in
the third row, based on our column A and B entries.
| | 02:21 | So now that's part of the issue here.
| | 02:24 | We have found this.
| | 02:26 | But we actually want to get the sales amount.
| | 02:29 | So we need to put this together along
with the INDEX function, which allows us to
| | 02:35 | pull information out of a table.
| | 02:37 | The INDEX function begins with the
argument that says here is the array that we
| | 02:42 | are trying to extract data from.
| | 02:45 | We are looking in column C. Comma.
We now need to put in the row number that we
| | 02:51 | need from column C. Well, we just figured
that out with this Match function here,
| | 02:56 | and that's going to be the third row.
| | 02:58 | Since we're only choosing one column
here, we don't need to put in comma one or
| | 03:04 | two or anything like that.
| | 03:05 | There is only one column here.
| | 03:07 | It would not be wrong to put in
comma one, but we don't need that, just
| | 03:11 | simply right parenthesis.
| | 03:13 | But even though the use of the INDEX
function here is not an array function, the
| | 03:18 | use of MATCH is, so we need to press
Ctrl+Shift+Enter to get that sales figure
| | 03:23 | for Margarita Roy, and there it is, 77945.
| | 03:28 | You will also see it over here.
| | 03:29 | And we are pulling together a number
of different features of Excel here.
| | 03:32 | A lot of you don't necessarily
use entire column references.
| | 03:36 | I use those wherever possible.
| | 03:38 | It simplifies the look of
formulas to give you greater flexibility.
| | 03:42 | We don't have to constantly adjust
this as we add and take out records.
| | 03:46 | But the key idea here is that by
using an array formula, by pressing
| | 03:49 | Ctrl+Shift+Enter, we are allowing
ourselves to pull together the data from all
| | 03:55 | those column A entries and
all the column B entries.
| | 03:58 | So once again, Ctrl+Shift+Enter.
| | 04:00 | We will double-click here to copy this
down the column. And although they look
| | 04:04 | the same for a moment, in a
second or two they will change.
| | 04:08 | Here they are, and we see the others.
| | 04:11 | So every one of these entries here doing
the same kind of thing, each of these--
| | 04:15 | and you can see it in the formula bar--
embedded in those curly braces that we
| | 04:19 | never type. These are array formulas
using concatenation techniques. The MATCH
| | 04:25 | function and the INDEX function.
| | Collapse this transcript |
|
|
10. Text Functions Locating and extracting data with FIND and MID| 00:00 | Excel has about 25 functions that
fall into the heading of text functions.
| | 00:04 | Here is a quick look at them
| | 00:06 | on the Formulas tab of the Ribbon. And of
course, the words done exactly mean much
| | 00:11 | until we see them in context. But two
of the building blocks text functions
| | 00:15 | we're going to use in this
current worksheet called FindMid:
| | 00:19 | one is called FIND and another one is
called MID. And there is any number of
| | 00:23 | situations in Excel where you
need to extract data from a cell.
| | 00:28 | Now maybe the part numbers that we see
in column A here represent, in sequence,
| | 00:34 | where the product was made, the size of
it, the age of it, the color of it, that
| | 00:38 | sort of thing. And maybe we need to
find out if the letter G is in this.
| | 00:44 | Maybe that has a particular meaning.
| | 00:46 | You will notice by the way here is a
lowercase and uppercase here.
| | 00:48 | But we are looking for letter G
=FIND. And the first argument in this
| | 00:55 | particular function is within double
quotes, the item that we are looking for.
| | 00:59 | I am putting in a capital G.
Now where are we looking?
| | 01:03 | We are looking in cell A2.
| | 01:07 | If we want to begin looking somewhere
after the first character, we'll put in a
| | 01:12 | third argument. But many, many times,
and I would suspect for most people about
| | 01:16 | 95% of the time at least, when you're
using the find function, you want to start
| | 01:21 | from the left-hand edge.
| | 01:22 | That's character number 1.
| | 01:24 | We don't have to put that
in at all, so we are done.
| | 01:27 | And so the answer that we are going to
get here is either a position within that
| | 01:32 | cell or the character is not
found, as is the case here.
| | 01:36 | As we copy this down the column by
double-clicking, we see that here was found,
| | 01:41 | and you can see it clearly.
| | 01:43 | In column A as in the second position here
was found, and of course, here it is too.
| | 01:47 | And you'll notice that in this
particular cell A6 there is a G, but the FIND
| | 01:53 | function is case-sensitive.
| | 01:56 | Now if you somehow had the need to say,
well, I will need to find G, whether
| | 01:59 | it's upper or lower case,
| | 02:02 | then you'd use a
companion function called Search.
| | 02:07 | And it doesn't make any difference now
whether we put it in a capital G or a
| | 02:10 | lowercase g. As I recopy this, you
will see the Search function, as it is used
| | 02:16 | here, finds capital G or lowercase g.
Now even if change this to a lowercase g
| | 02:22 | it's going to find the uppercase Gs.
| | 02:25 | Now some of you might be wondering,
"Well, who cares where it was found, the
| | 02:29 | character position. Sometimes all we
want to know is whether it was found or
| | 02:33 | not," but this does lead
us into other capabilities.
| | 02:37 | The function called MID, M-I-D--think of the
word middle, but don't necessarily take
| | 02:43 | that literally--allows us to extract
information from a cell, starting in a
| | 02:48 | certain position, and so many characters.
| | 02:51 | Let's look at the data in column C.
Although Excel does have a rather good way of
| | 02:56 | splitting this data into columns, there
can be other situations, and certainly
| | 03:01 | with other kinds of data, where you
need to extract, or pull out, a copy of data
| | 03:05 | found within the cells.
| | 03:07 | Maybe all we want to pull out here is
the actual state, the two-letter code.
| | 03:12 | And of course, what we recognize is is that the
state appears two characters after a comma.
| | 03:17 | So let's use the FIND function first
of all, as we did a few minutes ago, to
| | 03:22 | find where the comma is. Within double
quotes, double quote, comma, double quote--
| | 03:27 | that's what we're looking for--comma.
Where are we looking? In C2 here.
| | 03:33 | So we simply want to know where that's found,
and you're probably quickly counting already.
| | 03:37 | It's in the 8th position. There it is.
| | 03:40 | Now once we know that--and we can do
this in a separate cell and then put it
| | 03:45 | back together, or if you work with
these a lot, you can do it all at ones, but
| | 03:48 | lets say we've got this here.
| | 03:50 | I'll double-click to copy this down the
column, and you can see in the various
| | 03:54 | other locations there what's happening,
as to who had finds the comma, which
| | 03:58 | will make perfect sense in
all those examples there.
| | 04:01 | Once we know the comma, we could, from
that position, move two characters to the
| | 04:06 | right and pick up two more.
| | 04:08 | So let's take a look to the
function called MID. =MID.
| | 04:13 | This begins with where we're
looking. Where are we looking here?
| | 04:17 | We are looking in C2. Comma. The starting number.
| | 04:21 | Well, we know that the comma is found in
the 8th position, so we want to move two
| | 04:27 | characters to the right of it.
| | 04:28 | There is a space after it and
then two characters after it.
| | 04:31 | So we want to put in +2. Comma.
| | 04:34 | How many characters we want to
extract starting at that position?
| | 04:38 | That's what Num Char S means.
| | 04:41 | We want to pick up two characters, the two
character state abbreviation. That's it.
| | 04:46 | We are done. And there you'll see it.
| | 04:48 | I'll double-click to do the rest.
| | 04:50 | You see what's happening.
| | 04:51 | And you could imagine a similar
technique to perhaps pick up the ZIP code.
| | 04:55 | So, many times the MID function and
the FIND function or the SEARCH function,
| | 05:01 | can be used in combination.
| | 05:03 | There is surely nothing wrong
with doing what we have done here.
| | 05:05 | We've got our answers. Maybe that's all
we need, but conceivably you could have
| | 05:09 | done this all together. And I'll show
you just quickly how possibly we'll just
| | 05:12 | take this code here.
| | 05:14 | I'm editing it right now with double-click.
| | 05:17 | I'll use controls C to copy this
information, Escape, double-click to edit this,
| | 05:23 | and instead of referring to cell D2
right now, I'll highlight this portion
| | 05:27 | right here, press Ctrl+V to paste
what I had just copied, and there is the
| | 05:32 | function in its entirety.
| | 05:34 | By doing this, we don't need
column D. Get rid of that, and we can do it this way.
| | 05:39 | It is not to say that what we did was
wrong, but this is just a little bit more
| | 05:42 | concise, so there we are, looking like that.
| | 05:45 | So there are many numbers of
different situations where you can use the
| | 05:47 | MID function--sometimes by itself--
the FIND function--sometimes by itself,
| | 05:53 | sometimes in combinations.
| | 05:54 | And if there's an issue of case
sensitivity, you'll be using perhaps the SEARCH
| | 05:59 | or FIND, depending upon your needs.
| | 06:02 | These particular functions, along
with some of the others we are about to
| | 06:05 | see, think of them perhaps
as little building blocks.
| | 06:08 | We use them individually or in
combination, but they are ideal tools for
| | 06:12 | allowing you to get the
information inside of cells.
| | Collapse this transcript |
| Extracting specific data with LEFT and RIGHT| 00:00 | Excel has two companion text
functions called LEFT and RIGHT.
| | 00:05 | They allow us to extract data from the
left-hand side or the right-hand side of a cell.
| | 00:10 | Look at the data in column F. Maybe we
need to pull out or isolate the zip codes.
| | 00:15 | Now when we say extract or isolate,
we don't mean that we are going to be
| | 00:19 | altering column F. What we really want
to do is that in column G, we simply want
| | 00:24 | to show the last 5 characters.
| | 00:27 | In other words, from the right-
hand side of those cells. =RIGHT.
| | 00:32 | So we are looking in cell F2--that's the
first example here--and we need to pull out,
| | 00:36 | or make a copy of, the five
rightmost characters. There they are.
| | 00:41 | I'll double-click to copy down the column.
| | 00:44 | Now there are certainly are other
techniques for doing this on more permanent
| | 00:46 | bases, where we might even
want to isolate the state.
| | 00:49 | That's going to be available off the
data tab, where we can actually split
| | 00:52 | this text into columns.
| | 00:54 | But there certainly will be times when
you need to make a copy of data found in
| | 00:59 | cells, as we did here.
| | 01:01 | Sure enough, sometimes we need to
pull data from the left-hand side.
| | 01:05 | Maybe on these part numbers the two
leftmost characters have something to do
| | 01:09 | with either the location or the size
or the color of the item, and we need to
| | 01:13 | isolate that information maybe
for sorting purposes. =LEFT.
| | 01:18 | We are looking in cell C2 here, comma
2, and we need only the two
| | 01:24 | leftmost characters.
| | 01:25 | Once again, we can double-
click to copy this down the column.
| | 01:29 | Armed with the knowledge of how we use
LEFT and RIGHT, we can then use either
| | 01:34 | one of these in combination with other
text functions that we might be aware of.
| | 01:39 | For example, we might want to pull data
off the left side of the information in
| | 01:44 | column A--and of course that's the last
name--but we also have to find where the
| | 01:48 | comma is, and that's
done with the FIND function.
| | 01:52 | So let's start this particular
function here by actually putting in FIND.
| | 01:56 | We are looking in cell A2, and that by
itself will tell us that this is in position 6.
| | 02:05 | Then once we know that, we can pull
data from the left-hand side of cell A2.
| | 02:11 | So the LEFT function, its first
argument is where we looking? That's A2. Comma.
| | 02:18 | And now since the comma was found in
the 6th position here, we want to make a
| | 02:23 | copy of the five characters to the left,
| | 02:26 | in other words, one less
then where we found the comma.
| | 02:30 | So there we go, -1).
| | 02:33 | Now you certainly can do this in two
separate columns, but the more you work
| | 02:37 | with these, the easier you will figure
out that it's nice to put these together
| | 02:40 | to just save some time and
make it faster. So there we go.
| | 02:43 | There is Baker and by double-clicking
here, we will copy this down the columns.
| | 02:47 | And we see how this has pulled out, in
each case, or isolated, the last names.
| | 02:52 | So using either the LEFT or RIGHT
functions independently or in combination with
| | 02:57 | other functions, we have more
tools to extract data from cells.
| | Collapse this transcript |
| Removing excess spaces with TRIM| 00:00 | In this worksheet called Trim, looking
in column A, we see a common problem:
| | 00:05 | leading spaces--and not only leading
spaces as we see in row two, row three,
| | 00:10 | also in row 11 by the way, but also
multiple inner spaces. Probably never occurred to you
| | 00:16 | that was a problem.
| | 00:17 | It can be a problem.
| | 00:18 | We see it here in cell A4, as well as A5,
possibly some trailing spaces here that
| | 00:24 | we are not picking up on. What's the issue?
| | 00:27 | In the midst of large amounts of data,
sometimes these leading spaces don't even
| | 00:31 | occur to us until one day we sort
the data, perhaps on this column.
| | 00:35 | I am going to do this from the
Data tab. Click the A to Z button.
| | 00:39 | We are sorting column A, and what happens?
| | 00:43 | All those entries with leading
spaces appear first, and those that have
| | 00:47 | multiple spaces occur before those that have
just one space. Nothing much has happened here yet.
| | 00:53 | We need to clean up data like this.
And whether we've sorted that or not, it
| | 00:57 | doesn't make any difference. And nearly
always in situations like this, we need
| | 01:01 | to use a column to the right.
| | 01:03 | Now if we have other data here, of
course, this means inserting a column, and
| | 01:07 | then using a function called TRIM to
trim off leading spaces, trailing spaces,
| | 01:15 | and--this is a mouthful--
| | 01:17 | we want to reduce multiple consecutive
inner spaces to a single space. =trim,
| | 01:24 | left parenthesis. There is the entry.
| | 01:27 | You can see what's happened there.
| | 01:28 | I am going to double-click here, and
you can quickly see the results. Noticing
| | 01:32 | this entry right here, more than one
space between the comma and the E. The
| | 01:37 | result over here has only a
single space. Same situation here.
| | 01:40 | Now in on some of these, there
might have been a trailing space.
| | 01:43 | How do you know if there is a trailing space?
| | 01:46 | If you double-click in a cell that
has spaces or leading spaces, or you
| | 01:51 | think maybe it has got a trailing
space, where does the blinking cursor go
| | 01:56 | when you double-click?
| | 01:57 | It's going to go here.
| | 01:59 | Same thing happens in the formula bar
by the way. Click to the right of the
| | 02:02 | name in the formula bar.
| | 02:04 | If this blinking cursor is removed a
space or two, then you've got a trailing space.
| | 02:10 | Now how tedious is that going
to be to go looking for these?
| | 02:13 | Now here, I'll just pick one
at random, say this one here.
| | 02:16 | I'm going to double-click right here
to edit and put it in a trailing space.
| | 02:21 | Now who can ever see that, or know that?
| | 02:23 | Does it make any difference for sorting?
| | 02:25 | Not at all. But if there is any logic
in a worksheet that tries to match up
| | 02:29 | names, this will not be a match with an Eric
Hendricks that doesn't have trailing spaces.
| | 02:36 | With the TRIM function, what we have
created here is a cleaned-up version of the
| | 02:42 | data in column A, cell-by-cell. And once
we have done this, if we wanted to keep
| | 02:48 | this information the way we see it
here--you may well be familiar with the
| | 02:52 | technique mentioned in the first
chapter of the movies in this course--we need
| | 02:56 | to copy this information back into
column A. And the fastest way to do this is
| | 03:02 | after selecting the data--in other
words these are the results, but they still
| | 03:06 | are formulas--with the right mouse button,
| | 03:09 | we'll drag say the right edge or top edge--
| | 03:11 | it doesn't make any difference--on top of
the old data with the right mouse button.
| | 03:16 | Soon as we let go, there is a
menu: Copy Here as Values Only.
| | 03:21 | That's how it looks.
| | 03:23 | So these are no longer formulas.
It looks like that. So we've cleaned them up.
| | 03:28 | Now I want to undo here and point out
another way to use TRIM. And this, usually
| | 03:35 | but not always, involves
a function called VLOOKUP.
| | 03:38 | Let's imagine for the moment that in
another worksheet, or possibly in another
| | 03:42 | workbook, we've got some names here
and we are trying to find them from this
| | 03:47 | list. Maybe next to this data here, we
have got other things we like to extract.
| | 03:51 | We could even be using a function called MATCH.
| | 03:54 | Let's try that one.
| | 03:55 | Can we match this name with data in column A?
| | 03:58 | Now, what's unusual about this cell?
| | 04:00 | There is a leading space.
| | 04:02 | Over here Jackie Fitzgerald,
there is no leading space.
| | 04:04 | There is no trailing space.
| | 04:06 | So we should be able to find this.
But what about the leading space here?
| | 04:10 | So the MATCH function, which allows
us to match up data from different
| | 04:14 | locations, let's take this data comma
and see if we can find it in column A.
| | 04:21 | We need an exact much, so we use zero here
as the final argument. And do we find this?
| | 04:27 | No, we don't, because it's got a leading space.
| | 04:30 | So what can we do here?
| | 04:32 | We can alter this to say, let's use
the TRIM version of D2, and by putting in
| | 04:39 | TRIM right here, we're taking the
information in cell D2 and stripping off any
| | 04:44 | leading or trailing spaces.
| | 04:46 | Just as we saw how the TRIM function
worked earlier, it's going to work here as well.
| | 04:51 | So we did find this.
| | 04:53 | It's in the tenth position.
| | 04:55 | Now there might be other things that we
want to do with this, but the main point
| | 04:58 | here is we were able to locate that
because we used the TRIM function here to
| | 05:03 | say, let's trip off that leading
space that we see here in cell D2.
| | 05:07 | We'd have the same issue, by the way, if
that were corrected, as I am doing now,
| | 05:12 | and then I put in a trailing space.
| | 05:14 | I put in two trailing spaces.
| | 05:16 | This is still going to work because we
are using the trimmed version of this.
| | 05:21 | So the TRIM function has a real role
to play, and it has a major role to play
| | 05:26 | in those situations where you get
downloaded data from other sources--and
| | 05:30 | that's something that happens more likely these
days--the data always isn't in the best of shape.
| | 05:34 | The TRIM function is going to give you
the tool for cleaning up those columns of
| | 05:38 | data that have leading or trailing spaces.
| | Collapse this transcript |
| Using CONCATENATE with functions| 00:00 | In Excel, there is a function called
CONCATENATE, as well as a capability
| | 00:05 | sometimes referred to as concatenation.
| | 00:08 | In both cases of course, some people
chuckle a bit at the pronunciation of the
| | 00:12 | word and even the use of it.
| | 00:13 | It's a bit of a tongue twister.
| | 00:15 | But here is a situation in columns A, B,
and C, First name, Last name, Middle
| | 00:19 | Initial. Nothing wrong with that of
course, but you might want to be pulling
| | 00:23 | data together either for a mailing
label--in which case you might want this to
| | 00:27 | be in row 2, for example, Mark S
Baker--or possibly you might want to
| | 00:33 | reconstruct that list and put
everything into one column, so that you can sort
| | 00:37 | the data by last name.
| | 00:39 | In other words, we might want to
see Baker, Mark S. Using either a
| | 00:45 | function called CONCATENATE or
using concatenation techniques, you can
| | 00:49 | achieve these goals.
| | 00:51 | Let's just first use this word, CONCATENATE.
| | 00:54 | Now, as I start to type this, I will
take advantage this time of the fact that
| | 00:58 | it will appear in the list.
| | 00:59 | There it is, right there.
| | 01:00 | I will press Tab, save myself some typing.
| | 01:03 | And we can concatenate data from a
variety of different locations, as well as
| | 01:08 | adding characters of our own, as we wish.
| | 01:11 | So suppose we do want Last name first
here. What do we need here? We need B2.
| | 01:17 | If we want a comma after this--this
comma of course, simply separates B2 from
| | 01:22 | the rest of what we want to do.
| | 01:24 | Now, we want double quote, comma,
space, double quote. So we want Baker, comma. Then
| | 01:30 | what do we want? The first name is in A2.
| | 01:33 | Now we need another comma to indicate
the end of that second argument. Click A2,
| | 01:38 | comma, and now we want a space after
that. Double quote, space, double quote, and
| | 01:44 | finally, after another comma,
| | 01:46 | we need the middle initial. Enter.
| | 01:49 | There we are: Baker, Mark S.
| | 01:53 | So simply double-click here
to copy this down the column.
| | 01:57 | You can see what's happening.
| | 01:58 | Take a look at that again.
| | 02:00 | Now, I use this a lot, but usually I do
it without the word CONCATENATE, which
| | 02:04 | we're about to show you. But the main
point now is the idea that it's so easy to
| | 02:08 | make a typing mistake when you do this.
| | 02:10 | So you just have to be a little bit
more diligent as you type those commas and
| | 02:13 | double quotes to remember what it is
you are typing. A little tricky there, but
| | 02:17 | generally easy to do.
| | 02:19 | Now a variation on this--and I'll just
use the other construction--is not to use
| | 02:23 | the word CONCATENATE at all, but
simply to use the ampersand as a separator.
| | 02:29 | So let's say this time around, what
we want to do is use first name, middle
| | 02:33 | initial, and last name. And do notice,
by the way, that some people don't
| | 02:36 | have middle initials.
| | 02:37 | So what do we need first here?
| | 02:40 | =A2. That's going to be Mark in this case.
| | 02:43 | What do we want to follow this?
| | 02:45 | Now we put in the ampersand and then double quote,
space, double quote, and what do we want next?
| | 02:53 | The middle initial. That's coming right here.
| | 02:55 | Now some people don't have middle
initials, so we'll show how this plays out.
| | 02:59 | Then we want the middle
initial, and then what do we want?
| | 03:03 | Double quote, space, double quote--in other
words a space. And finally here, what do we want?
| | 03:09 | Baker. And since all these cells are
highlighted, I am going to press Ctrl+Enter.
| | 03:14 | They'll all be taking care of it at once.
| | 03:16 | We see how this is being pulled together.
| | 03:18 | Now is that clearer then using CONCATENATE?
| | 03:21 | For a lot of people, no.
| | 03:22 | It's less typing. So either way works,
either of the CONCATENATE function or
| | 03:27 | the concatenation techniques as we see here.
| | 03:31 | But there is some real power in
controlling the way you have data stored in a
| | 03:35 | database-like environment.
| | 03:36 | In the previous example, we saw--and I am
going to press Ctrl+Z a few times to get there--
| | 03:41 | this might be a preferred layout for
most people because you can, when you have
| | 03:47 | a list like this, sort by last name.
Of course, keeping the data in separate
| | 03:51 | columns, you can do that too.
| | 03:52 | Whether we use CONCATENATE or
concatenation techniques, here, too, we
| | 03:57 | finally reach a stage where we might
be saying, let's keep this data, throw
| | 04:01 | away the original data. So what do we do?
| | 04:04 | With the right mouse button, here,
we simply drag this either upward or
| | 04:09 | rightward into a different location,
and then immediately, right back on top of
| | 04:13 | itself, let go of the right mouse button,
Copy Here as Values Only. There we are.
| | 04:19 | So either way makes sense,
CONCATENATE or concatenation techniques.
| | Collapse this transcript |
| Adjusting case within cells with PROPER, UPPER, and LOWER| 00:00 | In Excel, there are three interrelated
text functions that allow us to control
| | 00:05 | the display of case.
| | 00:06 | I am talking about uppercase and lowercase.
| | 00:08 | There is also a third case, and that's
the one we need here if, as we look at
| | 00:13 | column A, we think those names would
be more readable and ultimately take up
| | 00:17 | less space if only the first
letters were capitalized, not the others--
| | 00:22 | the way we see this entry here.
| | 00:23 | There is a function called PROPER, =PROPER.
| | 00:28 | By definition, PROPER will capitalize
only the letters that either begin the
| | 00:33 | actual cell or follow space or punctuation.
| | 00:37 | So note that the B in O'Brien, since it
follows an apostrophe, it's capitalized.
| | 00:42 | The D follows a space.
| | 00:43 | It's capitalized, and that's what we want.
| | 00:44 | Notice at least one of the
names here has a middle name.
| | 00:47 | So as we double-click to copy this down
the column, we see the first letter of
| | 00:52 | each name is capitalized.
| | 00:54 | And you can try this with book
titles and other kinds of entries as well.
| | 00:58 | Most commonly, I think it's used with names.
| | 01:01 | Once again, as in examples in previous
movies, if we want to keep the results
| | 01:05 | here, while the results are highlighted,
| | 01:07 | we can simply, with the right mouse
button, drag this into column A, and as we
| | 01:12 | do, let go of the right mouse button,
Copy Here as Values Only, and then we
| | 01:17 | could get rid of the data in column B.
| | 01:19 | Well, I am going to press Ctrl+Z just
to remind us that we have done this, and
| | 01:23 | you can see how it plays out.
| | 01:24 | Notice that the first D in MacDonald,
whether it was spelled with Mac or Mc--it
| | 01:29 | doesn't make any difference--
doesn't get capitalized.
| | 01:31 | One of these years, perhaps they will have
that figured out, but that doesn't work yet.
| | 01:36 | This does save you a lot of time, though.
| | 01:38 | I think for a lot of people, it's is preferable.
| | 01:40 | It does take up less space.
It tends to be a bit easier to read.
| | 01:43 | Now we can also use functions like PROPER
along with other techniques, such as concatenation.
| | 01:50 | We might want to reconstruct these names
here, last name, first name, and at the
| | 01:55 | same time use PROPER.
| | 01:57 | So the first order of business might be
simply to write a concatenation formula
| | 02:01 | that takes the last name, & following
this, within double quotes, comma, space
| | 02:07 | double quote, & the first name.
| | 02:11 | So that's taken care of, but along
with it--and I could have typed it at the
| | 02:14 | same time--precede that with
the word PROPER. There we are.
| | 02:20 | And if, along the way, another issue
came up, if some of these names had leading
| | 02:26 | spaces, we assume those would be mistakes,
so put them here, put them there, and so on.
| | 02:31 | We would have other issues with the
results here. So sure enough, in all these
| | 02:36 | examples here--and I'll just go to first one.
| | 02:38 | We can have the word TRIM.
| | 02:39 | Do we put it after PROPER or before?
| | 02:41 | It doesn't make any difference.
| | 02:42 | We do need an extra set of parentheses,
so we can put right here if you wish,
| | 02:49 | and one trailing parenthesis as well.
And I emphasize we could reverse the order
| | 02:53 | of the words TRIM and PROPER here,
and this is still going to work.
| | 02:56 | Take care of it there, double-click to
recopy, and everything is cleaned up all at once.
| | 03:02 | So we can use these in
combination with one another.
| | 03:05 | Now in column H, we see another
situation. And here, too, one of those, not the
| | 03:10 | worst problem in the world, but these
part numbers just look a little strange
| | 03:14 | because the letters should have been
capitalized here, and they weren't.
| | 03:17 | So in a certain sense, they are not
wrong, but it doesn't look good, and you
| | 03:20 | certainly don't want to retype these.
| | 03:23 | We want to make these letters uppercase.
| | 03:26 | The numbers we don't want to change, and
this function doesn't do anything with numbers.
| | 03:30 | It simply uses them as it sees
them. But the function UPPER, meaning
| | 03:34 | uppercase, simply means take this
information here and display it all in
| | 03:38 | uppercase, sure enough.
| | 03:41 | The reverse of UPPER is not downer.
| | 03:43 | It's called LOWER, but you are less
likely to use that. But sure enough, it can
| | 03:47 | be used as well if you need to turn a
bunch of uppercase entries into lowercase,
| | 03:51 | or a bunch of proper case entries into all
lowercase, you can certainly use that as well.
| | 03:56 | So these functions, although we tend to
think of them together, are likely to be
| | 03:59 | used one by one in different situations
where we need to change the case, either
| | 04:04 | to lower--rarely used--or upper or in
the case that we saw here, proper case,
| | 04:09 | which allows us to
capitalize just the first letters.
| | 04:11 | They are all valuable, and they'll
often save you a ton of time in cleaning
| | 04:16 | up your data.
| | Collapse this transcript |
| Adjusting character content with REPLACE and SUBSTITUTE| 00:00 | Excel has two companion functions that
are very similar in nature called
| | 00:04 | REPLACE and SUBSTITUTE.
| | 00:07 | One of them is character-position
specific. Another one is content-specific.
| | 00:13 | We can tell both the descriptions in
row one, how to differentiate them.
| | 00:16 | Let's talk about this concept first of all.
| | 00:19 | We've got some data in
these cells here, A2 through A5.
| | 00:22 | They're some kind of code numbers, and
all the examples on this worksheet are
| | 00:26 | actually code numbers.
| | 00:28 | But we want to replace the
fifth character with nothing.
| | 00:31 | The fifth character there is actually a hyphen.
| | 00:33 | You can see that there, and over here on
the right-hand side, we don't see the hyphen.
| | 00:38 | We see QE.
| | 00:40 | Now first thought might be, why don't
we just do an Edit > Replace, replace
| | 00:44 | hyphens with nothing?
| | 00:46 | Well, we could do that if we wanted to
get rid of all the hyphens, but there are
| | 00:51 | other hyphens out here in the third
last position that we want to keep.
| | 00:55 | So the function we want to
use here is called REPLACE.
| | 00:59 | REPLACE allows us to replace
characters based on their position.
| | 01:04 | So where are we looking here?
| | 01:06 | The old_text reference means the text
that we are looking at, which is in cell
| | 01:11 | A2. Comma. Starting at which
position do we want to make a replacement?
| | 01:18 | In this example here, based on the
description, it's the fifth character.
| | 01:22 | For the moment, there's a hyphen there.
| | 01:24 | We don't care what the character is
really, but it is a hyphen here as we see
| | 01:28 | it. Comma. And how many characters do
we want to replace? Just one.
| | 01:34 | It could be two or three or five of
course, but in this case just one. Comma. And
| | 01:39 | what do we want to replace it with?
| | 01:41 | It could be three characters, five
characters, six characters, but within double
| | 01:46 | quotes, we'll put in what we want
replace it with. And if we want to replace it
| | 01:50 | with nothing, it's just
double quote, double quote, Enter.
| | 01:53 | We can see the results.
| | 01:56 | We have replaced the fifth character--
| | 01:57 | that's the hyphen between the N and the
Q--with nothing, as we see it here. And
| | 02:03 | we do this in the rest of the
cells as well. Same general idea.
| | 02:07 | In all cases here, we are
replacing the fifth character, and just one
| | 02:12 | character, with nothing.
| | 02:14 | Now, we can also replace this with a
longer string. And again, this looks
| | 02:19 | a little contrived, but there are all
kinds of weird things going on when people
| | 02:22 | are manipulating product type, codes,
project numbers, that sorts of thing.
| | 02:27 | People are trying to
reorganize and regroup maybe.
| | 02:30 | The need here is expressed in cell E1
is to replace the eighth character, so 1,
| | 02:36 | 2, 3, 4, 5, 6, 7, 8.
That's from the left-hand side.
| | 02:40 | Here we want to replace that second
hyphen with the characters USA, so that
| | 02:45 | it looks like this.
| | 02:46 | So once again, it's the REPLACE function.
And we're looking here. Comma. We want
| | 02:52 | to go to the eighth character, comma, and
replace that one character there, comma,
| | 02:59 | with the string USA, so within
double quotes, USA. We are done.
| | 03:05 | That's it.
| | 03:06 | Now, if we wanted to replace three
characters there, of course, we'd put in 3.
| | 03:10 | How is that going to look?
| | 03:13 | We go to the eighth position. That's hyphen.
| | 03:15 | We want to replace three characters with USA.
| | 03:19 | So what have we replaced?
| | 03:20 | The -87 is now USA.
| | 03:23 | So the difference between this and
what we did see earlier, this was a one,
| | 03:27 | and that means we simply replaced the hyphen.
But by putting in 3, we are replacing the -87.
| | 03:35 | Now the SUBSTITUTE function is about
the actual characters we're trying to
| | 03:40 | replace, not their locations.
| | 03:42 | In the example here, we want to
get rid of the first dashes and
| | 03:46 | substitute nothing for them.
| | 03:49 | Now here, too, could we be using
that Find and Replace capability?
| | 03:54 | No, because we don't want to get
rid of all of the hyphens here.
| | 03:58 | So =SUBSTITUTE, very similar in nature.
And every time I use one of these, I'm
| | 04:02 | thinking, should I have used the other one?
| | 04:04 | So if you don't use them frequently,
you have to think out which one it is, but
| | 04:07 | they are both capable, yet they
have suddenly different needs.
| | 04:10 | SUBSTITUTE. Okay we are looking in cell A8
here, comma, but we are looking for a hyphen.
| | 04:17 | So double quote, hyphen, double quote,
and that's what we want to replace.
| | 04:22 | Now there are multiple hyphens, and we
have the option of replacing all them,
| | 04:26 | just the first one, or just the second
one, or just the third one, or whatever.
| | 04:30 | Comma. We want to replace this with
what? Nothing. Double quote, double quote.
| | 04:36 | But only the first occurrence of it,
not all of them, so we're about to replace
| | 04:40 | that first hyphen with nothing.
| | 04:42 | The second hyphen we leave where it is.
| | 04:45 | Again, it looks like that.
| | 04:48 | Double-click to copy this.
| | 04:50 | In the example over here in cell E8--you
can certainly imagine what we are about
| | 04:53 | to do here--almost the same kind of thing.
| | 04:55 | We want to replace that second hyphen with XXX.
| | 05:01 | So we are going to start with
SUBSTITUTE as before, right there, and I'll use tab
| | 05:05 | to pop it into place. And we're
looking in cell D8. Comma. Once again, we are
| | 05:12 | looking for a hyphen. Comma. We want to
replace it with "XXX, but not just any
| | 05:20 | hyphen, the second one, not
the first one. So there we go.
| | 05:26 | We've replaced the second hyphen, or
dash--whatever you want to call it--with
| | 05:29 | XXX, and there it is again.
| | 05:34 | I tend to use these
functions three or four times a year.
| | 05:36 | I get them confused at times.
| | 05:37 | I get them mixed up, but I think
you can see their capabilities.
| | 05:41 | Again, in brief, the REPLACE function
allows you to replace information on the
| | 05:46 | basis of positioning.
| | 05:49 | The SUBSTITUTE function allows you
replace information on the basis of content.
| | 05:53 | They are both really valuable in cleaning up data.
| | Collapse this transcript |
| Reviewing additional text functions| 00:00 | In this worksheet called MoreText, we
see two different sets of data, and both of
| | 00:05 | them exhibit common problems that
you might encounter, particularly if you
| | 00:08 | download data from other resources.
| | 00:10 | The data in column A here
and there has trailing minuses.
| | 00:14 | Perhaps it has come from another system
where that in the case it's a negative.
| | 00:18 | What you'd like that data look like is
shown in column B. We want the minus in
| | 00:23 | front of the numbers.
| | 00:25 | When minuses appear behind numbers
the way we see them here, they are
| | 00:29 | actually treated as text.
| | 00:30 | There are couple ideas and thoughts as to
how we might get the data looking like this.
| | 00:36 | The problem with situations like this though,
tends to be that there's not a single answer.
| | 00:41 | We might have to use more than one function.
| | 00:44 | Now the good guess would be these are
going to be text functions, but which ones.
| | 00:49 | I think most of us would recognize
that there is a way to identify a trailing
| | 00:54 | minus, if we understand how to use a
function like RIGHT, which allows us to pull
| | 00:59 | off the rightmost character.
| | 01:02 | In English, we might be saying the following.
| | 01:04 | If the rightmost character is a
hyphen, then take the remainder of this and
| | 01:09 | multiply it by minus one and then
display that so it looks like this.
| | 01:14 | If it does not contain a trailing minus--
say like in the second example here--
| | 01:19 | simply display the cell as is.
| | 01:21 | That sounds relatively
straightforward, and in a certain it is,
| | 01:25 | but let's talk about how
we are going to build this.
| | 01:27 | We need to know something about the
If function, which many times is simple
| | 01:31 | and straightforward.
| | 01:32 | We've got a simple logical test here.
| | 01:34 | We use the RIGHT function.
| | 01:37 | If the right character of this location,
comma, one, equals a minus, and we got to
| | 01:44 | put that within double quotes, what do we do?
| | 01:48 | We want to pick up the remainder of the cell.
| | 01:50 | Well, how do you do that?
| | 01:53 | We could say we want to pick up the
left 1, 2, 3, 4, 5 characters, but what if
| | 01:58 | this is $45.45 with a minus?
| | 02:01 | That's five characters, and how are we
are counting the decimal? How is this all
| | 02:05 | going to fall into place?
| | 02:07 | Another function is going to come in
play as one perhaps you're not aware of.
| | 02:10 | It's called LEN, meaning length.
| | 02:13 | If we know the length of this entry,
and it is literally 1, 2, 3, 4, 5, 6, 7
| | 02:19 | characters, we want to pull
out six characters from the left.
| | 02:24 | So if we know the length of this--so
let's put on that in, LEN, the length of this.
| | 02:29 | And again, as we look at the data here
just for the single example, we're talking
| | 02:34 | about 1, 2, 3, 4, 5, 6, 7 characters -1,
we need to pull out six characters from
| | 02:42 | the left of cell A2.
| | 02:44 | So we want this LEN to be within the
function called LEFT and the LEFT function
| | 02:51 | allows us to look here, comma, so we
want to pull out six characters from the
| | 02:57 | left-hand side of cell A2.
| | 03:01 | In other words, right now what this
will have done, if it's working properly,
| | 03:06 | will pull out 345.45.
| | 03:09 | But we want to make sure it gets
treated as a negative, so we need to
| | 03:12 | multiply this by minus one. *-1.
| | 03:17 | That's what we want to do
when there's a trailing minus.
| | 03:21 | When there's not a trailing minus, we
simply want to just pick up whatever is in
| | 03:25 | cell A2. Right parenthesis.
We are done. Enter. Looks like that.
| | 03:32 | Of course, we'd copy it down the column,
and we might have thousands of these, but
| | 03:35 | next concern is, what happens in this
case when we have a number like this?
| | 03:40 | Everything is just fine.
| | 03:41 | Now that was not the easiest thing in
the world to do, but again, if you approach
| | 03:46 | this methodically and learn how to use
some of the various text functions, you
| | 03:49 | can get pretty creative in cleaning up data.
| | 03:52 | The payoff, of course, is you've got
thousands of entries, and you really write
| | 03:56 | one formula and then copy it many, many times.
| | 03:59 | So that's how we can pull together
the data, correct the data that we see in
| | 04:03 | column A, put it the way we want it to
be by using in this case a combination of
| | 04:07 | the RIGHT function, the LEFT
function and the LEN function.
| | 04:12 | Now another concern is the data that
we see in column E. Now these are code
| | 04:17 | numbers, but because they're typed as
numbers, they don't show leading zeros.
| | 04:22 | And now we do see leading zeros here.
And by the way, a common situation here is
| | 04:27 | the issue of zip codes.
| | 04:29 | Let's put in a New England zip code.
I am going to type 00123, and as I press
| | 04:35 | Enter, look what happens: we just get the 123.
| | 04:39 | Ideally and what I should have done
here and probably for the whole column, a
| | 04:43 | right-click > Format Cells would be the fastest.
| | 04:46 | On the Number tab here, simply
choose Special and then Zip Code, or as the
| | 04:52 | case may be, Zip Code + 4.
| | 04:54 | There are the zeroes and
from now on, we are all set.
| | 04:56 | A zip code in the West Coast maybe is
this. A zip code in New England might be,
| | 05:01 | and I will just type 34.
| | 05:02 | I won't need to type any zeros even.
| | 05:05 | Now take a look at the data in
column E. This is a little bit different.
| | 05:08 | These perhaps are code numbers or id numbers.
| | 05:11 | We want them to look like this.
| | 05:13 | We want all of these to be five characters wide.
| | 05:16 | Let's get rid of these and
use a function called TEXT.
| | 05:23 | We want to take this data here, comma, and
convert it into text and use the format,
| | 05:31 | double quote, and five zeros
if we want five positions here.
| | 05:35 | It'll fill it in with leading zeros when we
have fewer than five characters. Double quote.
| | 05:41 | We are done. Recopy it. There we are.
| | 05:45 | The data looks like this.
| | 05:47 | In this case, as in lot of previous
examples, if this is what we want, and we
| | 05:50 | have done this through a column, we
simply will take this data and with the
| | 05:54 | right mouse button drag it into the data
in column E to clean it all up, like that.
| | 05:59 | Copy Here as Values Only.
| | 06:01 | So I want to leave you with the idea,
if certainly not the reality, that anytime
| | 06:05 | you've got data that's in place, but
it isn't looking right, there often is a
| | 06:09 | way, using some of the many text
functions available to us, to clean up data.
| | 06:14 | And even though from time to time it gets a little
involved with formulas like the one we saw here,
| | 06:20 | have faith, I guess I am saying, in the
idea that these text functions do allow
| | 06:25 | you to clean up major portions of the
data that you sometimes get that looks
| | 06:29 | great, but it doesn't
quite the shape you want it in.
| | Collapse this transcript |
|
|
11. Financial Functions Calculating payments with PMT| 00:00 | A major category of
functions in Excel is Financial.
| | 00:04 | In the Formulas tab, on the Ribbon in
Excel, click the Financial indicator right
| | 00:09 | here, and we'll see well over 50 of them.
| | 00:12 | If you are in the world of banking,
mortgage, finance, you certainly will have
| | 00:15 | some familiarity with many of these.
| | 00:18 | However, one that gets almost
anybody's attention, even if you are not active in
| | 00:22 | that area, is a function that allows
you to calculate the monthly payment on a
| | 00:26 | loan, if it's a car loan, house loan, boat
loan--whatever. And it's pretty easily handled.
| | 00:33 | One thing to point out about this
function, as well as a number of the other
| | 00:36 | functions in this category, is that
very often you will be using an interest
| | 00:41 | rate--for example, 5%, 4.3%, whatever.
You must remember to divide it by 12.
| | 00:47 | The function we're talking about
here is PMT, payment. It requires three
| | 00:53 | arguments in its basic form.
| | 00:56 | We are about to borrow $25,000.
| | 00:58 | We want to pay this off over 4 years.
| | 01:00 | The yearly interest rate is 5%.
| | 01:04 | Rate is the first item that we need here.
5%, divide by 12. Very often the loan is 12 months.
| | 01:12 | If this is a quarterly loan, if you
are paying it off quarterly, you would
| | 01:16 | be dividing it by 4.
| | 01:16 | If it's a year, you
wouldn't divide it by anything.
| | 01:20 | It's probably unlikely. But this is
the most common. Comma. The number of
| | 01:24 | payments. And if the payments are 12
per year, then we want to take the year
| | 01:29 | count here of course multiplied by 12.
Comma. And how much are we borrowing? 25,000.
| | 01:36 | Enter. And sometimes people are a
little surprised to see this result, because
| | 01:40 | it's negative. And of course I could
be a little slight and say well it does
| | 01:43 | money leaving you, but nevertheless
that is the answer. If you borrow $25,000,
| | 01:47 | you want to pay it off over 4 years, if the
interest rate is 5% annually, then your
| | 01:53 | monthly payment, principal
and interest included, $575.73.
| | 01:59 | If you'd like to use this number,
say in your family budget somehow, it's
| | 02:03 | much easier to work with as a positive
number. And so the workaround here would
| | 02:08 | be simply either to put a
minus in front of this number here--
| | 02:11 | you might not prefer to do that--but
in the formula itself, put a minus in
| | 02:15 | front of the last argument, and we
will get the exact same numerical result,
| | 02:19 | but this time, the number would be a
positive number. And many people find that
| | 02:23 | easier to work with.
| | 02:25 | Surely, this action here, which perhaps
has to do with the car, could easily be
| | 02:30 | applied to something like a house.
| | 02:32 | There is a typical 30-year loan.
Someone wants to borrow quarter of a million
| | 02:36 | dollars, pay it off at 5%. And in this
case, we can just copy this particular
| | 02:42 | function into cell G7.
| | 02:44 | One way to do this is with the right
mouse button, drag this over here, let go,
| | 02:48 | and simply copy here.
| | 02:50 | So if you want to borrow $250,000 and
pay it off over 30 years, 5% interest
| | 02:56 | rate, same use of PMT as we saw it
before. Again, there is a division by 12 and
| | 03:02 | the multiplication of the years by 12,
and we have our answer. And once you get
| | 03:07 | familiar with this--and
it's a pretty easy function,
| | 03:09 | let's face it--after
you've used it a little bit,
| | 03:11 | you could easily build a table here,
coming up with different amounts of monthly
| | 03:16 | payments depending upon different
amount being borrowed. And of course you can
| | 03:20 | build this list to vary it
by 10,000, 25,000, whatever.
| | 03:24 | The same thing with the
interest rates, we see across the top.
| | 03:27 | A nice quick way to do this is to
highlight all these cells first. And this time
| | 03:32 | we'll just choose =PMT, and the
rate will be coming out of row one.
| | 03:38 | So as we click K1 here, we then want to
press F4 a few times, so that we see the
| | 03:44 | Dollar sign indicator in front of the 1 only.
| | 03:47 | What this means, of course, is if we
copy the formula into the adjacent,
| | 03:51 | highlighted cells, we will always
get our percentages out of row 1.
| | 03:55 | We need to divide that by 12. Comma.
In this case, all of these are 30-year loans,
| | 04:02 | so we use the 360 that's right there,
and that needs to be an absolute address.
| | 04:06 | Press F4. Comma. Put in a minus
sign like we saw in the last example.
| | 04:11 | We need to get our amounts out of
column J. So as I click J2 here, we then want
| | 04:16 | to press F4 until we see dollar
sign in front of the J, but not the 2.
| | 04:21 | And we are all set. Ctrl+Enter, and there are the answers.
The various monthly payments, principal
| | 04:27 | and interest only, for different loan
amounts and for different interest rates,
| | 04:32 | using the PMT function.
| | Collapse this transcript |
| Finding future values with FV| 00:00 | If you need to calculate the value of
money invested on a regular basis, you
| | 00:04 | will need to turn to the FV--Future
Value--function, one of Excel's many
| | 00:09 | financial functions.
| | 00:11 | In row1, we see the question, "How much
money will I have after five years if I pay
| | 00:16 | $300 per month into an account
earning 3% interest per year?"
| | 00:20 | The function FV, Future Value, the rate,
3. As in many financial functions, we'll
| | 00:30 | need to divide this 12, if it is a
monthly payment the most common kind. Comma. We want
| | 00:36 | to be doing this for any number of
years. I suggested five here. We can either
| | 00:41 | put in 60, or to make it perhaps a
little clearer, five times 12--obviously the
| | 00:45 | same effect. Comma. And how much
are we putting in each month? $300.
| | 00:50 | There we go.
| | 00:52 | After five years now, if we put this
under the proverbial mattress or in
| | 00:56 | the cookie jar and nobody touches it, we
are talking about what? 60 times 300. 19,394.
| | 01:04 | In these situations, you may or may not
wish that to appear as a negative. If you
| | 01:08 | don't in creating the function itself,
simply put minus in front of the amount
| | 01:13 | that you are investing here.
| | 01:16 | You notice the second question in row 2:
How much money will have after five
| | 01:20 | years based on $15,000 deposit into an
account earning 3% interest per year.
| | 01:26 | Again, we will use FV, but in
a different way this time.
| | 01:30 | We are not talking about putting in
money on a regular basis, but just
| | 01:33 | putting in a lump sum.
| | 01:34 | Once again, we have got 3%.
| | 01:37 | We will not divide this by 12. Comma. And only
one payment, but we are doing this for
| | 01:44 | three years. And this time PMT is
actually left blank, the third argument.
| | 01:50 | The present value, in other words the
money we are putting in right now, is 15,000.
| | 01:55 | And as in the previous example, we
don't want our result to be negative, so I
| | 01:59 | will put a -15,000, and this is the amount.
| | 02:06 | So if we put 15,000 into an account, and
it earns 3% interest per year, this is how
| | 02:10 | much we will have after five years.
| | 02:13 | In either case here, you easily build
a table, if we thought about how much
| | 02:17 | money we might want to put aside each
month, and consider how much money we will
| | 02:21 | have after so many years. So in column A, we see
different numbers of years 4, 5, 6, 7, et cetera.
| | 02:28 | We see different amounts across row 8.
| | 02:30 | How about a single formula here?
=FV. And in all cases here, we are using a
| | 02:36 | table that's going to be using 2%.
| | 02:38 | So we will use this rate right here.
And we need to make this absolute, so we
| | 02:42 | will press F4. And since this is a
monthly payment, divide this by 12. Comma. And now the
| | 02:50 | number of years is going to be four, for
example. We need to multiply that by 12
| | 02:56 | because we are making a payment every month.
| | 02:58 | And the reference to column A must be
absolute also, so clicking in the A9
| | 03:04 | address, pressing F4, so that we have
the dollar sign in front of the A but not
| | 03:09 | the nine. And the third argument in the
FV function here is the amount that we
| | 03:15 | are borrowing minus, it's going to come
out of B8 initially, and then all the
| | 03:20 | other cells in row 8. This too needs to
be an absolute reference focused on the
| | 03:25 | actual row number 8. And to be little bit
more precise, it's actually what we call
| | 03:29 | a relative reference. In other words a
portion of it is absolute, a portion of it
| | 03:33 | isn't. As I press Ctrl+Enter, this
function will appear in all of the cells, and
| | 03:39 | there are the answers.
| | 03:40 | We might want to not show the decimals
maybe not ensure the dollar signs. But we
| | 03:45 | see the various effects here of how
much money we deposit each month into an
| | 03:49 | account, and this for a constant
amount, whether there's 300, 400 and all the
| | 03:53 | variations there, across a different
number of years, how much money we will have
| | 03:57 | at the end of that using
the FV, Future Value, function.
| | Collapse this transcript |
| Determining total amount of future payments with PV| 00:00 | Although it would be incorrect to call the
PV function the reverse of the PMT function,
| | 00:06 | nevertheless, this function does allow
us to tackle some of the same issues that
| | 00:11 | we saw with PMT in calculating a
monthly payment for a car or a house loan.
| | 00:16 | Here, the question you might say
is reversed, or flipped around:
| | 00:19 | "What house value can I afford if I
want to pay $2,000 a month at 5% annual
| | 00:25 | interest for the next 360
months?" The PV function.
| | 00:29 | And here are some various interest
rates. We might consider doing this for a
| | 00:32 | variety of entries. =pv (. And the rate
that we want here is going to be found
| | 00:40 | right here, and we need to divide this by 12.
| | 00:43 | If we do anticipate copying this, we
don't have to worry this either because
| | 00:46 | it's going to be in same relative cell.
| | 00:48 | Divide this by 12 as we do with many
Excel functions when it comes to rate. Comma.
| | 00:54 | And the next item that we need here is the
number of periods here. 360 months.
| | 01:00 | We can either type that
in or put in 30 times 12.
| | 01:02 | Some people think it's a little bit
more revealing to do this to accentuate the
| | 01:06 | idea that it's a monthly payment, but
either way it will work. Comma. And the amount
| | 01:12 | here that we would be paying each month.
| | 01:15 | Now, let's say we've sort of set aside
the idea that we will spend 2,000 month.
| | 01:22 | The result here is, what
house value can I afford?
| | 01:25 | Roughly 360,000, 362 here.
| | 01:28 | Here too as in other typical examples,
here we may wish this result to appear as a
| | 01:33 | positive number, simply
put a minus before the 2000.
| | 01:36 | If we wish to copy this down
the column, we certainly can using
| | 01:41 | different interest rates.
| | 01:42 | Here, I'll simply double-click.
Then we'll have the different amounts here.
| | 01:46 | So, as the rates go down, of course, the
more expensive house you can afford, or
| | 01:52 | let's say the more money you can borrow.
| | 01:54 | We can also use this
function in a different way.
| | 01:57 | In row 15 is the question here, how much
money do I need to invest now if I want
| | 02:02 | to have $150,000 in 10 years?
| | 02:05 | This question also brings to mind
the idea that sometimes the interest is
| | 02:09 | compounded differently.
| | 02:11 | But let's use the PV function here to
tackle this issue. And here's the percent
| | 02:18 | and we want to divide this by 12.
120 months or once again 10 years we are
| | 02:25 | talking about here. 10 times 12. Comma. And this
time we are not talking about a payment now.
| | 02:32 | So we put in 0 or simply ignore
that argument, and then -50,000.
| | 02:41 | We want our answer to be a positive number.
| | 02:43 | So how much money do we need to invest right
now if we want to have $150,000 in 10 years?
| | 02:50 | Notice that the $150,000 here
actually refers to FV. That's the future value.
| | 02:55 | How much money do we need to set aside
now if we are getting 2% per month interest?
| | 03:00 | 122,000. And we might want
to copy this down the column.
| | 03:05 | We'll just double-click.
| | 03:07 | Makes sense of course, if we get
more interest than we need to put aside
| | 03:10 | less money right now.
| | 03:12 | If we set aside $91,074.16 right now
invested at 5%, and it's compounded monthly,
| | 03:21 | in 10 years, we'll have a $150,000.
| | 03:24 | This time we are going to make a
different use of the function by putting in the
| | 03:28 | fact that we are compounding this daily.
| | 03:31 | So the interest rate will come
out a little bit differently.
| | 03:33 | So, as we type =PV here, the interest
rate of course will be referring to cell B16.
| | 03:40 | But now we want to divide this by 365.
It's going to be compounded every single day. Comma.
| | 03:47 | And so the number of payments is going
to be 10 years times 365, 10*365. Comma. And as
| | 03:56 | in the previous use of the function
to the left here, we have a 0 in this
| | 04:00 | argument, and the -150,000.
| | 04:05 | So, what's going to be the
difference if it's compounded daily versus
| | 04:08 | compounded monthly?
| | 04:09 | Here, we see the difference. Not huge.
| | 04:14 | Perhaps on some of the higher
percentages it will be, and we see those amounts.
| | 04:18 | The difference here--and I am going
to press Ctrl+Tilde here to show these
| | 04:22 | differences so we can see both functions
together, and there we can see them side by side.
| | 04:26 | You see how they are calculated
differently because we are talking about
| | 04:31 | compounding monthly versus compounding daily.
| | 04:34 | Press Ctrl+Tilde again to see the difference.
| | 04:37 | So, using the PV function, we can
calculate, as we saw in the previous example,
| | 04:42 | a sort of a goal or an amount that
you're looking for. And you can also use it
| | 04:46 | for investment purposes as we saw down
on row 16 through 19. The PV function.
| | Collapse this transcript |
|
|
12. Information Functions Working with the IS information functions| 00:00 | As you explore some of Excel's many
functions, you may encounter a category on
| | 00:05 | the Formulas tab, under More
Functions, referred to as Information.
| | 00:11 | A number of these begin with IS, and
sometimes are referred to as IS functions.
| | 00:16 | A number of these practically
explain themselves, as we look at some of
| | 00:19 | their names in here.
| | 00:20 | But let's talk about using these within context.
| | 00:24 | I had a list not unlike this recently,
and I wanted to put a total on top, so I
| | 00:29 | used AutoSum. And it doesn't do this
automatically, so you highlight the cells
| | 00:33 | in question and I pressed Enter.
| | 00:35 | There are about 10 entries there.
And I am thinking 10 times 2, 10 times 3,
| | 00:39 | whatever 23,000, 30,000.
| | 00:41 | The total is a little short, and
you can probably see what's going on,
| | 00:44 | particularly since I have
zoomed in a little bit here.
| | 00:46 | Some of these are not really numbers.
| | 00:49 | That's 29, O not 0, 2;
| | 00:53 | this is 34 O, and that's
not 1 that's an l, or I;
| | 00:59 | I don't know which. Same thing here.
| | 01:01 | Of course, I put these in on purpose,
but when you download data from other
| | 01:04 | sources sometimes these things happen.
| | 01:07 | By the way, one technique that would
have potentially prevented these is that
| | 01:12 | when this data was entered perhaps
the person using it had forced right
| | 01:16 | alignment as this is being done here.
| | 01:18 | I am going to uncheck right alignment
here, and the non-numbers automatically
| | 01:23 | drift to the left side of the cell.
| | 01:26 | Now, when you see numbers
like this next to others,
| | 01:28 | of course they stand out, and you
know that. But in a huge list of numbers,
| | 01:33 | particularly if you have downloaded it,
and you've got less of a zoom factor,
| | 01:36 | these don't always pop out at you
until things like this start to happen, and
| | 01:40 | you recognize something is going on.
| | 01:42 | So, from time to time, you
do have to clean up data.
| | 01:45 | Again, now that we have to go back to
that right alignment, but let's again
| | 01:48 | put it in that form.
| | 01:49 | This function ISTEXT ISNUMBER, ISNONTEXT
certainly could help.
| | 01:55 | =istext and what we get returned
here is true or false. Is that text?
| | 02:04 | No, it's not. It's non-text.
| | 02:07 | It's actually a number.
| | 02:09 | I'll double-click to copy these down the
column, and of course we see what's happening.
| | 02:12 | These are text, this is text, and as you
might expect this is going to be the reverse.
| | 02:18 | We are going to do all of
these at once. =ISNUMBER.
| | 02:22 | There we are, and of course
we see the reverse of this.
| | 02:29 | There is another choice here,
| | 02:29 | not so obvious and only occasionally
used perhaps, and you will see why in a second.
| | 02:34 | ISNONTEXT. Now, that's going to
be the opposite of ISTEXT.
| | 02:36 | It's going to be the same
as ISNUMBER, =isnontext.
| | 02:46 | It looks pretty much the same, doesn't it?
| | 02:48 | Aren't these identical?
| | 02:50 | The only difference is if one of the
cells you have going to be checking here--
| | 02:53 | it could be any one of these--is blank.
| | 02:55 | That's when we do get
different answers. ISNUMBER?
| | 02:57 | No, that's not a number. Is it text?
| | 03:00 | No, both of these are false, but here it's true.
| | 03:03 | So, there is a difference there.
| | 03:04 | You also run across some
other IS functions as well.
| | 03:08 | Maybe we want to come up with an adjusted
score here for the scores that we see here.
| | 03:13 | Now, for whatever reason,
some of these are blank.
| | 03:15 | Maybe we simply want to
provide a default score here of 99.
| | 03:20 | So, what we might like to do is use a
function = along with the IF function.
| | 03:24 | First of all, talk about how we
would do this if we don't know about a
| | 03:29 | function called ISBLANK.
| | 03:31 | I want a say in English if this cell is
blank, and certainly one way to do this
| | 03:35 | is to type = "" sometimes
it's called the null string,
| | 03:41 | if G2 is empty--it has nothing in it--
we'll just give it this 99 value.
| | 03:46 | Otherwise, we are going to take that
original score and multiply it by 1.1.
| | 03:54 | And we can copy this down the column, and
of course you see what's happening.
| | 03:58 | Nothing wrong with that.
| | 03:59 | We probably adjust the format and so
on. But again here is the function.
| | 04:03 | It might be a lot clearer to some
people--not that this is that obscure.
| | 04:07 | Why don't we just say in English, if
G2 is blank. And we do this by using
| | 04:12 | the function ISBLANK.
| | 04:16 | If G2 isblank. And almost everybody
would agree this is more readable than what
| | 04:21 | we had previously, as I clean
this up here, looking like this.
| | 04:25 | Same results in this case, but
easier to read, easy to understand.
| | 04:30 | So, there are quite a few different functions.
| | 04:32 | Again, if you go to the Formulas tab,
choose More Functions > Information,
| | 04:36 | that's where you'll find most of
these. And there's more here too as well,
| | 04:39 | the so-called IS functions.
| | Collapse this transcript |
| Using error-checking functions: ISERR, ISERROR, IFERROR| 00:00 | Certain kinds of errors in Excel
sometimes have a habit of popping up at the
| | 00:03 | most inopportune moments.
| | 00:06 | Not so long ago I was working with a
worksheet not unlike this one, and I just
| | 00:11 | hadn't thought ahead about some of the
implications of formulas, and I made a
| | 00:15 | change, and it caused some
problems--at least for a while.
| | 00:18 | In this particular worksheet,
there are many, many formulas.
| | 00:21 | I am going to press Ctrl+Tilde to expose them.
| | 00:24 | They are everywhere. Except for rows 2
and 3, nearly everything else is a formula.
| | 00:29 | There are formulas in rows 7, 8, 9 that
have to do with calculating percent of
| | 00:33 | change, and they do involve division by
some of the entries in rows 2, 3 and 4.
| | 00:39 | To make the long story short here,
what happens if one of these is a zero?
| | 00:43 | We are going to be dividing by 0, and
that could certainly happen with the
| | 00:47 | data that we see here.
| | 00:49 | What if in May we are making an
adjustment to the numbers, and it turns out that
| | 00:53 | the Sales and Expenses--maybe these
are hundreds of thousands of dollars--
| | 00:56 | happen can it be the same.
| | 00:57 | This is going to be 300. Press
Enter and of course the Profits will
| | 01:01 | become zero for May.
| | 01:04 | Surely, you've seen what's happening here.
| | 01:06 | Division by zero, it's also happening down here.
| | 01:09 | Just take a look at this
particular function here.
| | 01:12 | We are trying to divide by zero in this case.
| | 01:14 | Now, in a certain sense you could
say well, this is totally accurate.
| | 01:17 | It's true, why not?
| | 01:18 | Just leave it there. That's fine.
| | 01:20 | But there could be times when you're
either ready to print this, or you are
| | 01:23 | going to be showing it in a
meeting on a big screen, and so on, and
| | 01:26 | you'd rather not have this be here.
| | 01:28 | You'd rather show something else,
like NA, or Not Applicable, or 0, or just
| | 01:33 | empty--whatever it is.
| | 01:35 | So one standard approach by way of
the functions that we call Information
| | 01:39 | functions, could be using ISERR, and this
check to see whether a value is an error--
| | 01:47 | and it list all kinds of
possibilities there--or it's companion, ISERROR.
| | 01:53 | This is more comprehensive.
| | 01:55 | This is probably the better one to use.
| | 01:57 | Now, a function like this actually is
frequently used, but not exclusively used
| | 02:02 | with the IF function.
| | 02:03 | So, here is a way you might do in this
particular example. And let's say it in
| | 02:07 | English first of all.
| | 02:08 | If this particular formula that we want
to use here is going to cause an error
| | 02:14 | like the one we just saw, then we want to have
another result displayed here, not the error.
| | 02:20 | So, let's put and if in front of this,
left parenthesis, and now the function ISERROR(. We are
| | 02:31 | trying to see if this formula is an
error, and if it is, we might want to display
| | 02:37 | nothing. That would be double quote, double quote.
0 probably isn't the best thing to show
| | 02:42 | here either, but some people show that, put a 0.
| | 02:45 | If it is a 0, by the way, you could just it in
either this way or without the double quotes.
| | 02:50 | A third way might be to put in the letters NA.
| | 02:53 | You could do it that way if that makes
sense to you and, you think it would make
| | 02:56 | sense to your audience as well.
| | 02:57 | There is even another way, not so
obvious, you can put in the function NA.
| | 03:02 | Just type it this way.
| | 03:04 | The only slight advantage to that is
that there is another function available
| | 03:08 | called ISNA that will allow you to
check for that occurrence in cells.
| | 03:13 | It's not necessarily that powerful is
one of thing, but it is an option.
| | 03:16 | I think for many people the
choice here might be "NA".
| | 03:21 | This is what we want to appear when that
formula calculation results in an error.
| | 03:27 | And what if it does not result in an error?
| | 03:30 | Then we actually want this
calculation to take place.
| | 03:33 | So, I am not going to retype this.
| | 03:35 | I am going to highlight it, press
Ctrl+C, and put that right here after the
| | 03:40 | Comma. Ctrl+V. I believe one more parenthesis
should do this, so I think we are all set here.
| | 03:47 | I'll press Enter.
| | 03:48 | So, in this case, we print NA. And sure
enough, we would copy this leftward so the
| | 03:53 | other cells are doing the same sort of thing.
| | 03:56 | Of course, nothing changes here because
all of our other profits up in row 4 are
| | 04:01 | not 0, but they are here.
| | 04:03 | So, this is certainly standard. It works
| | 04:05 | okay, and for a lot of
people it makes good sense.
| | 04:08 | It is a bit lengthy, for sure.
| | 04:09 | Sometimes, when you have to make adjustments
here, it takes a while to get this just right.
| | 04:13 | There is a better function to handle
this, but if you are looking in the same
| | 04:18 | category that I mentioned here
under More Functions and Information,
| | 04:21 | you won't see a relatively new function,
new in Excel 2007, called IFERROR.
| | 04:28 | And it's under the category
called Logical. There it is.
| | 04:32 | Now, by contrast, that with more I'd
like to do is leave this right here and
| | 04:36 | momentarily I'll make the column wider.
| | 04:38 | In a minute, we'll show just by
double-clicking so we can see that.
| | 04:42 | But I like to contrast that with the
new function that I think it's better
| | 04:46 | because it's much shorter =IFERROR.
| | 04:49 | Actually, before doing that, to
save myself a little bit of typing,
| | 04:51 | I am simply going to copy this portion of
it with Ctrl+C and Escape to get out of here.
| | 04:58 | The IFERROR function, =IFERROR begins
with the same idea. And I am going to
| | 05:06 | press Ctrl+V. If this particular
calculation is an error--and by the way, I typed
| | 05:13 | if there are too many times upfront--
| | 05:16 | if this calculation is an error,
comma, what do we want to display?
| | 05:20 | Well, how about NA, just like we did before.
| | 05:24 | But here is the good part.
| | 05:25 | We don't have to indicate what happens
when the function does not cause an error.
| | 05:29 | It's just the first argument.
| | 05:31 | If this is an error, display NA. If it's
not, do the formula. There is the answer.
| | 05:38 | As I press Ctrl+Tilde here to display
this larger, you'll see what's happening.
| | 05:41 | We'll see them side by side in a
second here, and there they are.
| | 05:45 | You see the difference in these two.
| | 05:46 | The second one is much easier to
read and to understand, and we see what's
| | 05:50 | happening there in terms
of the ability to read it.
| | 05:53 | It's just more succinct. Great function.
| | 05:56 | So, it's IFERROR, and that's the
one I would be using in this case here
| | 06:00 | and eventually there.
| | 06:01 | To complete the action here,
let's simply take that, put it here.
| | 06:05 | Okay, copy it leftward. There we are.
| | 06:10 | Re-adjust. And to copy these formats
downward, simply highlight this, and with the
| | 06:16 | right mouse button drag down
here and Copy Here as Formats Only.
| | 06:20 | So, a much easier and better
function to use, IFERROR than the previous
| | 06:25 | examples, the unwieldy use of ISERROR.
| | 06:28 | This is called IFERROR.
| | Collapse this transcript |
|
|
13. Reference FunctionsGetting data from remote cells with OFFSET| 00:00 | In this worksheet called Offset,
we've got data in columns A and B, and in
| | 00:06 | columns D and E, we see an indicator
for Latest Date and Latest Closing Rate.
| | 00:12 | Now imagine that what we are
collecting here is information.
| | 00:15 | Our list is going to grow and grow and
grow, get much deeper. Maybe this has
| | 00:18 | something to do with the stock market
or some other index. I forgot to put in the
| | 00:22 | closing rate here for the
following day. That's 256.
| | 00:27 | What we want to know at all
times though, is the last entry.
| | 00:30 | So for the moment, what we would like
to see right here is this date, and right
| | 00:35 | here in cell E2, we would
like to see the number 256.
| | 00:37 | We want to do this in such a way that
no matter how many entries we have here,
| | 00:43 | this will grow and grow and grow.
| | 00:45 | We are always picking up the
latest date, the latest closing rate.
| | 00:50 | If you're exploring for a function
like this, it's going to take you a bit
| | 00:53 | of time to find it.
| | 00:55 | Eventually, you will come across, by
doing a search, under Lookup & Reference, a
| | 01:00 | function called OFFSET. And the brief
description of this when you see this may
| | 01:05 | not ring true: "Returns a reference to
a range that is a given number of rows and
| | 01:11 | columns from a given reference."
| | 01:14 | Well, that is exactly what we want to
do here. And after using this function a
| | 01:18 | bit and reading this, it
will make a lot of sense.
| | 01:21 | It's exactly what we want to do.
| | 01:23 | We need a reference to that range in
column A, but we need to know how many
| | 01:28 | cells it is from the top.
| | 01:30 | It will involve also using a function
called COUNTA, which allows us to count the
| | 01:36 | number of entries in a range.
| | 01:38 | =OFFSET(. The reference that we're
talking about is cell A1, the top of the
| | 01:50 | reference here. Comma. How many rows
away from that cell are we looking at?
| | 01:59 | We are looking at this cell
right here, which is eight rows away.
| | 02:03 | The function called COUNTA--by the way
this has nothing to do with column A,
| | 02:08 | it's just coincidence we are using this--
| | 02:10 | COUNTA will calculate, as you can see in
the description, the number of cells in
| | 02:15 | a range that are not empty.
| | 02:17 | So by looking in column A and using
COUNTA, although we can't see this value
| | 02:24 | right now, this portion of the
function is giving us the number 9.
| | 02:29 | There are nine cells that
have content in column A.
| | 02:33 | We want to move from cell A1--that's
our starting point--downward eight rows,
| | 02:41 | whatever the content is, -1.
| | 02:44 | That's going to give us an eight. Comma.
| | 02:47 | We can move into a different column
from here, but we don't need to do that,
| | 02:51 | so the column reference is zero, or we
can simply ignore it, but you must have
| | 02:55 | at least the comma there. So, either way.
Perhaps it's best to leave the zero
| | 02:58 | in there to suggest
| | 02:59 | we are not changing the column reference at all.
| | 03:03 | We need to put in the right parenthesis,
because we've got multiple parentheses there.
| | 03:06 | So if this will work properly,
we should we 10/14/2010.
| | 03:09 | That's what we are seeing.
| | 03:14 | Similarly, for the Latest Closing Rate,
we want to do the same sort of thing,
| | 03:18 | except we want to be looking in
column B, and our starting point is B1.
| | 03:24 | Let's copy this entry into cell E2.
| | 03:28 | That will throw you, of course.
| | 03:31 | That's not really what we want to see,
but the format got copied as well.
| | 03:34 | We could have done that in a different way.
| | 03:35 | Let's simply copy the
format, for example, from B2.
| | 03:39 | We can right drag this over to
here, Copy Here as Formats Only.
| | 03:43 | So there we see the 256, and of
course we want to test this as well.
| | 03:47 | Let's simply make this be the 15th, and
as we drag this downward, of course we
| | 03:52 | see our adjustment there and
maybe the entry here is 260.
| | 03:55 | We will adjust that, and we now
have the entry here as well, 260.
| | 04:01 | So it's the OFFSET function.
| | 04:04 | This is our starting point.
| | 04:06 | This is how far downward we want to move: -1.
| | 04:10 | If you have situations here where maybe
this is not in row one or if you've got
| | 04:15 | an empty row here, you're going to have
to experiment a little bit with whether
| | 04:19 | you want to subtract one or two,
possibly nothing, depending upon the layout.
| | 04:23 | So you have to work with that a little
bit. But if we get a situation where
| | 04:27 | it's contiguous cells from the top,
this is the structure you want to use,
| | 04:31 | the OFFSET function in combination
with COUNTA to allow us to pick up that
| | 04:37 | reference that eventually is going to be
pretty remote from where we are up in row two here.
| | 04:41 | Remember, this can go on and on
and on down in columns A and B.
| | Collapse this transcript |
| Returning references with INDIRECT| 00:00 | In this workbook, you'll
notice two sheets called Indirect:
| | 00:03 | Indirect-1 and Indirect-2.
| | 00:06 | There is a function in Excel called
INDIRECT that might not get your attention.
| | 00:11 | If you happen to see it in the list of
functions, it's found under the Lookup
| | 00:15 | and Reference category. But I think
when you read its description, it's
| | 00:19 | unlikely to cause you to say, I
really need this: "Returns the reference
| | 00:23 | specified by a text string."
| | 00:26 | Here and there in some books on Excel,
I've seen it referred to something like this.
| | 00:30 | Here is the cell that has an
address in it. Suppose it's B3.
| | 00:35 | The INDIRECT function allows us to
refer to a cell that has an address in it,
| | 00:41 | and then we will get the data from
that cell that's being referred to.
| | 00:46 | You're probably scratching your head
like I was for any numbers of years, saying
| | 00:49 | why would I ever use this function?
| | 00:51 | Well, it has two valuable uses--
| | 00:54 | one of them, I think pretty spectacular, even.
| | 00:56 | Let's focus first of all, on a simple
use of it: using a worksheet here that
| | 01:02 | actually has information
potentially about other worksheets in it.
| | 01:06 | This particular formula right here,
one of those special 3D-type formulas
| | 01:11 | that you might have seen in another
movie in this course, tabulates data from
| | 01:16 | four separate sheets.
| | 01:17 | It adds up to data from the various B3
cells across four separate sheets that
| | 01:23 | are also in this workbook here.
| | 01:25 | Now, what we might want to see also on
this Summary sheet is simply the total
| | 01:30 | from the East and then from the other
sheets as well. But as I click on the East
| | 01:35 | sheet, you'll notice that total we
are looking for--I've made it gray on
| | 01:38 | purpose--is in cell G6.
| | 01:41 | Of course, that's the same as it is
on these other regional sheets as well.
| | 01:47 | Now, if we simply wanted to put in the
total here without typing that number, we
| | 01:51 | can write a simple formula in the following way:
| | 01:53 | Equal, I am going to click on the East
sheet, click on this G6 cell and press
| | 01:59 | Enter, and there it is.
| | 02:02 | The formula, by the way, looks like this.
And if you've worked with these kinds of
| | 02:07 | formulas before, nothing too unusual about this.
| | 02:09 | But here's where we're headed.
| | 02:11 | What if we could write a formula
here that refers to the East sheet and
| | 02:16 | then gets the data, because the advantage
will be then we can copy this down the column.
| | 02:21 | And imagine how valuable this is going
to be if this is one of those workbooks
| | 02:25 | that has 20 states, 30
states, or maybe all 50 states.
| | 02:30 | We need only to write a
formula once and then copy it.
| | 02:34 | This is where the INDIRECT
function comes into play.
| | 02:36 | What I like to do first is simply take
this formula as we see it here, copy this,
| | 02:42 | and put it into another cell for
reference, just so we can see it.
| | 02:46 | I will just press Ctrl+C to copy it. Escape.
| | 02:49 | I'm going to click here, put
in a space, Ctrl+V to paste,
| | 02:53 | so we'll leave it there.
| | 02:54 | Here is what we are about to do with
the INDIRECT function. =INDIRECT(.
| | 03:01 | What we are trying to construct now is
a formula that will look like what we're
| | 03:06 | seeing here, for the moment, sitting in cell F9.
| | 03:09 | So I'm simply going to click on A9.
Ampersand. A9 will contain the word "east,"
| | 03:16 | so I'm trying to get the word "east" and
what's going to be following the word
| | 03:19 | "east?" Within double quotes, we want the string
that begins with an exclamation point and then G6.
| | 03:26 | We don't have to capitalize it, but
why not? And then right parenthesis here.
| | 03:31 | Now that is a little bit unusual looking.
| | 03:33 | We are trying to say, in effect, let's
take the word "East"--that's A9--followed by
| | 03:39 | an exclamation point and G6, but we
want the indirect reference for that.
| | 03:44 | If we would simply typed that in, it
wouldn't work. And it says I've typed an
| | 03:48 | error, and this frequently happens. And
what'd I forget? The double quote, there we
| | 03:51 | go, right there. Enter.
| | 03:54 | We've got that value.
| | 03:56 | I am going to double-click, copy this
down, and we have the values coming out of
| | 04:00 | the other sheets. And of
course, we check this out.
| | 04:02 | How about Midwest here? 17,930.
| | 04:03 | Let's jump over to Midwest.
| | 04:06 | Sure enough, that's the total.
| | 04:08 | So what we've done here by using the
INDIRECT function--and that's again how it looks--
| | 04:12 | we're picking up the word, the phrase
that's in column A there, the word "East" in
| | 04:18 | this case and combining
with you exclamation point
| | 04:21 | in the cell reference to get that
data from cell G6 on the East sheet, and
| | 04:25 | correspondingly on the other sheets as well.
| | 04:28 | So that's certainly one
powerful use of the INDIRECT function.
| | 04:31 | We don't need this over here anymore.
| | 04:33 | Now, on this other sheet called Indirect-2,
| | 04:37 | we've got potentially a lookup kind of
situation where in column A, we need to pick a state.
| | 04:44 | Here are the states we want to pick from.
| | 04:46 | Now for the moment, this list is right
next to where we have our pick-list over
| | 04:53 | in column A, and eventually, we'll have
one in column B. In setting these up, it
| | 04:57 | makes good sense to put these on the
same worksheet, but eventually, you might
| | 05:01 | want to have these on a separate worksheet.
| | 05:04 | So in column A, we want people to be
able to pick from a list of states.
| | 05:08 | Here is that list, and we're going use
the data validation capability of Excel.
| | 05:13 | I'm going to click the column letter.
Many, many times when I use data validation,
| | 05:18 | it's faster and easy to pick an entire column.
| | 05:22 | You, of course, can
highlight a range if you wish.
| | 05:24 | So we go to the Data tab and choose
Data Validation. And what we want to allow
| | 05:30 | here is--actually, I'll require--is a list.
| | 05:34 | We want people to pick from a list.
| | 05:36 | The source of that list is-- and I'm
going to highlight these cells right here.
| | 05:41 | Click OK. There they are.
| | 05:43 | So what do we have now?
| | 05:44 | In column A, we click the
drop arrow. We choose a state.
| | 05:48 | Maybe it's Colorado. Choose a
state, maybe it's California.
| | 05:51 | But how about column B? What do we want
to do in column B. In effect, we want to
| | 05:55 | say, if the entry here is Colorado,
then we'd like to see just the Colorado
| | 06:00 | cities, these cities right here.
| | 06:03 | If the entry is California, as it
is here, we want to have pop up just
| | 06:08 | the California cities.
| | 06:09 | And so the next step is not so obvious.
| | 06:12 | We need to set up range names for
the cities here. And by highlighting all
| | 06:17 | this at once, I'm taking advantage
of a feature in Excel on the Formulas
| | 06:21 | tab called Create from Selection:
automatically generate names from the selected cells.
| | 06:29 | The names we're talking about are AZ,
CA, CO, et cetera, those state codes.
| | 06:36 | Create from Selection. Create names from
values in the left column, not the top row.
| | 06:43 | So we are creating a series of range names
here, 12 of them, named after the state letters.
| | 06:50 | Once we've done that then we can apply
data validation in column B, in a not so
| | 06:56 | obvious way though. Data Validation here.
| | 07:00 | We choose here List.
| | 07:02 | We want people to see a list. And the
source of that list is going to be the
| | 07:06 | data in column A. But we need to use the
indirect function here, and what we need
| | 07:13 | to refer to here is simply cell A1.
| | 07:15 | Now that might surprise you a little
bit, too. By referring to A1 here--you can
| | 07:20 | either type it or do it this way and
actually we don't want it to be an absolute
| | 07:23 | reference so you press F4 a
few times or simply put in A1.
| | 07:27 | By making this an indirect reference,
we're saying, don't just refer to CO, but
| | 07:33 | refer to the range names represented
by CO and CA and so on. And this will
| | 07:39 | throw you a bit too. It simply means that A1
doesn't work right now because it's got the word "state,"
| | 07:45 | and we don't care about that.
| | 07:46 | By inference, what you wouldn't guess
here, too, is that by saying A1, we actually
| | 07:51 | are referring to all the cells in
column A. And as we use column B, we always
| | 07:57 | look in column A. I know
it's a bit awkward sounding.
| | 08:00 | Do you want to continue. Yes.
| | 08:02 | So what do we have now?
| | 08:03 | A drop arrow here. Click the drop
arrow. What do we see? Just the Colorado
| | 08:09 | cities, because that's what's over in
column A. And sure enough, here you're going
| | 08:13 | to expect to see what?
Just the California cities.
| | 08:17 | There is one slight problem with this,
not a huge one, but we can overcome it.
| | 08:21 | Suppose I pick a state that has only a
few cities in it here, like Iowa, and then
| | 08:26 | I come over here to the list. Oops!
| | 08:29 | But there is a scrollbar, isn't there?
| | 08:31 | We will find these.
| | 08:32 | Now, that's a little bit of an annoyance
and some people don't like it. And the
| | 08:36 | reason this happened is that when we
assigned the range names here, it did
| | 08:41 | include all those empty cells to the right.
| | 08:43 | Well here is quick fix.
| | 08:45 | On the Home tab, Find and Select,
rightmost button, there is strange choice out
| | 08:51 | there called Go To Special.
| | 08:53 | We can select just the blanks here.
| | 08:55 | Click OK and what do we want to do
with those blanks? Get rid of them.
| | 09:00 | Right-click > Delete. Shift cells left. Click OK.
| | 09:06 | Now this is going to work a
little bit better. Click here.
| | 09:10 | It will pick Kansas. There we go.
| | 09:12 | How about the cities there?
| | 09:14 | We see just these. Iowa again, we saw
that earlier. I mean we can name it in a
| | 09:20 | couple of different ways, perhaps it's
double data validation, if you like that
| | 09:24 | idea, but I think you can
see the real power of this.
| | 09:27 | Pickup lists based on other pickup
lists, all based on the idea that we're
| | 09:31 | using an indirect reference here in
our data validation rule right here, an
| | 09:37 | unusual combination of power tools
in Excel using the INDIRECT function.
| | Collapse this transcript |
|
|
ConclusionFinal thoughts| 00:00 | I've enjoyed presenting this course,
and I hope it's been beneficial to you.
| | 00:04 | If you want to know more about Excel
2010, don't forget to check out the
| | 00:08 | web site lynda.com.
| | 00:10 | There you'll find lots of different
courses on Excel 2010, as well as courses on
| | 00:15 | the other versions of Excel.
| | 00:17 | You might check out Excel 2010 Power
Shortcuts, which has a goodly number of tips
| | 00:21 | and shortcuts to increase the efficiency.
| | 00:23 | You will get more power out of Excel this way.
| | 00:26 | You might check out Working with Dates
and Times, and there are certainly other
| | 00:30 | courses as well that might gather your interest.
| | 00:33 | Visit this site often because from
time to time you will see new offerings
| | 00:37 | in this courseware.
| | 00:38 | Thank you for watching.
| | Collapse this transcript |
|
|