Excel 2007: Advanced Formulas and Functions

Excel 2007: Advanced Formulas and Functions

with Dennis Taylor

 


In Excel 2007: Advanced Formulas and Functions, author and trainer Dennis Taylor demystifies some of the most challenging of the 300+ formulas and functions in Excel and shows how to put them to their best use. Dennis starts with a review of the more basic, building-block functions, and a few critical keyboard shortcuts that will speed up working with Excel data, even on multiple sheets. He then covers how to perform advanced searching and data retrieval with Lookup functions, tabulate and sort data with counting and statistical functions, format data with text and math functions, and even work with financial data using advanced formulas. Dennis focuses on practical examples that will help users easily transition to using these formulas and functions in real-world scenarios. Exercise files accompany this course.
Topics include:
  • Referencing, copying, updating, and converting formulas
  • Using the logical functions and creating compound logic tests
  • Searching for and matching data based on specific criteria
  • Formatting cell data using functions
  • Calculating dates, times, and days of the week
  • Analyzing mathematical and financial data

show more

author
Dennis Taylor
subject
Business, Spreadsheets
software
Excel 2007
level
Advanced
duration
5h 17m
released
Nov 25, 2009

Share this course

Ready to join? subscribe


Keep up with news, tips, and latest courses.

submit Course details submit clicked more info

Please wait...

Search the closed captioning text for this course by entering the keyword you’d like to search, or browse the closed captioning text by selecting the chapter name below and choosing the video title you’d like to review.



Introduction
Welcome
00:00(Music playing.)
00:03Hello! I am Dennis Taylor and I am pleased to present Excel 2007 Advanced Formulas and Functions.
00:11If you are like most Excel users, you want to know more about this software.
00:15You used some of the other 300-plus functions, but you realize that you might
00:19be missing something.
00:20Shouldn't there be a better way to do what it is you are doing?
00:24In this course, I'll show you practical examples of some of the advanced formulas
00:28and functions in Excel to make you more confident as you work with your data.
00:33I'll start by giving you some great shortcuts and tips to speed your work in Excel,
00:38then a quick review of the basic functions as a foundation.
00:41I'll show you the powerful If function and a variety of LOOKUP functions,
00:45including VLOOKUP, Match and Index to help you find exactly what you are looking for.
00:51You'll see how to use some vital Math and Financial functions and how to work
00:54with the very useful Date functions to analyze data in a variety of ways.
00:59I'll teach you how to use powerful Array formulas and functions to expand
01:03your analytical powers, and use a few indispensable text functions to
01:07organize your data.
01:09Finally, I'll show you a dazzling technique for creating multi-tiered pick-lists
01:13via the obscure Indirect function.
01:16With this wealth of tips and practical examples, I know you'll be ready to
01:19tackle more Excel challenges in ways you never thought possible.
01:24So let's get started working on Excel 2007 Advanced Formulas and Functions.
Collapse this transcript
Using the exercise files
00:00If you are a premium member of the lynda.com Online Training Library or if you
00:05are watching this tutorial on a DVD-ROM, you have access to the exercise files
00:10used throughout this title.
00:12In the Exercise Files folder, you will see the names of each of the chapters.
00:18Simply double-click on the chapter you're interested in, for example, Chapter 1 Tips.
00:24The worksheet tabs correspond with the names being presented within the chapter.
00:29Occasionally, more than one worksheet will be used at the same time.
00:33In chapter 1, one of the examples does involve use of the East, South, Midwest
00:39and West sheets, as well as a Summary sheet.
00:42In most other examples, a particular movie will be devoted to just one sheet
00:47tab, for example, highlighting formulas is all discussed when the sheet tab is present.
00:52So, the name of each worksheet is the critical aspect to this, and that's going
00:56to be true in all the different chapters.
00:59If you don't have access to the Exercise Files, you can follow along from
01:03scratch or with your own assets.
01:05Let's get started.
Collapse this transcript
1. Formula and Function Tips/Shortcuts
Using the entire row/column references
00:00There are many times in Excel when we need to add up data, either averages
00:04sums, and in this particular worksheet, there are about 700 names and certainly it
00:09would be a reasonable thing to want to know the total amount of salaries being
00:13allocated, and possibly the average of the job ratings that we are seeing, could
00:17imagine doing the average for the number of years as well.
00:20Now do take advantage of the fact that sometimes in Excel you don't even need to
00:24write formulas, and simply by clicking column F, there is some good valuable
00:29information on this screen in the Status Bar, at the bottom of the screen. And
00:34you'll notice here, and if you are trying this yourself you might not see
00:37exactly these same entries, even if you are working with the same data, a total
00:4237,268,000, a minimum and maximum, a count of the numbers, and also an average.
00:50You do have control over this and in Excel, anytime you highlight two or
00:56more cells that contain values you are likely to see some information
01:00within the Status Bar.
01:01Now, if you happen to right-click in the Status Bar, you'll notice that in
01:06this particular section here of the list of choices you do have control over
01:10what's being displayed.
01:12Now, over time, you may have some favorites, and as you think out ahead of time,
01:16you might be saying to yourself, "Well, when I highlight data, it certainly will be
01:19"worthwhile for me to see the average and the sum, but may be not be others."
01:23You'll decide on your own, which of these you would like to see, and of course,
01:27you can change your mind at any time.
01:29So for the moment, I've changed this to show only the average, the minimum, the
01:33maximum and the sum.
01:35And that's true anytime you highlight two or more cells and why not, in this
01:40particular case, select the entire column and also perhaps with Job Rating to see
01:45what the average job rating might be.
01:47Or the average years of service, let's click column E. So I think you can
01:52see the value of this.
01:53Let me also point out there will be times when you are actually trying to
01:56create formulas because you want them in the worksheet at all times.
02:01Now, maybe this is not the best place to put a total, but let's suppose you want
02:05to put a total here of those salaries.
02:08Many of you are familiar with the AutoSum button.
02:11You'll find it on the Formulas tab as well as on the Home tab.
02:16Now, on the Home tab you'll find it way out in the Editing group, on the
02:19right-hand side of the ribbon.
02:21If you click AutoSum, as is usually the case, AutoSum makes a guess on
02:26surrounding data as to what it feels that you might want to add.
02:30In this case, of course, the guess is completely off.
02:32We do want to add up all the salaries.
02:35Now, it certainly isn't wrong to start highlighting the cells this way and if
02:39we only wanted to do these for a certain department, you could imagine doing
02:42this sort of thing.
02:44But let's say that you know this data well enough to know there is nothing else
02:48in column F except values and the title on top.
02:52So why not just click the entire column letter.
02:54Now that works beautifully, there is the entire function, add up everything in
02:59column F, and we're done, Enter, and there is the total.
03:04And you can certainly do that with rows where the situation calls for it.
03:07Now it's going to be much less likely that you are going to need that, but if
03:10we wanted to do a total, imagine this on another worksheet with the appropriate data -
03:15maybe we'll just click AutoSum again - and imagine if the data were valid, we can
03:20click row 7 and that would add up all the data in row 7.
03:24In this case, obviously, it's a case of apples and oranges.
03:26We wouldn't be adding that data, but that's how the function would work and it
03:30would work properly, given the appropriate set of data.
03:34Not only can you use the Sum function, but any other function that might be
03:37appropriate for your needs.
03:38So if you'd like to do an average for each column, or possibly a sum, or a standard
03:43deviation, or median, or any other function that you might need to use, you can
03:47use an entire column reference, and keep that in mind as you work with functions,
03:51maybe, that you haven't worked with very frequently.
03:53It's a quick way to get good summary information without going through the drudgery
03:58of highlighting cells manually.
Collapse this transcript
Copying column formulas instantly
00:00If you need to copy either text, or values, or a formula down a column, here is a
00:06shortcut you can't really do without, particularly if you work with formulas.
00:10In cell H2, let's actually create a formula for a person's new salary, existing
00:17salaries in column F, and in cell J1 is a percentage of increase that's going to be
00:22applied to everybody's salary here.
00:25So the initial formula, which could vary, could be something like this = F2, click
00:31on it, type it, times J1 and looking ahead here, you can see that if this
00:37formula is going to be copied down column H, the F2 will become F3, F4 etcetera,
00:43that's appropriate, but J1 would turn into J2, J3.
00:47So we need to make this an absolute reference. And rather than typing the
00:50dollar sign, which is okay,
00:51the fastest way to do this is simply to hit the Function key, F4, to make that
00:56an absolute reference.
00:57And to complete the formula in this particular style of a formula, let's simply
01:01add on, or add to it, the original salary.
01:05So that's one of a few different ways we could write this formula.
01:08And a small tip here.
01:09If you are about to copy information down a column, rather than hitting Enter
01:14and have the active cell move away from this location, simply press Ctrl+Enter
01:18and the active cell will not move from its location.
01:22Now, there are about 700 entries in this particular list, and copy/paste is not
01:27the way to go here, and if you have been working with formulas you probably don't
01:30do that, but very often, you're likely to drag, from that lower right-hand corner,
01:36it's called the Fill Handle,
01:37drag this down the column, and that's really not wrong.
01:40But think of how much time that's going to take if you've got not just 700
01:44entries, but maybe 7000, 70,000.
01:47On Excel 2007, this could be as many as a million, slightly even over a million rows.
01:52So dragging could be, if you pardon the pun, a real drag. Instead, let's double-click the
01:59lower right-hand corner.
02:01Now, right away the question would come into your mind, "Did it get copied all
02:04"the way down to the bottom of the list, or how far did it get copied?"
02:08Anytime you highlight a range of cells, either manually or by way of a formula,
02:13if you hit the Ctrl+Period sequence a few times, Ctrl+Period, this simply moves
02:19the active cell around the corners of the selected range.
02:23So, in this case, it's simply moving from cell H2 down to H709.
02:27I am just hitting Ctrl+Period here, and that's a good verifier, and if you know
02:32your data, you would know that there is nothing below that row in this
02:36particular set of data.
02:37That's Ctrl+Period.
02:39But the shortcut, of course, is the idea that by double-clicking we copy whatever is
02:43in this cell, whether it's text, a value, or a formula, rapidly down the column, and it
02:49is dependent upon what is visible in the first column to the left.
02:54Now, notice I used the word visible.
02:56Let me do an undo here. I'll use the Undo button in the Quick Access toolbar,
03:02and now we'll remove one of the job ratings
03:04so let's act as if maybe it hadn't been completed yet, and there might be some other
03:08empty cells, as well, in column G.
03:11This time, as I double-click here, note that the information only gets copied to here.
03:17If you knew that column G had multiple blank cells scattered throughout the list,
03:24this would be unfortunate and it would take you a long time to fill in the
03:27information if you were using the double-click method.
03:30So if that were the case, let me do another Undo here,
03:34if you knew the column G had a number of blanks in it, then you would hide column
03:38G, right-click and Hide, and the next time you try this it will follow the first
03:44visible column to the left.
03:46And in this case, all of the salaries have been completed, so by double-clicking
03:49here and then hitting Ctrl+Period for that quick check,
03:53it too gets copied down to row 709 here. We're all set.
03:57That works properly.
03:59The other question might be, "What happens if the column to the left is empty,
04:02"that first visible column?"
04:04Let me do a couple of Undos and create that situation,
04:07this time on purpose. I'm going to insert a new column to the left column H
04:12that's empty. Double-clicking here, nothing happens.
04:16But, if there is information in the column to the right, and I'll just quickly
04:20throw on some information here, hit Ctrl+Enter.
04:23Now we'll try double-clicking. Look what happens.
04:27When the column to the left is empty, at least in these cells, double-clicking the
04:32lower right-hand corner follows the first visible column to the right,
04:36if there is data there, and then copies the information until it sees an empty cell there.
04:41So, by using this particular shortcut you can see how, whether it's text, or
04:46values, or on the cases we have seen formulas, it's a very efficient and fast way
04:51to copy information down a column without much effort.
Collapse this transcript
Converting formulas to values with a simple drag
00:00After creating formulas, there will be times when you effectively don't want to
00:04keep the formula in a cell.
00:05You want to keep the actual result.
00:08Now, having many, many formulas in a particular range, or in a worksheet,
00:12sometimes does take up not only more space but also requires some time because
00:16of recalculation every time we make worksheet changes.
00:19So let's imagine the example here in column H, about 600 names or so.
00:24And we've got formulas calculating New Salary.
00:27Perhaps you've reached that time when you want to say that you'd like to have
00:31these salaries replace the ones that are the origin over in column F. You may, on
00:37the other hand, want to keep these new salaries here, perhaps re-label the column
00:41headings, but there are times when you would be saying, like here, "Let's not have
00:45"these formulas here.
00:46"Let's just keep the results."
00:48The standard way to handle this is a somewhat cumbersome technique of copying
00:53these values and then using Paste special values and so on.
00:57Let's make this really fast.
00:59Now, two different approaches here. If we want this data here to replace the data
01:04in column F, we, effectively, would select these values.
01:08So how can you do that somewhat quickly?
01:10By simply clicking on the top cell, hold down the Shift key and double-click the
01:15bottom edge. Now that highlights the entire set of data.
01:20If you hit Ctrl+Period, this will move the active cell to the top of the range.
01:26I can see what's happening there, they've all been selected.
01:28You can certainly do that by dragging as well and it will stop when you use this
01:32technique once you get to the bottom of the column.
01:36Rather than going through the multi- step copy, paste special, with the right
01:40mouse button, drag this information on top of the old data.
01:45That's over in column F.
01:46With the right mouse button, drag any edge.
01:49As soon as we get to the destination, you can let go and Copy Here as Values Only.
01:56Keep an eye on, say, the top salary, the 59,246.
01:58We are now about to see that over in cell F2. It is in H2.
02:04It's going to move over into F2.
02:09Now, meanwhile, we've got some new salaries here, they're irrelevant, but
02:12here is the value that had been displayed in H2. It was actually a formula and now it's
02:17over here as a value.
02:19So, in effect, we took those new salaries and replaced the old salaries right here.
02:24This information we wouldn't need anymore, perhaps get rid of the entire column if
02:28that seems appropriate, but, again, this information right here is not relevant,
02:32but we quickly were able to copy this information over here and throw away the
02:36formulas at the same time.
02:38Now there is a similar situation.
02:39You might use this over in column N. You see order dates and shipping dates and
02:45simple formulas here, subtracting the two to figure out the time elapsed.
02:50Perhaps it is at the time when you say you no longer need the formulas here.
02:55A lot of these you could have done in your head anyway, but there are formulas. We
02:57simply want to turn these into their values.
03:00Now, in this situation, we don't really want to put them into another column.
03:04We want them to stay right here, and so it might seem a little bit strange but
03:08what you'd want to do here is essentially drag this information into another
03:13location and then right back on top of the current data.
03:16It might be faster here to drag the top edge, but it can be any edge, and once
03:22again, with the right mouse button.
03:23Remember, every cell here that's highlighted is a formula.
03:27It subtracts the two dates from the left.
03:30So by highlighting the data and dragging any edge with the right mouse button
03:34away from the data, I'm going up here and then back down on top of it, let go
03:39with the mouse, Copy Here as Values Only.
03:43This is not a formula anymore.
03:44It's the value 2 and the value 4, and you can verify that by seeing this in the Formula bar.
03:50So there are numerous situations when you have copied information, you've
03:54cleaned up information, you've got formulas and in effect, you want to say, "I
03:59"don't want these formulas anymore.
04:00"I just want to keep the results."
04:02So the techniques we've seen here allow us to do this quickly and easily.
04:06I want to show you one more variation on this.
04:08You can do this with the toolbar as well.
04:11So let me do an Undo, and this isn't quite as fast as the dragging method, but
04:15it has its merits as well.
04:17With the data highlighted here and these being formulas again, on the Home tab,
04:23you can click the Copy button and then jump over to the Paste arrow and choose
04:28Formulas, and that's pretty fast too.
04:31And to get rid of those Marquee lights simply hit Escape.
04:34Different methods of quickly turning formulas into values.
Collapse this transcript
Creating 3D formulas to gather data from multiple sheets
00:00On your screen, you're seeing sales totals for an Eastern region.
00:05I'm going to switch to the next worksheet to the right to display a similar
00:09worksheet that's showing sales totals for the South region, and then the next
00:13sheet over in Midwest.
00:15Each of these worksheets has the exact same layout, and there's a West sheet as well.
00:21You'll recognize there are formulas in Row 8, in all cases here, and in Row 9,
00:27and in Column G we've got totals as well, and in Column H.
00:34Each worksheet has exactly the same layout.
00:37And also created here is a Summary sheet, and it too has formulas in place, but
00:42there's no information here.
00:44So that's why these look a little bit strange.
00:46The division by 0, it's trying to simply perform a calculation that for the
00:50moment is inappropriate.
00:52But this particular worksheet is an exact copy of the others, with no data here.
00:57Now, you could imagine a similar situation dealing with data where you might
01:01have 12 separate sheets, data for each month.
01:05You might have different fiscal year data, five, six years potentially.
01:09You could have information from the 50 states,
01:12any number of different scenarios where it is appropriate to have the same
01:16layout worksheet after worksheet after worksheet.
01:20And sure enough, on a Summary sheet what we would like to be able to see here
01:23is a total, in all of these cells, that shows the information from the four other sheets.
01:29A standard way to do this, and not an incorrect way, would simply be to position
01:33the active cell on the Summary sheet and write a formula, and you'll notice in
01:37this formula there will be practically no typing, except for the initial equals
01:42and some occasional pluses.
01:44So we are on the Summary sheet here.
01:46I just clicked equals.
01:48Now let's jump to the East sheet, click there, and we are about to show you the
01:53Disk Drive Retail total there.
01:55Click on the East sheet, click this cell, and put in a plus.
02:00And now we will go to the South sheet, click on the appropriate cell again.
02:04It's B4, put in a plus.
02:06The formula is building in the formula bar.
02:08We will click on Midwest, click that cell, click plus.
02:13And then West, click the cell in question, we are all done. Enter.
02:18I am going to make the column wider so we can see this.
02:22And I think you could agree, the information is accurate. It's correct.
02:27We could go back and look at the numbers. It is correct.
02:30But the formula is a little bit dismaying in the sense that, although valuable,
02:33what might we do if it were 12 months, or if it's 50 states.
02:37This is a lot of jumping back and forth.
02:39You will notice that range names are automatically followed by
02:42exclamation points.
02:43If you find yourself typing range names, you're probably going down the wrong path.
02:48Stop, and go click on them instead.
02:50Who wants to type when you can use this method?
02:53And one other bit of note here too.
02:55If a range name has a space in it, you will also see single quotes here.
02:59That's not the case here, so we wouldn't worry about it.
03:02So this could be just fine, if you don't mind clicking back and forth to create this.
03:06We could then copy this into the other cells.
03:08That's not a huge amount of work.
03:10But we do want to show you a faster way to do this, when you're dealing
03:13with multiple sheets.
03:15Again, imagine that 50 state scenario here.
03:18So instead of this, let's approach this in a different way.
03:21On the Home tab, in the Editing group, let's begin with the AutoSum button.
03:26Simply click it once, and this is one of those rare times where the Sum function
03:30can't see any data around, there is nothing to guess at, so it simply saves us a
03:34little bit of typing here.
03:36Now, the next two steps are the crucial ones, and not the obvious ones.
03:41Let's say we want to add up all the data on the sheets East through West.
03:45We have got four sheets here.
03:46Remember, there could be many, many sheets.
03:49The first thing to do here is to click on the East sheet, and it shows us the East sheet.
03:54And the unusual step here, hold down the Shift key as you click the West sheet,
04:02and that essentially picks up all the intervening sheets.
04:05In this case, only two, but there could be many.
04:07And in the formula bar, you will see how the formula is being constructed.
04:11What it lacks is a reference to the specific cell.
04:14In this case, it's going to be B4.
04:17Click there, and you will notice a strange change here as we complete the entry.
04:22Right now you see single quotes.
04:24Don't worry about them.
04:25As soon as we hit Enter here, the formula is complete.
04:28Same answers we saw before, but this is what it looks like.
04:33And imagine that scenario. If these were the 50 states, if they had been
04:36alphabetized, that might say Alabama:Wyoming, something like that.
04:40If it's 12 months, it's likely to say January:December, and so on.
04:44Try that a few times and you realize how fast it is.
04:47This only works in situations where you have got identical layouts in your worksheets.
04:52So the situation here, we are always looking for cell B4 here.
04:55Now, once that is done, we can double- click or simply drag this down two cells,
05:00drag it across, and readjust that column width, and we are all set.
05:06This truly is a Summary worksheet.
05:09Now, every one of these formulas, let's just pick one at random.
05:12We can double-click and see the formula there.
05:14They all operate along the same principles.
05:17If you move any sheet that happens to be between East and West, if you move them
05:21within those confines, nothing changes here.
05:25If, for example, if we were to take out the South sheet here, our totals would
05:29drop, but it wouldn't disrupt any of these formulas.
05:33If we were to create a new mountain region here and had it somewhere between
05:36East and West, the formulas would not need to be recreated.
05:41The information would automatically be included.
05:43So you have got the same kind of flexibility that you might have with a Sum
05:46function that adds up data in a column.
05:49When you insert rows between the top and bottom, they are automatically
05:52included, and if you delete them, that data gets removed.
05:55So a similar kind of layout situation.
05:57But this 3D formula, there is no question about it.
06:00It's extremely powerful, and the more worksheets you have, the more powerful it is.
Collapse this transcript
Updating values without formulas
00:00Changing worksheet values is often an arduous task.
00:03Sometimes it's simply a lot of drudgery of data entry.
00:07At other times, you have to write formulas and copy and paste, and it's not
00:10always a lot of fun.
00:12Sometimes though, you have got information that needs to be updated, and you can
00:15do it without formulas.
00:17Take a look at the list here of values for the first six months, for various
00:22states, and let's imagine that these particular values that were entered here
00:27maybe were done manually.
00:29Whoever came up with these values made a mistake in the calculations, and
00:33these are all off by 5.
00:34So we would like to bump them up by 5.
00:37Possibly, in another situation, they need to be decreased by a certain value.
00:42But let's say we want to do the same thing to every one of these cells, in
00:46this cluster, right here.
00:48So ,suppose it is that we want to make them all bigger by 5.
00:52In an empty cell, somewhere nearby, put in the value 5.
00:55We can later get rid of it.
00:57Simply copy it, Ctrl+C, right-click copy, all the different ways that you might copy.
01:02Highlight the data in question, right-click, Paste Special, and Add.
01:10Now, keep an eye on at least one or two of the numbers, just to see that it will have changed.
01:15Click OK.
01:16And the numbers are larger by 5, every single one of them.
01:20And you will notice that none of these have any formulas in them.
01:23Some people would be worried about this feature, because there is no, as we say,
01:27paper trail here, no formulas to remind us what these might have been.
01:31We simply changed all the values here by 5.
01:36Now, let's not confine this just to addition.
01:39Certainly that could have been subtraction, as I suggested.
01:43How about this list on the right, maybe in a different context, even though it's
01:46similar kinds of data?
01:47What if this represents current year data, and you have copied it and pasted
01:52it somewhere else, and you would like to show these new values at a level 10% bigger?
01:57Now, there will be decimals, and we will deal with that.
02:00So a little bit of math in your head will suggest that the 40s here will become
02:0344s, the 50s will become 55s, and the other ones will involve some decimals, but
02:09again, the need is we want these all to be 10% bigger.
02:13Now, depending upon the percent, you'll do the math in your head.
02:17A lot of you would know that to make these 10% bigger, we can multiply them by 1.1.
02:22So once again in an empty cell somewhere, anywhere we choose, put in 1.1. Copy that value.
02:31Highlight the cells that we want to change. Right-click.
02:36Paste Special.
02:37This time, it's going to be Multiply, and let's speed it up a little bit.
02:40Double-click Multiply.
02:43And those cells that had been 40s, right here, are 44s, the 50 became a 55, and so on.
02:50And to see the true values here, we would highlight these, and on the Home tab,
02:55in the Number group, perhaps a quick way to do this would be to click the Number
02:59indicator, the comma, and probably decrease the decimals at least once.
03:04So now we have new values pretty quickly.
03:06No formulas in sight.
03:08We don't know what the old values are, unless we wrote them down or copied them,
03:11but it certainly doesn't take very long to do this.
03:13I think you can imagine too that even with many, many cells, of course, this
03:18would happen just as quickly.
03:20A different situation could be you have got a huge list of salaries.
03:24So the company is going to give everybody a $500 bonus for the holidays, or whatever.
03:28You can imagine adding 500 to all those salaries very quickly, using this technique.
Collapse this transcript
Showing all formulas with a single command
00:00Sometime when you are confronted with a new worksheet or a worksheet you haven't
00:04seen, maybe never, or it's been a long time, you are concerned sometimes with
00:09understanding the scope of a worksheet, trying to figure out what's going on.
00:13And one of the things that would be really useful would be to see the actual
00:17formulas instead of the formula results.
00:20Now, you would like to be able to do that on a cell-by-cell basis, but Excel
00:24does have a great feature where you can convert all formulas to actually display
00:30them rather than the results.
00:32Now, for example, if I happen to click on a cell here, a very simple formula
00:37here in cell B10, you can see it in the formula bar.
00:40But I might want to see other formulas at the same time, and rather than going
00:45to each cell and temporarily turning it into text, which would be really time
00:49consuming, there is a nice fast way to do this, and there is a great keystroke
00:54shortcut for it, but you are unlikely to know the keystroke shortcut.
00:58It's kind of buried.
00:59And you will notice and see one or two characters, and they are usually together
01:04on the same key on your keyboard.
01:07Usually this key is above the Tab key, to the left of the number 1 key and
01:12below the Escape key.
01:14If you hold down Ctrl and hit that key, the symbol on top is usually called tilde.
01:19It's the character that we often see above the letter N in certain Spanish words.
01:24The other character is sort of a little apostrophe looking character is
01:28sometimes referred to as accent grave, as is used in certain French
01:31letters, usually over e.
01:33The point is hold down Ctrl and hit that key, and the worksheet will change
01:38substantially in appearance.
01:40The most obvious difference is the column widths have all been doubled, but
01:45wherever there were formulas, you see the actual formula instead of the result.
01:49So a quick look at cell B7 here shows the formula, but not the answer.
01:55Now fortunately, this control, whatever we want to call it, maybe call it Ctrl+Tilde,
01:59maybe you call it Ctrl+Accent.
02:01Don't use the Shift key.
02:03In any case, when you use the same combination again, it toggles back to
02:07the regular display.
02:09So think of it as a toggle button, a toggle switch.
02:12Anytime you hit Ctrl with this other character, you either double the width of
02:16all columns and expose formulas, or you return to the normal view.
02:21And when it is in this view, note also that other cells with values have the
02:26values automatically left aligned, as is the text entries.
02:30So it looks a little bit different, but it certainly does no damage, and better
02:34yet, it certainly is of value to see those formulas.
02:38Here is something else you might consider doing when you're viewing the
02:41information like this.
02:42I had mentioned that the columns are twice as wide.
02:45Now, here and there that's handy and helpful, as it might be in Column B, but
02:50in Column A it's not.
02:52What you might want to consider doing here is actually printing this.
02:55So if you go to Ctrl+F2, that's a quick way for Print Preview.
02:58Ctrl+F2, that may or may not be what you want to see.
03:02I am going to click on this to zoom in, but if you were looking at this and
03:06wanted to print it, don't overlook the Page Setup option that allows you, on the
03:11Sheet tab, to show gridlines, as well as row and column headings.
03:16Now, those are often not checked and so you don't typically see them.
03:20But you can see in the background here how even though that's not super clear,
03:24we are not trying to read it, but the columns are twice as wide, and we see
03:28formulas wherever they appear, just as we're viewing it on the screen.
03:32What you might do to make this a little bit better, click in the upper left
03:36corner, double-click one of the boundaries between column letters, readjust
03:41those column widths again, and then again, take a look at your Print
03:44Preview with Ctrl+F2.
03:46You will decide, based on other formulas, whether that's appropriate or not, but
03:50it could serve as a source of documentation.
03:53The main point, however, is by choosing this option of simply hitting Ctrl with
03:59that other key, you can quickly switch modes.
04:01Now, I had readjusted the column widths, so we would want to do this again when
04:05it's back in normal view again, probably.
04:07Click there, double-click here.
04:11You can also get to this feature in the ribbon if you click the Formulas tab,
04:17and in the Formula Auditing group you will see Show Formulas.
04:21And as you have noted in Excel 2007, if you linger over this feature here, the
04:26command Show Formulas, you will see that same keystroke shortcut.
04:30Notice how easy it would be to look at that and just sort of read through it and
04:33not have it registered for you.
04:35You can barely see that little symbol out there under Show Formulas, but
04:39that's the same feature.
04:40I think it's handier with the keystroke shortcut, but you do have it here as well.
04:44It certainly is going to give you that handle on a worksheet to figure out
04:48what's going on, to expose those formulas.
Collapse this transcript
Highlighting formulas with two clicks
00:00A valuable feature in allowing you to highlight a worksheet to indicate where
00:05formulas are, where constants are, is certainly valuable and easy to get to in Excel 2007.
00:13This worksheet has a lot of formulas in it.
00:15It has got a lot of pure values as well.
00:17If we would like to select the cells that have formulas, not really see them,
00:21but just select them and then possibly add a color,
00:24that would be valuable, and of course, the feature is here.
00:27On the Home tab of the ribbon, the extreme rightmost group is referred to as the
00:32Editing group, and the very last button typically is Find & Select.
00:36Now, with the active cell anywhere in your worksheet, but only on a single cell,
00:41click this button, Find & Select, and then click Formulas.
00:46All cells that have formulas are currently highlighted.
00:49Now, you can certainly look at that and in some cases you will remember the ones
00:53that are highlighted, but certainly, in this case, you wouldn't.
00:56What you really would want to do next here would be to add a color to
01:00these, just to flag them.
01:01Now, it wouldn't necessarily be a color.
01:03You can make them be bold or italic or give them borders, but the most
01:07obvious difference we could make to these, while they are selected, is to
01:10change their color.
01:12And as fast as any way to do this would be on the Home tab, in the Font group,
01:17the button for Fill Color, click the drop arrow, pick a color, and as you slide
01:22across these, you can review them.
01:24Lighter colors typically do work better. There we go.
01:27So, in this case, it's an orange color, and until we add new formulas, this
01:33is totally accurate.
01:35All these cells that have this color, have formulas in them.
01:38We didn't change their content in anyway.
01:40We just know at a glance.
01:42When you're doing worksheet troubleshooting, you're trying to figure out what's
01:45going on, this is helpful.
01:48If I were to erase one of these cells with formulas, here is one that's coming
01:51out to be a 0 anyway, but if I delete this, the color stays, and if we were to
01:57do the reverse, if we add a formula somewhere, it will not turn this color.
02:02In other words, we do have to run this feature again to make it truly be up-to-date.
02:06Now, a companion to this could be equally valuable, or more so.
02:10And that's the idea of saying that you would like to highlight all the cells in
02:14this worksheet that just have pure values in them, and maybe to make it a little
02:19bit tighter, just pure numbers, not text.
02:23Here it takes a few more steps, and once again, click on a single cell.
02:27If you do happen to have three or four cells highlighted when you attempt
02:31to highlight either formulas or constants, it only looks within the highlighted range.
02:37By clicking on a single cell, even though it's not obvious, it implies
02:41the entire worksheet.
02:43This time, we are looking to highlight the cells that have constants.
02:48Once again, on the Home tab, in the Editing group, we want to choose Find & Select.
02:53This time, we want to click on, and it wouldn't be an obvious choice unless you
02:58had explored these options, Go To Special.
03:02And this dialog box, which was present in prior versions of Excel, gives us lots
03:07of different choices.
03:09At first glance, it might throw you a little bit, if you clicked the Constants
03:13button, you'll notice that the checkboxes under Formulas are also available.
03:19You might have thought that those boxes are related only to formulas. They're
03:22also related to constants.
03:24Now, if we simply click OK here, all cells that have any data but are not
03:30formulas would be automatically highlighted here.
03:33What we would want to do here would be to uncheck the boxes for Text, Logicals,
03:40and Errors, leaving only Numbers highlighted.
03:43Click OK, and now all the cells that have pure values are highlighted.
03:49And here too, if we wanted to make a note of this, for a while, we might use that
03:53same fill color bucket that we just used for formulas, and this time pick a
03:58different color and make these, say, green.
04:02So based on this coloring scheme, and it's accurate at the moment, like a
04:05snapshot in time, the green cells have constant values in them, the orange
04:12cells have formulas.
04:14So these two techniques, in particular the one for highlighting formulas, can be
04:18really valuable in scoping out a worksheet and helping you figure out what's going on a bit faster.
Collapse this transcript
Simplifying debugging formulas
00:00Occasionally, in Excel, you've got long formulas and they're not always giving you
00:04the answers that you're expecting.
00:06So there are two quick techniques for helping you debug formulas.
00:10There are others as well, but here are two short ones.
00:13In cell F2 is a formula involving not too many other cells, but imagine if it's
00:18not quite coming up with the answer that you expected.
00:21You think something is wrong.
00:21It doesn't read quite right, not sure.
00:25When you edit a formula, and you can do that by double-clicking in the cell or
00:29clicking in the Formula bar,
00:30I'm going to double click in cell F2, what you can do is highlight portions of
00:36the formula to see what that portion evaluates to.
00:39For example, if we were to highlight just these cells here, and we wonder,
00:45"What does that equal to?" right now, on the spot?
00:48Highlight some data and hit the F9 key.
00:51That shows us the value of that.
00:54Now, that might or might not have been revealing, in this case.
00:57Maybe if we highlight that and the portion of the formula to the left of it, E17
01:03times that, and we see this.
01:07That still might or might not have helped.
01:09So you will have to try this with different components of a formula.
01:13Now, you want to be careful when you're doing this, as soon as that light bulb
01:17goes on that says "Oh yeah, now I've got it figured out,"
01:19don't hit Enter here.
01:20Hit Escape, because sometimes you're not really trying to change the formula.
01:26You want to give it some thought, maybe.
01:28Perhaps it is the wrong cell, or maybe you've got these in the wrong order somehow.
01:33When you're doing this, you might get a strange message if what you're
01:35highlighting, by itself, doesn't make for a coherent formula.
01:40For example, if I were to highlight these cells here, and you're seeing why that
01:45obviously is not a correct formula by itself.
01:48Hitting F9 here, that goes off into a little tangent to tell us something else
01:53that really isn't appropriate.
01:54So I will just click OK, get out of there, and consider this again.
01:58You certainly can highlight areas that include parentheses.
02:02Maybe this whole part of the formula is something, maybe, you suspect is a bit off.
02:06You might highlight that, hit F9.
02:09Once again, does that help, does it not?
02:11Maybe include this part of it as well.
02:14You also run the risk, occasionally, when you do this, of highlighting cells
02:18where the formula might not be exactly the same order that Excel is
02:21calculating them in.
02:22So occasionally, when you do this, it can be misleading.
02:26But keep in mind the idea that you're just questioning this.
02:29If you happen to hit Enter, then do a quick Undo, if you really didn't want to
02:33change it into its values.
02:35Normally, though, we just hit Escape.
02:37Now, another shortcut that, by itself, doesn't really debug a formula, but it's
02:42going to give you some help.
02:44In cell G16 here is a really, really long formula.
02:49And this discussion is not really about the If function, and so that's not
02:52really relevant here, but this is one of those ridiculously long formulas that
02:57you will see sometimes, and I'm not saying that it's wrong or right.
03:00In fact, maybe I shouldn't even have said it's ridiculous, but it's pretty long.
03:04And here's what you can do, sometimes, that will be really helpful.
03:08This function, like we say, it's quite long, and while editing it, either in
03:13the Formula Bar, or if you have double-clicked in the cell, as I have, you can try the following.
03:18In front of the second IF, I'm going to click right here, and use Alt+Enter.
03:22Now, Alt+Enter simply introduces a line break.
03:25I'm going to do this in front of the next IF, and that's an arbitrary choice.
03:30You can put it wherever you want, but I think this would be a logical place.
03:33Alt+Enter, click in front of the next IF, hit Alt+Enter, and in front of this
03:38one, and maybe even the first one.
03:41Now, I would never make the claim that you instantly understand everything
03:45now, but this certainly structures the formula in a much more coherent way,
03:50and, of course, you would need to know something about the If function and the And function.
03:55But the way this displays now, it's much more coherent.
03:59You've got a much better chance of figuring out how it might be working or not working.
04:03And here too, as another example, you can highlight portions of this, click F9.
04:08That will tell you, in logical constructions, whether this is true or false.
04:14And that helps also in deciphering the formula and trying to figure out what's going on.
04:19But this is a Nested If, and sometimes these are quite long, and if you didn't
04:23write it or if you wrote it a long time ago, you need something like this to
04:28really give you a handle on it and help you figure out what's going on.
04:31Eventually here, I might either hit Escape or get out of here.
04:34And maybe I didn't quite finish that the right way, so I would do it again.
04:37But the point is by doing this you are not really changing the result, unless, of
04:43course, you hit F9 and hit Enter.
04:46But by using this capability here, of using Alt+Enter that is, you can
04:51structure this differently.
04:53Now, hitting Enter here does not change the formula in any way, other than its display.
04:58If you happen to come back here again, one downside of this, look in the
05:02Formula Bar right now.
05:03You don't see this.
05:04You don't see all of it because the equal sign is by itself.
05:08Double-clicking lets you see it here, but how are you going to know that otherwise?
05:13You don't always foresee that, unless perhaps you were the one who has done this.
05:17But here is something else you can do.
05:18You can make the Formula Bar taller, just slide onto its bottom edge up there and do that.
05:24So that's going to help.
05:25You've got more room to edit without having it overhanging to the worksheet area.
05:30So two techniques for helping you figure out what works in a formula and what doesn't work.
Collapse this transcript
Creating range names to enhance readability
00:00To make certain kinds of formulas clearer in what they're doing, and to provide
00:05some good worksheet documentation, giving a cell, or a range of cells, a range
00:10name, makes good sense.
00:12This formula, in cell C2 here, is calculating a new salary for the first person here.
00:18There is a reference to cell D1, and it's an absolute reference, so that if this
00:23gets copied down the column, it will constantly refer to cell D1.
00:27If we see words here, instead of an address, it could be a lot clearer.
00:33So what might make sense here is to give a name to cell D1 and then use it in the formula.
00:39There are a number of different ways to name a cell, but many times, a fast way
00:43is simply to click on a cell, and this could, in some cases, be a range of cells,
00:47in this case, one cell.
00:49Click a cell, and then, in the Name box, which is located to the left of the
00:53Formula Bar, if you just slide over there it will say Name Box, click the drop arrow.
01:00If there are other range names in this workbook, you will see them here.
01:04A range name cannot begin with a number.
01:07It cannot have spaces.
01:09You might want to use an underscore to simulate the look of words.
01:12You can use upper and lowercase freely.
01:15So a name for this cell might be something like percent increase or pay increase
01:19percentage, something like that.
01:21You probably don't want it too long.
01:22I am going to use Percentincrease, Enter.
01:28Once the name is there it then can be used in a formula, and so in this formula
01:33here I'm simply going to double- click and plug it in right here.
01:37Now, it's not that much typing, I could certainly type it.
01:41Another option could be to hit the F3 key and all range names will be exposed in the box.
01:46We could click on that, and click OK.
01:48That would put it into place.
01:50And the third way, if the cell is nearby, as it is here, if we simply click on
01:55the cell that has the name, or cells, in some cases, the name pops into place and
02:01we can complete this, and then double- click to copy this down the column, and
02:05every single reference here refers to the range name.
02:07Now, that's a lot more descriptive than $D $1.
02:12But on the other hand, and this is certainly a downside that you will see
02:15sometimes with range names,
02:17the first time you see this you might not be sure what it means, if you were not
02:21the one who has written or created the name, or maybe it has been a long time
02:25since you did create it.
02:26If you are not always sure where that is, at any time you can click this
02:30Name Box arrow, and then click on the Name in question, and it will then
02:36take you there, so to speak.
02:37It makes that become the active cell.
02:39Now, a secondary use of range names would be in any worksheet at any time.
02:45For example, maybe you're at a different part of a worksheet here and you say,
02:48"I want to get to that location," you can click that box, click the name in
02:53question, and it takes you there.
02:55So think of it potentially as a go-to vehicle.
02:58That's not its main purpose.
03:00Now, one clear downside of range names that I didn't mention.
03:03I am remembering a situation of a year or two ago when someone had sent me a
03:08file, and I began to see some range names, and then I did click that Name Box
03:13arrow, and there were a ton of range names there.
03:16It got really annoying.
03:18Every time I went to a different kind of formula, I would see a different range
03:22name, so I had to constantly go back and forth, back and forth, and figure out
03:26where they are were and what they meant.
03:28Now, you can, in Excel 2007, on the Formulas tab, click the Name Manager button
03:34here, and you will - of course, here there's only one of them, but you could get
03:38the list right here and see them all.
03:40That's certainly of value.
03:42But when there are many, many of them, it's going to take you a while to absorb
03:45the meaning of the names, even when they're coherent.
03:48Another situation for the data we see here in Columns F through M is that
03:53sometimes you can use adjacent labels to name cells.
03:57If we were to highlight this data right here, and then use the Create
04:03from Selection option.
04:05This is in the Define Name's group that's on the Formulas tab in the ribbon.
04:10Create from Selection.
04:12We see this option.
04:13Now, we don't necessarily need to use top row and left column both, but if it
04:18does see text, it gives us the options, and suppose we do, in this case.
04:22You don't need to use both of these. Click OK.
04:25By doing this, what we are about to say is that January, for example, is now a
04:30range name that refers to cells G2 through M2.
04:35That's the 365, the 557, and so on, all the way over to 241, and also, TX as an
04:43example, Texas, refers to all the cells from H2 down to cells H13.
04:49So we are talking about the 557, the 786, and so on, reading downward into the 2095.
04:57We have just created a lot of range names, and now, anywhere in this workbook,
05:02or in any formula that's linked to this workbook, we could be using formulas here and there.
05:07For example, someone wants to know the average.
05:09Now, this is going to be a little bit more powerful if it's in a nonadjacent
05:12location, maybe on another sheet or a different part of this worksheet, but if
05:17we wanted to know the average Texas values here, we could just type in TX.
05:19It doesn't have to be capitalized, forget the right parenthesis, just hit Enter,
05:24and there is that average right there.
05:27We could quickly verify this by highlighting these cells here and then looking
05:32in our Status bar, where it says the average is 1010.
05:34Well, that's the rounded version of what we are seeing right here.
05:38So that's a good on screen verifier.
05:40So at different times we can use these labels here in formulas, and in all cases
05:47they will mean respectively,
05:48for example, that's what Ohio means, or OH means as we use it in formulas and
05:53functions, and this is what April means as we use it as well, and we can use
05:58that throughout the workbook or in any formula that's linked to this workbook.
06:03So I think you can see here, pretty clearly, that range names certainly have their
06:06place, and we have a nice quick method of creating them, in cases like the grid
06:11we see here, and in the previous example, a way to make certain formulas more
06:16understandable or more readable at a quick glance.
Collapse this transcript
2. Excel Functions
Understanding and using basic Excel functions
00:00One of the first things most of us learn as we learn Excel is how to write formulas.
00:06And let's face it.
00:07For many of us, that's the focus of our use of Excel.
00:10And shortly thereafter, most of us also need to confront the fact that some
00:14of the formulas we need are either too complex, or we just don't know how to do them.
00:19And it's not to say that we always turn toward functions, but a function, which
00:24you could describe as a shortcut for a formula, is going to help us in many,
00:29many situations to tabulate information in Excel.
00:33And to get a handle on what kinds of functions there are and what their
00:37capabilities are, the best place to start, in Excel is in the ribbon, to
00:42click the Formulas tab.
00:44Now, that, by itself, doesn't tell us a whole lot, but the Function Library does
00:50point out to us that we've got Financial, Logical, Text, Date & Time functions.
00:56This can be a little bit intimidating, because there are many, many, in fact
01:00over 300 built-in functions in Excel.
01:03Let's backtrack a little bit here.
01:05There are many times in Excel when we simply write little formulas.
01:09For example, difference between sales and expenses, that's going to be our profit.
01:12So equal sales, minus the expenses, that's our profit.
01:20We can certainly tabulate data in other respects with formulas.
01:23We could add up this information here.
01:25But even when we're adding only four cells, most of us will not simply add the data this way.
01:32One of the first things we learned in discussing formulas is that whenever we're
01:37adding up data, particularly if it's more than two or three cells, we invariably
01:41turn toward a function called Sum.
01:44Now, there is a button, of course, we can use for that, but we can also type in
01:48the name of the function.
01:50In Excel, every time you type the = sign followed by a single letter, you will
01:56get a list of all of those functions that happen to begin with that same letter.
02:03If you have used a function before and you're about to type it - now I don't
02:07really want to use STANDARDIZE here, but if I wanted to here, or if I were about
02:10to type it, I might just click right here, hit the Tab key, and it would pop
02:15into place right there.
02:16Now, I'm not going to use that now, and you can guess by the pop-ups that appear
02:21below this, the hints, as to what this function refers to, but it is a help here
02:26and there when you're using functions and you prefer to type them.
02:29We're going to show you in, a bit, a different way to get to functions, but typing
02:34in the name of the function sometimes is fast, it's easy, and if you're familiar
02:38with what a function does, there is not much doubt about what you need to enter.
02:43Now, going back to the list in the Formulas tab. There will be times when you're
02:48just exploring a little bit.
02:49You're trying to figure out whether there's a function for this feature or that,
02:53and sometimes simply by clicking one of these arrows, for example, the one for
02:56Math & Trig, you're going to discover that yes, there is a function that you
03:01were looking for, and it is in this category.
03:03It's been a long time since I've used Factorial and I haven't really used it
03:07much in Excel, but there it is, and I see that that might be handy for the
03:11application I'm looking for.
03:13And you might see some others.
03:16What I'm doing here is almost like browsing.
03:19Most of us don't have the time to do that sort of thing.
03:22You might occasionally.
03:24And keep in mind also that if you're of a mindset that says "Gee, I'll never
03:30"master Excel. There's so much in here," The next thing you know you have got to
03:34learn how to use Inverse Hyperbolic Cosine, I think most of you won't need that. I don't need it.
03:39A lot of you won't either.
03:41You're not going to worry about it, I'm sure.
03:42But do be aware of this, because it is going to make you aware of some
03:46functions just by seeing their names, and here and there you are going to
03:50recognize that sometimes, even though you didn't check for sure here, if you
03:56were looking for a function,
03:57now, I'm not seeing Median here, but I'll bet there's a Median in Excel.
04:01Can you imagine yourself saying that?
04:03If you don't see it here, at least in the initial set of categories, check more
04:07functions, perhaps that's a Statistical function.
04:11And sure enough, you will find Median there.
04:14And if you're about to use it, no doubt you have some sense of what it's
04:18about to do for you.
04:20So the question might be, from time to time, "In addition to what's out there, how
04:24"can I get help using a function?"
04:27Now, here's some data set up here over in Column N, involving information about a loan.
04:34You want to borrow $26,000, paid off over 48 months, four years, and it's got 6% interest.
04:41And you've heard that there is a way to do this in Excel.
04:44Now, if you do know the formula for doing this, more power to you, and by the
04:49way, you will have to raise a number to the -48th power to get to that. Let's face it.
04:54Most of us will not use a formula here.
04:57We will use a function, and by me telling you that there is a function.
05:02You'll be able to find it.
05:03Sometimes you'll be guessing. "What kind of a function are we talking about here?"
05:07It's probably a financial function. We can click this.
05:11Now, another approach, and more in sync with prior versions of Excel, is to use the fx button.
05:18It's on the left side of the Formula Bar, and it means Insert Function.
05:22Sometimes you'll go here.
05:24Now, this gives us overlapping capability with some of the buttons we just saw
05:29on the Formulas tab.
05:30So here's one approach.
05:32First of all, when you come to this dialog box, here is the complete list of all
05:38functions, alphabetical, the entire list.
05:41If you're trying to get to a function that's been a while, but you know its
05:45name, for example, maybe it's Percentile.
05:47Hit the letter P here.
05:48Once you click in here, hit the letter P. Well, is it in here? There it is.
05:53It's right there.
05:54Now, sometimes you'll make a wrong guess.
05:56It's not in Statistical.
05:57Maybe it's in another category.
05:59But by choosing All, you'll see everything, depending on what else might be here.
06:04That's all the functions.
06:05So you can certainly track down, or narrow down a list this way, as well as the
06:09way we showed you off the Formula Bar.
06:12At other times, you might just want to type in something here.
06:15Maybe you don't know the name of the function we're about to use here, and
06:19what might we type here?
06:20How about make a loan payment or make a monthly payment?
06:23Maybe just type loan payment.
06:25Is this going to help?
06:27Usually, when you do this, what you get is a pared down list.
06:31Now, this might be more than I would hope, but it's about 15 or so entries.
06:37It so happens that it is PMT.
06:40I've used it before, perhaps you have too, and here is a description of it.
06:45This may be central to the way you work with Excel.
06:48You may really need this.
06:50This describes the various parameters or arguments in it.
06:55If you need more help, and sometimes you have the time, click Help on this
06:58function and the Help screen will be context sensitive.
07:03You can possibly print this if you wish. You can explore.
07:07Sometimes it gives you the option to show more capabilities here.
07:11Sometimes these are very helpful, at other times, not so helpful.
07:14You don't always have the time for that, but don't overlook that capability.
07:20But the other feature, and a strong one, that Insert Function gives us, and
07:24imagine, anytime you're about to use a function that either you have never used
07:28or haven't used in a long time, once you've recognized the name of the function
07:33you want to use, then click OK, and it will lead us through the steps.
07:38So the rate here, and we can either type it or better yet, in this case, click on
07:41the cell that has the value, 6%.
07:45Now, you either read the Help screen, or by deciphering what we're seeing here,
07:50you would know that you need to divide by 12 if it's going to be a monthly
07:53payment, 4 if it were quarterly.
07:56And then as we click in the next tab here, you see the description.
08:00It's going to be the term 48, or click the cell in question.
08:04I'm not suggesting, in any way, that PMT is critical to everybody's needs, but
08:08this is an example of how the Insert Function capability does lead us through
08:13the steps, helps us figure out what to do.
08:16The next selection here is PV, and I think the description leaves something to be desired.
08:21Let's face it, what are you doing?
08:23This is how much you're borrowing. It's the 26,000.
08:26There we go.
08:27Here's the answer before we even finish.
08:30Click OK, and there is the result.
08:33If you wanted that to be displayed as a negative, by the way, you can either
08:36change the formula that we actually have here,
08:39or put a minus in front of that.
08:40But let me double-click on this for the moment, to suggest that the next time
08:46you use PMT, you're probably not going to use Insert Function button if it's a
08:51few days away from this, or if it starts to become one of those ordinary
08:55functions that you use frequently, but the capability of allowing Excel to lead
09:02us through the steps to build a function is invaluable.
09:04But let's not make the mistake of saying every time you write a function
09:08you need to click fx.
09:11The more you become familiar with the function, the less likely you want to use
09:14that, and it's certainly isn't fast, but it does give us that helping hand.
09:19If you're relatively new to functions in Excel, you need those capabilities, and
09:23again, we're talking about either using the fx button, or, as a starting point, on
09:29the Formulas tab, clicking one of the categories here, and then entering the
09:34function in this particular way.
09:36That takes us into a dialog box that's similar to, yet not the same, as what we
09:40saw with Insert Function.
Collapse this transcript
Using common functions: SUM, AVERAGE, MAX, and MIN
00:00Any discussion of functions in Excel invariably begins with the Sum function and
00:05often is followed by how to use the Average function and then, although we can
00:10go in different directions certainly, a few functions like finding the maximum
00:14value, the highest value in a range, the lowest value. That's the normal
00:18starting point when we talk about functions in Excel.
00:21Let's just bring out a couple of ideas about how to use these functions.
00:25First of all, the AutoSum button is a shortcut for typing =Sum.
00:30You'll find it on the Home tab, in the Editing group, and you'll also find it on
00:37the Formulas tab in the Function library.
00:39You'll see it right here as well.
00:40And by the way, you can also use Alt= to activate that as well.
00:45Alt= is the same as typing or using the Sum button.
00:50And many times, you'll learn quickly too that you can add up data in a column,
00:54instead of adding them individually.
00:55It saves us a good deal of time.
00:57So, a simple example here might be to click AutoSum and, as is often the case,
01:04AutoSum looks for data, both above and to the left of the cell and tabulates the information.
01:10And, we might want to put totals out here in column Q. That might be a better place,
01:14although it certainly wasn't wrong to put them here.
01:16The same idea here and also, notice to the right, I have already put in the words
01:20Average, High and Low.
01:22And so a typical usage here might be use AutoSum, the AutoSum button here, click
01:29it, Excel makes a good guess.
01:31You might hit Ctrl+Enter here. Then what? Possibly copy it down the column
01:36and double-clicking will get us there a bit faster.
01:38And we might want to do the same thing with Average.
01:41Now, Average doesn't always occur to everybody.
01:44when they're relatively new with Excel and so what some people would do, and it
01:47certainly wouldn't be wrong, is to write a formula, = this total, divided
01:52by, in this case, how many states do we have out there? Seven, to get an answer, and
01:58we'll come up with this answer, and then we could double-click to copy that down.
02:02So, Average is certainly used frequently as well.
02:05Now, I am going to undo that, not that it was wrong, because it wasn't, but
02:10you might have overlooked the idea that you can use, from the AutoSum button
02:17because it has a little drop-arrow or, in this case here, it has other
02:22functions we can get to as well.
02:23So, we can do Average this way.
02:26Now, notice here, though, that average is a bad guess.
02:30We don't want to average the total as well, but we might want to take this
02:33highlighting and slide it leftward, so that the average truly does do this.
02:38And so we'll get the correct answer.
02:41Now, interestingly enough, if you have the Home tab active, AutoSum there has a
02:46drop-arrow to the right and you can get to it there and use Average.
02:51Again, Average making that same mistake, so to speak, of not choosing the data that we want,
02:56a little tricky there, to get just that.
02:59And there too, we copy this down the column.
03:02Now, High I put here purposely, not the same max, but that's the function we use
03:05there too, and we can get to it the same way.
03:07We want to know the highest value of all these cells, and so when we click here,
03:13Max is right there too and the same general idea.
03:15The layout style of these tends to be the same.
03:18Usually it's the same cluster.
03:20And here too, if we don't really want to include those two, we wouldn't.
03:24We want to know the highest value in that range.
03:27It's the same general idea.
03:28And, of course, here, you would know, this Min meaning minimum, same general idea here.
03:33And here too, we would only want to include those cells.
03:36And a quick copy here by double- clicking or here and here, double-clicking and
03:42then a quick readjustment, we have got those as well.
03:45Now, I am not necessarily suggesting that everybody's most frequently used
03:49function list always includes Max and Min, but they are easier to get to and
03:53they are handy, and it does remind us that many times, when we are dealing with
03:56data, whether it's a small set or a large amount of data, we frequently need to
04:01not only tabulate totals, but also to get averages to get the highest and to get the lowest.
04:06Let's also note something here too, when we are using AutoSum,
04:11that sometimes you might have data in a column, like this, I am just putting in
04:15the number somewhat arbitrarily here.
04:17And you might have numbers to the left of the certain cell.
04:22Anytime you click the AutoSum button, Excel looks, first, upward for data, like here.
04:30If it didn't see data looking upward, it would look leftward.
04:33Now, in this case, suppose you really don't want to add those cells above you and
04:37add the ones to the left, well then you would intervene and go highlight these
04:40and you can simply control it yourself, and roll down here.
04:44So be aware of that.
04:44And that works the same way when we are using the other functions as well.
04:48So, starting point for most people in becoming familiar with some functions in
04:52Excel would be the four functions of Sum and Average and then Max and Min.
04:58Now, if you are statistician, you are going to be saying, "I need to do a standard
05:01"deviation on these numbers," and so you probably would pursue that.
05:05And it would be a good guess that it begins with the letter S, but I would
05:08advise, well, you decide.
05:10If you type = and hit the letter S, what's likely to be next?
05:15The letter T and then you might be a little bit surprised that there are quite a
05:19few variations here.
05:21So, probably at this step, if you had never used these, you'd have to go figure
05:24out, which one you might use.
05:26But surely that's the kind of function that a statistician would need to find
05:30and for a statistician, this would be one of those, so-called, basic functions.
05:34If you are a mathematician or an engineer, of course, you've got a different set too.
05:39So many different kinds of people use Excel and so trying to come up with some
05:43kind of a master list of functions that everybody needs isn't always the most
05:47obvious thing to do.
05:49But at least we have ways, in Excel, of finding those functions and the examples
05:53we have just seen are using some of the more familiar ones that almost everybody will use.
Collapse this transcript
Using and extending AutoSum
00:00One of Excel's best shortcuts for dealing with formulas is the AutoSum button.
00:05And invariably, when we need to add up cells it's more than a couple, and so
00:08why not take advantage of this button and its companion keystroke shortcut, Alt+Equals?
00:12Now, in cell G2, we would want to do a total, say, of the cells to the left.
00:18Clicking AutoSum, this is the typical standard approach.
00:21I want to show you a better way.
00:22But certainly, there's something of merit to say, when I use AutoSum I want to
00:25know, what it's about to do.
00:27So it's a good idea to click the AutoSum button, check out the visual, and if
00:32it makes sense, fine. And then what?
00:34Many people will hit Enter. That's fine.
00:35You can also click the button again.
00:37That brings to mind the shortcut.
00:40Instead of pausing each time, as you have become more comfortable with the
00:43function, you know it's going to work nearly always.
00:46So why not just put the active cell in the appropriate position as here, and
00:51simply double-click AutoSum, just fine.
00:54If you are using the keystroke shortcut, you want to hit Alt+Equals and then hit Enter.
00:59Same general idea, as you prefer.
01:01There are times our hands are on the keyboard and sometimes that's just a bit faster.
01:05A couple of other methods, though, as to how to use AutoSum most efficiently.
01:08For example, in column B, we have got some numbers right here.
01:12Now, if we were to highlight the numbers.
01:14We could then click AutoSum once.
01:17The total goes below it.
01:18A variation on that, not necessarily better, would be to highlight these cells
01:24and the empty cell below it, and click AutoSum, the total will go there.
01:29And in the grid of data down here, you could imagine wanting to put totals on the right side.
01:34One method would be to highlight these cells, just like this, click AutoSum once.
01:39We have got totals on the right.
01:42And it would be hardly any better to say that highlight these would have worked
01:45the same way there as well.
01:46You only need to hit AutoSum once.
01:49And in other situations, maybe just beneath these, but not to the side, we might
01:55want totals right here.
01:56Same general idea of course.
01:57Click AutoSum once. We are all set.
02:00Could we do both there on the bottom as we just saw or/and on the side? Sure could.
02:06If we highlight these cells like this and click AutoSum, we are going to get
02:10totals on the bottom and on the right-hand side, automatically.
02:14And don't overlook this possibility, as I do undo here, if you really need an
02:19average across the bottom and on the side, hit the drop-arrow to the right of
02:24AutoSum as it appears on the Home tab in the Editing group.
02:27Click the drop-arrow, choose Average, and now we have averages, both below and to the right.
02:32So the average is here of course, as you would expect.
02:35Averaging up the cells to the left, and down here, for example, averaging
02:39the cells from above.
02:41And that goes for the other functions that are available off that button as well.
02:45So the AutoSum button and/or its keystroke shortcut Alt+Equals certainly can be
02:50used more efficiently than you might have been using them.
02:52It's a great time saver.
02:54And keep in mind too that in other kinds of data, you can use the entire column
02:58reference where appropriate.
02:59And by the way, here's one quick use of AutoSum that may disappoint you.
03:04This particular set of information here involves adding up Times here to get the totals.
03:09Interestingly enough, if you were to highlight this data, you will see, in the
03:15Status Bar, at the bottom of the screen, the total. It's 27:38:00.
03:20Now, I would like to also show you where AutoSum doesn't always do what you
03:24want, and you could say this is the fault of another aspect of Excel.
03:27But suppose you wanted to total these hours here.
03:30If they are highlighted, you can look at the bottom of the screen and see that
03:34they add up to 27:38:00.
03:37By the way, it could be minutes and seconds as well, but it says hours and minutes.
03:40Now, if you click on K9 to put in a total and go to AutoSum, you are obviously
03:45going to be a little bit disappointed.
03:48You know that isn't the correct answer.
03:50Now, the previous answer is 27:38:00.
03:53It's kind of a clue as to what's going on here.
03:56But the fix isn't nearly so obvious.
03:58As you might expect, this is a formatting issue, and I think it's a bit of a flaw in Excel.
04:04If you're adding up hours and minutes, and they go over 24, you get the remainder.
04:10If they go over 48, you'll get the remainder over 48 hours and so on, in chunks of 24 hours.
04:15If you were to right-click here, and format this, you are on the right path to fixing this.
04:20But the solution is not an obvious one.
04:23When you come to the Format Cells dialog box, and go to the Time options, the
04:28answer is in here, the choice is in here, but certainly not obvious.
04:31And it's the one that has the 37 in it, as if we should all know that.
04:34As soon as you click OK, that is a sensible answer.
04:38Although in this case it does show seconds, which we wouldn't want to see.
04:42And again, a quick fix which I could've done earlier.
04:45Right-click back into Format Cells.
04:49And this time, jump into the Custom variation.
04:51It'll take the same display we are using here, and we want to knock off the
04:56seconds and the other characters out there.
04:58End that with mm and then we are okay.
05:00So that's a bit of an adjustment you'll have to make when you are dealing with Times.
05:04But in all other respects, I think you can see these various ways of using, not
05:09only the AutoSum button, but its variations in tabulating data and columns and
05:13rows and in rectangular ranges, it's certainly a lot faster than writing functions and formulas.
Collapse this transcript
3. IF and Related Functions
Exploring IF logical tests and using relational operators
00:00One of the more powerful functions in Excel, and one that for many people opens
00:04the door to more powerful uses of this software is the function, if.
00:10I sometimes refer to this as a threshold function, because I think it makes you
00:13aware of some of the extra power that Excel has and it makes you think of some
00:17of the capabilities of Excel you might not have suggested.
00:20It's programming-like in nature, almost.
00:23On the other hand, this function can be quite simple.
00:25The question is how to use it, and when, and why will this make some sense?
00:30Looking at the data on the screen here, let's imagine that, in this particular
00:33organization, that management has decided to give bonuses to those people who
00:38have certain kinds of Job Ratings.
00:40And in their scheme of things, a 4 is pretty good, and 5 is real good, 1 is not so good.
00:46And so what they would like be able to do here is to provide a bonus of let's
00:50say $1000 to those people whose Job Rating is 4 or 5.
00:55Another way of saying is using the word, if, would be, if your Job Rating is 4
01:00or 5, you are going to get $1000, otherwise nothing.
01:05The if function begins with the idea of a logical test, and sometimes a logical
01:10test may be simply as we are about to use here, a test to see if a value is
01:15greater than another value.
01:17Or expand it a little bit and you'll see in column H some symbols here.
01:22If we want to refer to something, a cell or a value being greater than another
01:27cell or value, we'll use the greater than symbol, as you see it here in cell H2.
01:33Another way of saying this, at times, is to say >=, and we use these two
01:39symbols in this particular order and never the reverse order, if that's what
01:43you are trying to say.
01:45Once you have seen those two, the others here more or less explain themselves.
01:49Although this last combination here looks like a contradiction at first.
01:52What do you mean less than, greater than?
01:54This is the not equal to symbol, as used in Excel.
01:58And with a smaller zoom factor in place.
02:01Sometimes you will see these in formulas.
02:03It might throw you at first.
02:04It looks like a diamond perhaps.
02:07And certainly, at other times, you will use a simple equals sign.
02:10So these are called relational operators and they're usually at the core of what
02:14an if function is all about.
02:17The if function typically contains three parameters or three arguments.
02:23We start with a simple test.
02:24Now, this is confirmed.
02:26If you were to type in the function here, =if, no reason to capitalize it
02:31as with any function.
02:32And as soon as you do type in a function name and then put in the left
02:36parenthesis, you get that screen tip.
02:39And if you have used the if function before, the pop-up screen is just a
02:42reminder of what you probably already know.
02:44We need a logical test here.
02:46And so based on the explanation, that logical test would be for the very first person,
02:51if the Job Rating, in this case, E2>3. This is certainly one way to do this.
02:58All the Job Ratings here are whole numbers.
03:00So we could say it this way.
03:02Other people think it might be clearer to say >=, in which case, we would use 4.
03:08And that is one example of a logical test.
03:11Now, again there are lots of possibilities here.
03:14You remember this idea that sometimes you are comparing two cells or a cell
03:19with a value, a cell with a formula, a formula with a value, and all kinds of combinations.
03:25Sometimes instead of a value, you might be comparing this with a text string, in
03:30which case it would be embedded in double quotes.
03:32As soon as we click comma here, the bold print tip below this will change to
03:39indicate now we are going to provide the answer for when this is true.
03:42And another way of describing the if function is simply a function that makes a
03:47test and provides us with two answers,
03:50one for when the test is true, one for when it's false.
03:53So the answer could be 1000 here. That's true.
03:57When the answer is true that's the answer, comma, otherwise 0.
04:01Answers sometimes are not just pure values as they are here.
04:05Sometimes they are text embedded within quotes.
04:08Sometimes a value can be, rather than an actual value, a cell that contains a value.
04:15A formula is also another possible answer here.
04:18So if we want to put in text here, we could put it in double quote.
04:22If we want to display nothing rather than 0, we'll put in another double quote.
04:26So we have got a number of options here.
04:29I can't think of the appropriate word to put in here.
04:32But maybe we would say Not Today or No Bonus.
04:34That's pretty straightforward.
04:36Maybe that's rubbing it in.
04:37But you can certainly say that, or you can be a wise guy and put in some other text.
04:42And as always, if you have only a single set of parenthesis in a formula, all
04:45you need to do is hit Enter.
04:47Now, you may be wondering why I made the column wider.
04:50It's certainly not to contain the answer, because the answer is going to be
04:52relatively short, either 1000 or No Bonus.
04:55But in order to display the function more clearly, I have made the column much wider.
05:00Eventually, I would make it narrower.
05:02So the result here is No Bonus.
05:04And you can see by the Job Rating there.
05:06And we might copy this all the way down the column, or simply drag it across
05:10enough cells to make sure that this is working properly.
05:13And you can see what's happening here.
05:15And there are many, many times when the if function is simple,
05:18straightforward, just as it is here. Hit F2 here.
05:21We can see it again more clearly.
05:23But there are lots of options, lots of capabilities here as to how we might do this.
05:27And we could have rephrased it in a different way. I don't think it
05:30would have been better.
05:31But we could have said IF(E2<4," No Bonus",1000), phrase it in the
05:39opposite direction.
05:40Quite a few possibilities here, but that's the basic layout of the if function.
Collapse this transcript
Creating and expanding the use of nested IFs
00:00If you have mastered the basic use of an if function, you eventually come to
00:04realize that there are times when you need to expand it.
00:08The simple data that we are seeing here might be used for someone in
00:11organization who is about to get a bonus.
00:14And it looks as if everybody in this organization has that potential.
00:17But we are going to structure this in such a way that we might want to have more
00:21than a simple condition and have just two answers.
00:26Sometimes, we need to put together more than one if, and let's explain what
00:30someone might want to do here.
00:32We want to provide a bonus for those people who have a Job Rating of 4 or 5.
00:38And if someone has a Job Rating of 3, we want to give them a bonus, but say a different bonus.
00:44And maybe even a bonus for those who have a Job Rating of 2.
00:48Now, if this were a strict mathematical relationship, we could write a formula
00:52that might involve an amount and we wouldn't even use the if function.
00:55But let's structure this in such a way, and I am trying to on one hand make it
00:59not sound too complex.
01:01But on the other hand, there are times, when you need to use some logic that
01:04isn't exactly obvious.
01:06I'll start off with a simple idea that we simply want to say if a Job Rating
01:11here is >=4, the bonus amount will be 1000.
01:20Even though you can't intervene and watch your function being calculated at the
01:24time it's actually being used,
01:26there is a way to describe this logic as if to say it is left to right.
01:31If a Job Rating is 4 or 5, 1000 is the answer and the logic doesn't go any
01:35further in the actual function.
01:38But what if the Job Rating is a 1, 2, or 3?
01:40You could say the logic is waiting here to be told what to do next, either to
01:45provide an answer or possibly to have another test.
01:49And this is what we call a nested if.
01:52If a Job Rating is not 4 or 5, then let's check to see if this Job Rating equals
01:593, comma, and if it is, let's give this person $500, comma.
02:07But if that's not true, and remember at the moment we are only looking at those
02:11who have a Job Rating of 3, 2, or 1.
02:13If it's a 3, these people will get $500, otherwise nothing.
02:19So this is an if, inside of an if, and you could say if this is the original
02:24condition, here is the answer for when it's true, and here's the answer for when it's false.
02:30And the answer for when it's false is another condition, and there the answer
02:34is going to 500 or 0.
02:36So that's an if inside of an if, a nested if, and we need a closing parenthesis
02:41for that if, as well as a closing parenthesis for the original if.
02:47We now have three possible answers: 1000, 500, or 0, and we want to copy
02:52that into a few cells.
02:54And again, I have made the column wider so we could see this displayed a
02:57bit more clearly here.
02:58I'll hit F2 to display that first one.
03:00Now, you can see what's happening here.
03:03An if inside of an if.
03:04We have got three possible answers and you see that playing out in the results here.
03:08Now a nested if, and this counts as one nested if.
03:11In all prior versions of Excel, these prior recent versions, the most nested ifs
03:16you could have would be seven.
03:18Now, some people's heads might be swimming already, as they see one nested if,
03:23seven sounds like quite a lot.
03:25But in Excel 2007, we have maximum of 64 nested ifs.
03:31I can't imagine anybody even coming close to that.
03:33Since we are here, let's extend this even further.
03:36What if this company changes its mind again, and decides to give a token bonus
03:41to those people who have a Job Rating of 2.
03:44Once again, if you think of the logic as left-to-right, we might intervene
03:48here, and return to the portion of logic that says if the B2 value =3, these people get $500.
03:55But if not, instead of 0, we'll insert another if here to check and see if
04:01this Job Rating equals 2, comma, and if it is these people get $100 otherwise,
04:07comma, 0.
04:09So an if inside of an if, inside of an if.
04:11We have got four possible answers.
04:13We need another concluding parenthesis, and you'll note how they're
04:16color-coded as well.
04:18And when we complete the entries here, you'll see the different answers out
04:22there as before, and it's a longer if.
04:25An if inside of an if, inside of an if.
04:26Now these are invariably, the more you have, a bit tricky.
04:31And certainly a strong suggestion here would be either do these in a form called top-down,
04:37in other words, this is taking care of the better Job Ratings first, then the
04:42middle one, and then the less impressive ones let's say.
04:44It doesn't make a difference which way we go.
04:47If we phrase this in a reverse order, we could start off by saying if B2=1, then
04:52provide 0, and work the other way.
04:55But if you start mixing up the logic going in different directions, you are just
04:58asking for comprehension problems.
05:01I mean, sure enough, someone could come along here and say "Well, if this is equal
05:04"to 2, then we'll change that to be 100 and if it's not, then we'll check to see
05:08"if this is what are we going to check there."
05:11You can see how it's going to confuse your logic a bit.
05:14But sometimes these make sense, and I wouldn't necessarily say this is out of
05:19range of most people's capabilities.
05:21And you do develop a certain kind of pride as you work with some of these.
05:24But occasionally, on some of these longer functions, you might come back two
05:28weeks later, or two days later and not know what you did.
05:32Kind of think it out all over again.
05:34But we do see an example, here, of a nested if, and I think, in this situation
05:38here, it makes perfect sense and there are times when you need to use this construction.
Collapse this transcript
Using the AND, OR, and NOT functions with IF to create compound logical tests
00:00The IF function is frequently used with other functions as well, and using
00:05multiple functions together is not exactly a goal, or shouldn't be a
00:09goal, but on the other hand, there are going to be times when you are trying
00:12to use the IF function to achieve more than just a simple test on a single set of values.
00:18Imagine an organization that wants to provide a bonus for people here, based on
00:21their job rating, and on their status and imagine their rule is simply this:
00:27If your job rating is 4 or 5 and you are Full Time, we are going to give you a
00:31bonus of $1000, otherwise not.
00:33So a simple IF function would begin =if(.
00:38Now, we want to test for two conditions here, in no particular order, perhaps
00:43the job rating first. Is this greater than 3?
00:47That's one way to say it.
00:48We said 4 or 5, so that that would suffice.
00:50Now, another condition here, and we need to precede this.
00:55Now we can type this later, but why not put it in right now.
00:57The word 'and' is actually a function and, AND, as a function followed by a
01:03series of arguments, two or more, separated by commas.
01:07And the word 'and' is inclusive, meaning this condition must be true and the
01:12second one we're about to put in as well, if this person is to get $1000.
01:16So, the second condition here is that the status here be ="Full Time".
01:23Now the entries in the list there under Full Time with a space, double quote.
01:29The upper and lower case is not critical here, but the space between Full
01:33and Time certainly is. Right parenthesis.
01:36This is one use of the AND function as the logical test for an IF.
01:42You might be wondering, "Why can't we put the word 'and' between the two conditions.
01:46The reason is that you can have multiple conditions.
01:50We might have a third condition, a fourth condition, a fifth condition here,
01:53separated by commas, and rather than using the word 'and' over, and over, and over
01:57again, we, essentially, put it in front of the parenthesis.
02:01If both of these are true, comma, the answer is 1000.
02:07Otherwise, the answer is zero.
02:10And once again, in the situation where you have got multiple sets of parentheses,
02:14they must be entered or typed properly.
02:18And we will drag this down a few cells to check it out and you can see it looks
02:22like nobody in this list has these.
02:24So, we will change one of these people here to make, for example, this person, make that be a 4.
02:29Actually, a few did turn up there.
02:31There we go, a little more clearly.
02:34You can see what's happening.
02:35As we look at this function here, recognize that at certain other points, and
02:40let's show just for the effect of how this might be different, we do have a
02:44third rule here to have been here more than ten years.
02:48So, the year status here, greater than 10.
02:51Now, if you think this out a little bit, if you have got the combination here,
02:56you have actually got eight possibilities.
02:58I won't go through all the iterations but you have three trues, and two trues
03:03and a false, and a true and two falses and so on and so on.
03:05That's eight possibilities, and you have got three entries here, and only when
03:10all three of these are true, does this person get a $1000.
03:15The other word that we use frequently, but certainly not at the same time, but in
03:19context, the word 'or' has, as it does in English, a completely different meaning,
03:25and now we're saying if any of them are true.
03:27In other words, if the job rating is good or the status is Full Time, or the
03:31years of service is above 10, you get $1000.
03:34So, recopying this list here, looks like everybody wins out here, except the
03:39last person in the list, maybe.
03:40It depends upon the entries.
03:41And once again, you can go through some of the variations, test this again.
03:46This person down here, we could play with that a little bit.
03:48Just for sake of argument here, we will make this person be Hourly.
03:51Again, these little tests you will do from time to time, just to kind of make
03:54sure that it's working okay.
03:55We would be doing undo to verify that that appears to be working as well.
04:01So, 'or' and 'and' have a role to play and there will be times, and it gets a little
04:05tricky, where you use 'and's inside of 'or's.
04:09Suppose, once again, this organization changes its mind and says the following.
04:12"We are going to give you a bonus here for one of two major reasons." So here is the 'or'.
04:18"The first reason is you have got a good job rating.
04:21"The second reason is if you don't have a good job rating, we will check to
04:25"see if you have got a combination of being full time and you have enough years of service."
04:31So here we will put the word 'and' in and this is an 'and' inside of an 'or'.
04:37If your status is Full Time and your years of service is this, and one more
04:43parenthesis here to match the green left parenthesis up here.
04:47So that's certainly tricky and when you are doing this yourself and it's your
04:50own data, it certainly makes sense, and yet you have those little doubts until
04:55you try this and I am going to put it in here and recopy it.
04:58You can take a look at some of these here.
05:01So here and there, you will see situations that look at first like they
05:04should work, not that one.
05:06But this person here has a good enough status but not a good job rating. Has enough years.
05:12So, once again, looking at just this line here, we said if one of two conditions
05:16is true, you've got a good job rating.
05:18This person doesn't have that.
05:19What's the other possibility?
05:21A combination of Full Time and enough years of service.
05:25And on this case here, this one should work and it does. So we see that.
05:32Once again, these are the kind of things that instill a certain amount of
05:36pride in tackling these and making them work and yet a few days later, you
05:40come back and look at them.
05:41You are not always sure you got it right.
05:43So you have to kind of think of that a little bit.
05:45And certainly when it is your own data, you have got that edge that helps you.
05:48But don't overlook these possibilities.
05:51A third possibility in all of these is the word 'not' which I try, pardon the pun, not to use, but
05:57you can use this here, and I wouldn't use in this case really like this, but
06:01just to show you that it can be.
06:03Sometimes it might be slightly more efficient to say, "Okay. If it's not the case
06:09"that your job rating is greater than 3, if that's not the case,
06:14"we are going to give you zero here, otherwise 1000."
06:19So, that's reverse logic, but it does give us the answers, here.
06:23In other words, the only people who get bonuses here are those with 4s or
06:265s, but using the logic this way invariably seems to be a little more
06:30awkward to understand.
06:31In some of these, you might see an older usage of Excel or maybe in
06:36formula-intensive worksheet, someone decide to say well, I will take the most
06:40common use and get it out of the way first, as if there is some time lapse here.
06:44But do be aware that you might see that and it might makes some sense here
06:49and there, although I think rarely, to be used in the same context with an IF function.
Collapse this transcript
4. Lookup and Reference Functions
Looking up information with VLOOKUP and HLOOKUP
00:00As you use Excel, situations invariably arise when we need to look up
00:05data, sometimes from information found on the current worksheet, sometimes
00:09on a different worksheet in the same workbook, and sometimes even from another workbook.
00:13There is a category of functions in Excel referred to as LOOKUP functions and
00:18the more common ones are HLOOKUP for Horizontal and even more common, VLOOKUP, V for Vertical.
00:27As we look at the information on this worksheet here, you could imagine in
00:31column G, we might want to calculate a tax rate.
00:34Now, if you have mastered the IF function, and you have worked with it heavily,
00:38this might be your starting point.
00:41For example, you are looking at the salary here of the very first person of 41,639.
00:46Now, the yellow table to the right, actually has information in it that is going
00:51to give us the answer and most people, even if they are not familiar with Excel,
00:55if they happen to see that table, would understand it in the following way.
00:59They are looking at the value 41,600 and looking in the table, they would
01:04realize that if someone has a salary of 45,000, the tax rate would be 7%, but
01:10this person's salary hasn't reached that level yet, so most people would
01:13understand this and read this as 6%.
01:15If that table were smaller and the break points for, say, every 20,000 or
01:20something like that and we had only five or six answers, you could imagine
01:24tackling this with an IF function. And it would work.
01:27It would be cumbersome.
01:28It would be long, but many, many kinds of tables, like the one we are seeing here,
01:34might contain, for example, 11 answers.
01:37That would mean ten nested Ifs.
01:39Now, you can do that in the new version of Excel, but that's really not the
01:42best way to get here.
01:44And so, when considering how you structure a table, the table we see here that I
01:49am highlighting in columns I and J, is structured vertically.
01:55The key information that we were looking up and trying to compare with is in
01:59column I in the example here.
02:01Now, you will notice here to the right is another table, containing exactly the
02:05same information, but it's structured differently.
02:08It's laid out in a horizontal way.
02:11I think most people looking at the layout of these two tables would say well,
02:15the table on the left, the vertically oriented table is a lot more, not only,
02:20coherent maybe but it takes up a lot less space on the Excel screen.
02:24It's just the nature of Excel for information to be structured more easily.
02:28It's more readable when you have what we see in columns I and J, as opposed
02:32to the other table.
02:34So, based on the information that you have from the real world that you are
02:38trying to put into Excel, more likely than not, you are going to be creating
02:42tables that are verticallyoriented.
02:44Now, obviously, there will be other times when the information just looks
02:48better, if it's horizontal.
02:50And furthermore, you may already have a worksheet with a table in it.
02:54Maybe you've inherited it from someone else or you have read it a while ago.
02:57It's already got formulas in it, working off of a horizontal table.
03:00Of course, you don't want to have to redesign that.
03:04Now, don't think from the idea that what you are seeing here that tables only
03:08have two columns or two rows.
03:10Sometimes tables are quite extensive and contain many, many columns and rows,
03:15and off to the right here is an example too, where we see a table, and neither of
03:20these, of course, is like a real tax structure. Sometimes we wish it might be.
03:23But here is a much, much larger table where answers are based not only on
03:28someone's salary but also the number of dependents.
03:31So tables sometimes are quite large, and this table, of course, here has many,
03:36many potential results.
03:38So the discussion about LOOKUP functions invariably begins with what kind of a
03:43table are you going to be using, a vertically structured table, which is most
03:47common, or a horizontal table, and must it be on the same worksheet? No.
03:52Although I would recommend that if you are setting up the data and testing out
03:56various LOOKUP functions, it sure is handy to have the table information nearby.
04:02Later you could move it.
04:03It also might be easier and more proficient to give the table a name, a range
04:08name, that's going to make formulas and functions easier to read.
04:12And so the whole discussion of tables involves, where are you going to put the
04:16information and how are you going to structure it?
04:18You'll notice both of these examples here too, and they are identical in content,
04:23that table information is in ascending order in the left column.
04:27Now we are going to be showing you how sometimes, when you use LOOKUPs, you are
04:32looking for exact matches.
04:34That's not the case here. No one of these salaries happens to match these.
04:38Now certainly, one of them might or could.
04:40We are not saying that, but you certainly wouldn't want to have a table with
04:44every possible salary list as here.
04:46That would be ridiculous.
04:48But any time you are trying to match up information from a table and you don't
04:52have exact entries, and we are usually talking about numbers that are
04:56computational in nature, these must be in ascending order, as we read
05:01downward, and in horizontal tables, the information must be in ascending order
05:05as we read rightward.
05:06And that's only in the example of VLOOKUP, which we'll be seeing the left column,
05:11or an HLOOKUP, the top row.
05:14The other columns here and the other rows here are not necessarily in ascending order.
05:20The other kind of match involves and usually it's tax, but not always, any order
05:25you want, but sometimes you will be using the lookups for exact matches.
05:29So that's the general idea behind LOOKUP tables.
05:32Again, when you are setting them up, it's a good idea to put them on the same
05:36worksheet where you are writing formulas.
05:37You can test them more easily and quickly and then you will decide, based on who
05:41might be using them, as to whether they should stay on that worksheet or possibly
05:45you will put them on another worksheet.
05:46But all formulas that you have written relating to tables will translate
05:51properly, even if you move the tables to different sheets or even to different workbooks.
Collapse this transcript
Using VLOOKUP for approximate matches
00:01In the worksheet we are seeing on the screen here, in cell G2, we want to
00:05calculate the tax rate.
00:07But rather than actually calculating it, we want to look up the information in a tax table.
00:12Now, yellow cells to the right comprise the information of the tax table that we actually need.
00:19This might be in a different worksheet or in a different workbook.
00:23But for ease of use and setting up the example, it's very helpful to have this
00:27nearby, at least for a while, as we are testing a LOOKUP function here.
00:32The appropriate LOOKUP function defined information from this left column will be a VLOOKUP.
00:38We are trying to find this salary's location within here.
00:43The logic of VLOOKUP, as used in an example like this is we are not trying to
00:47find an exact match here, but what's called an approximate match.
00:51The logic is simply the way most people would probably think this out.
00:55We are looking at 41,000.
00:57We would look down the table until we find a value that's too large.
01:01That would be the 45,000.
01:03We revert to the previous row, and then we are going to indicate that the
01:07answers will come out of the second column of the table.
01:12Now, VLOOKUP, by definition, means look vertically down the left column.
01:18The entries in column J, as we see them in the yellow table there, must be in
01:22ascending order as we read downward.
01:25And we must cover the low end, not necessarily the high end, on this case zero,
01:29and we would never have a negative salary.
01:31So, we are fine there.
01:33But do be careful about using VLOOKUPs and HLOOKUP situations where you have got
01:40not all values covered properly.
01:43So, we are trying to look at this value right here, F2, comma, and then we
01:48highlight the table.
01:51In this case, it's the two columns.
01:54We are going to be copying this down column G. So, we have to be thinking about
01:59the absolute reference.
02:01We want this reference to stay frozen.
02:03So, we can either highlight this.
02:05That's just as easy I have done it.
02:07Hit the F4 key to make that an absolute reference, comma.
02:11We now indicate what the column index number is, and you'll see that
02:15reference right here.
02:16Now, it's literally column K, but within the table, it's the second column, and
02:22that's all we need for an approximate look up.
02:24We don't need any other parameters, just these three.
02:27And the answer here, if we are looking ahead, should be 6%.
02:30It is not displayed that way.
02:34A quick adjustment there on the Home tab, the percent button and we won't need
02:39any decimal, so that's good enough.
02:41Now, nothing wrong with this. Literally, this will work and of course, in a real
02:45life situation, what you should do is check this out on a few cells, make sure
02:49it's making sense, working properly. It appears to be.
02:53If you like greater clarity in the function, you might consider giving this a range name.
02:58You can do this very simply, simply by highlighting this data, and in the name box that's
03:03to the left of the Formula bar, click the Drop Arrow.
03:07Other range names that might be in this workbook are listed there.
03:11Let's call this TaxTable.
03:12Range names cannot have spaces.
03:14You can use upper and lower case. They cannot begin with numbers.
03:17Other than that, it's pretty free form.
03:19By giving this a name, we then have the opportunity to change our formula
03:25and instead of using this, which again, is not wrong, but it certainly makes
03:30the formula a bit awkward, it looks complicated and so on, simply change this to TaxTable.
03:35Now, you can either type this or hit the F3 key to get a list of them and pull
03:39out the one you want that way or simply highlight the cells in question.
03:46Since it has a name, as soon as we get down to the bottom there, the name
03:48automatically pops in.
03:50And we could then copy this down to these cells.
03:53We would say that we get the exact same answers and if we wanted to do this for
03:56the entire column, just double-click and it goes all the way down the column.
04:00So this function, even though it seems not to be telling us what it's doing, is
04:04very efficient, very powerful and I would emphasize, again, the idea that the
04:09table might be in a different location.
04:11If we move the table to a different worksheet, the formula
04:14automatically adjusts.
04:15Of course, it could have been there from the beginning.
04:18Same thing applies if we put this in a different workbook.
04:21VLOOKUP, if you don't use it for a while, you will probably forget how it works.
04:26You have to revisit it. An IF function possibly is more clear in what it does,
04:31but it would be unthinkable in situations like this.
04:34To also emphasize the idea that not all tables are just two columns, scroll to
04:39the right here a bit, and you will see a similar kind of list, but the orange
04:44table has many, many columns, based on the number of dependents.
04:49And I want to show you this example, because sometimes you have got to get a
04:52little be creative here.
04:54If you'd look at this information for a bit and you are looking at Claudia
04:57Johnson and her salary, you would focus on the fact that her tax rate is going
05:03to come out of this row here for the 55,000.
05:05Her salary hasn't reached 60,000. It's 56.6.
05:10The answers are going to come out of here, and when you are looking at her
05:14dependents here, it's 2, then you would be focused on this column right here,
05:19and right where they intersect, right there.
05:2110.9% is going to be her tax rate.
05:26But the most you would think about this, the more you would say, "Well how do I
05:29"figure out which column it is?"
05:31This is not the second column within this table here and this is the actual
05:36table we will be using.
05:38Within this table, it's the fourth column.
05:41So if someone has two dependents, the answer is going to come out of the fourth
05:45column, and the more you would check this out back and forth, the more you
05:48would realize is that the number of dependents and the column we need are always off by two.
05:54So, if you have two dependents, the answer will come out of the fourth column.
05:58If you have four dependents, it's going to come out of the sixth column and so on.
06:02So, here we have got to use a VLOOKUP in a more creative way.
06:05We are trying to look up this salary, comma, and here is the table here,
06:12these orange cells.
06:14A range of cells that has a range name, the range name will pop in the
06:17place automatically.
06:18It's called the TaxDep Table, comma.
06:22So, which column has the answer?
06:23No matter what the dependents are, the column that's needed here needs to be
06:28greater than that by two.
06:30So, we will use the reference to the dependents here, plus 2, and we should get
06:36the correct answer here.
06:37Remember we are looking for 10.9%. There we go.
06:42And simply double-clicking, we should copy this down the column and of course,
06:45you would want to check out a few answers.
06:47How about David Christinnelli here, makes 26,000?
06:50We would be looking in this row right here, and David has three dependents, 2.6%.
06:56That's what we are seeing here.
06:58That's what we are seeing over there.
07:00So it does make sense.
07:01It does point out, again, though, that there will be times that you have to come up
07:05with your own scheme for figuring out which column is here, and in this example
07:10too, we are talking about an approximate match.
07:13It's highly unlikely that any one of these salaries will match up perfectly with this.
07:17Some LOOKUP tables are huge and here too, based on our previous example, at
07:22least when you are setting this up, put the table nearby and later, as you got
07:27more proficient with this, that's certainly not as necessary, but at least at
07:29first, make the tables be nearby to set these up.
07:33So this is an example of a VLOOKUP that extends the capability into multiple columns.
Collapse this transcript
Using VLOOKUP for exact matches
00:01When you are trying to lookup information in a table, sometimes the information
00:05that you are focusing on is text-based.
00:08Now, in the list that you are seeing on the screen here, there is a Rate Table on the
00:12left-hand side, and this actually has a range name.
00:14The cells I am highlighting here from A2 to B8 have the collective name
00:18RateTable, and you can quickly see what's going on here, or is about to go on,
00:22because something is not working just yet.
00:24Each of these ratings here, you will see their appropriate positioning in the
00:28table there, try and translate them into a numerical score.
00:31So maybe this is a time-honored approach we've used for ratings or changed
00:35them into a numerical score, and you can see that the 99 here for Fair isn't accurate.
00:40So, what's going on here, in cell F2?
00:43This is using the VLOOKUP function and it is the function to be using here.
00:47We do want to look up information from the left column of that RateTable over in
00:53column A and we are trying to find the word 'Fair'.
00:57But unlike numerical situations, when you are using text or if you're using
01:02numbers on a non-computational way, say ID numbers, when you are looking up
01:06information you need a different approach here if you're trying to find an exact match.
01:11Now unlike a numerical lookup, many times during which we need to find an
01:16approximate location, we need to find the word 'Fair' over here exactly, and then
01:21go get the value 71.
01:22Based on what we are seeing here, this seems to be in place.
01:29We do want to take that information, the word 'Fair', look it up in the left column
01:33of the table and when we find it, we do want to go into the second column to get
01:37the answer, but 99 is not the answer.
01:39That's the answer you just saw there.
01:41For exact matches, we need a fourth argument here.
01:45So following the Column Index number, that's what's there now, a comma, and what
01:50we next put in certainly doesn't flow out of any innate logic.
01:54It's either the number 0 or the word FALSE, whatever you prefer.
01:58I use 0 because it's less typing, but this is what we do for an exact match.
02:04What we're doing with VLOOKUP here is to say now, when we find this information
02:10the word 'Fair' exactly, we go into the second column and get the answer there.
02:15And when we do, as is here, we get the appropriate score, it's a 71.
02:20Then we copy this down the column to take care of the others as well.
02:23Now, not all exact matches, as I said, involve text but I think probably 90% of them do.
02:29The other kind of situation might be if these are employee ID numbers and maybe
02:34they truly are numbers or Social Security numbers, and need I say that with Social
02:39Security numbers we are not looking for an approximate match.
02:42You need to have an exact match with certain kinds of numerical lookups.
02:46But anything that's computationally based, that's an approximate match.
02:51So let's get back to this idea of these and what are the limitations.
02:54First of all, the order here is not in ascending order.
02:59Now it could be, but imagine how ridiculous this table would look if we put it
03:03in alphabetical order.
03:05Excellent would be at the top, but we'd have Very Good at the bottom and of
03:09course the order of the list would be crazy and the numbers would be all over the place.
03:12So we wouldn't even consider that here.
03:14So the order is irrelevant.
03:16Well, irrelevant in the sense that it can be in any order, alphabetically, but
03:21it's a coherent logical order, and of course, these are in order, descending by the scores.
03:26When you are doing an exact match, the order of the information in the left-hand
03:32column is a logical order, not an alphabetic order or a numerical order, and the
03:38fourth argument, the 0 or the word FALSE, which, by the way, is not in quotes
03:42either, will mean we are trying to find this exactly.
03:45So what happens here, when we have information here that doesn't match?
03:49Now here's something that's a little insidious and you might run into this at
03:52different times. I am going to put a trailing space here, N/A. That's P-o-o-r
03:59<Space> and over here what do we have?
04:01Well, we are trying to find that information in the table, and over in the table it's P-o-o-r.
04:07That's it. Not a match.
04:08If you need to work around this, I could throw in a quick solution here.
04:12You can look at not just E6, but use the trimmed version of this.
04:17This means trim off trailing, leading and multiple consecutive interspaces,
04:22reduce those to 1, and in this case here, we are looking for the trimmed version of this.
04:28Now, in other situations, if you just happened to have a word that isn't there at
04:32all, for example, Kit Carson's performance here, that's just so-so.
04:37Well, that's not in the list, and of course, this is not found.
04:40So I think you can see there is a distinct set of situations where an exact match
04:46is exactly what we want.
04:47It's usually text and it works easily and quickly, but nobody will call this intuitive.
04:52You just have to have that fourth argument, either 0 or FALSE, to signify that
04:56this is an exact match.
Collapse this transcript
Nesting Lookup functions
00:00The more you work with Excel formulas and functions, the more you encounter the
00:04need to use functions together and sometimes not just tacked onto the end of one
00:09another, but actually used within one another.
00:11We call this nesting, and perhaps you have encountered this and you might
00:15have needed this as you use the IF function.
00:18But sometimes this arises, also, when using a VLOOKUP function.
00:21For example, on the screen here, in column F, we see various entries and farther
00:26to left are people's names.
00:27We are trying to look up the regional tax rate here.
00:31First of all, note that there is a table here in column J and K that lists all
00:36of the states and the region that they happened to be in.
00:39First example, here. We'd like to find out which region Colorado belongs in.
00:43You can see here that it's in the MT, presumably Mountain region, here.
00:46So let's do a VLOOKUP here using the Colorado reference, comma.
00:53The table here has a range name. Rather than highlighting it, which I sometimes can
00:57do and you can certainly do that too.
01:00this time, I'll hit the F3 key to bring up the various range names available in
01:05this workbook and a range name for this, as you would guess, is State Regions.
01:09We are looking in the left column of State Regions, comma, and we need to get
01:14information out of the second column.
01:16It's the 2, and this must be an exact match, comma, 0 or FALSE, that fourth argument.
01:24Complete the entry and we see that that was found.
01:27Once you have indicated which region Colorado is in, it's the MT region, we then
01:31want to use the additional table that's seen over in columns M through U, and
01:36this table over here shows different rates, depending on a number of dependents.
01:42Here are the number of dependents, and over in the left-hand side, this first
01:45person has five dependents.
01:47So the result of the VLOOKUP here is an MT.
01:51We now want to use MT and lookup the appropriate MT rate over here, based on the
01:57number of dependents.
01:58So the answer we got from this first VLOOKUP is going to be the item to be
02:02looked up in an outer VLOOKUP.
02:04So think of all this as MT.
02:06That's what it evaluates to.
02:08Leave that in place and outside of this, or beginning to the left of it, let's
02:12put in another VLOOKUP, the so- called outer vlookup, left parenthesis.
02:17Remember, this is equal to MT.
02:19This is what we are trying to look up, comma, and the table we are using as
02:23the source for the lookup are these cells right here and the range name
02:28RegionalTax kicks in.
02:29That's the name of that table, comma.
02:32We are trying to lookup information in which column?
02:37Well, if a person has five dependents, it's the 1, 2, 3, 4, 5, 6th column here
02:44and rather than putting in 6 we are going to use that dependent, plus 1, and
02:49because this needs to be an exact match, in other words, we are trying to find
02:53that MT exactly here in that left column,
02:56we need to put in an additional argument, comma, and either the word 'FALSE' or
03:02the number 0 and a closing parenthesis.
03:04All the parentheses must be typed here, since we have multiple sets.
03:08So this should give us the answer and if you are looking ahead, you would be
03:11suspecting in the MT row here in the column that has the 5 in it, a .30 for this
03:16regional tax, and there it is.
03:20So a VLOOKUP, inside of a VLOOKUP and, in this case, you can see the power of it
03:24and how it solves the need pretty quickly and efficiently.
Collapse this transcript
Finding table-like information within a function with CHOOSE
00:01Despite the power of Lookup functions, there are going to be times when the
00:04information you might want to lookup might be more conveniently stored within a function itself.
00:11Now, a completely different function called Choose works in some respects like
00:15the Lookup functions, but it doesn't require an external table.
00:19A lot of you know that given date information, you can easily extract the
00:24month of a given date.
00:25For example =month, referring to this cell right here, you would expect,
00:31because that's March.
00:32That's the third month and that's the answer we get here. It's a 3.
00:36Now, armed with that information, you might say "Well, a table the way we see in
00:41"columns D, E and F here would be ideal."
00:43We could put that up over on the side and then we could lookup month 3 and see
00:47that it's in the first quarter, because we are trying to extract or figure out
00:50what the quarter is here.
00:52Those of you who have a strong mathematical background are probably thinking,
00:55"Well, why do all this?
00:57"Why don't we just do something like figure out what the month is, and do some
01:00"division, maybe use the Mod function, some other things and come up with a
01:03"mathematical solution here."
01:05Well that might be okay too, if you were inclined that way.
01:08But think of how that might be a bit more difficult if the quarters aren't
01:12the standard quarters.
01:13Sometimes fiscal years, like in a federal government, begin in October.
01:17Let's ignore that for the moment and get back to this issue, though.
01:20Rather than having an external table here, the Choose function allows us to
01:25effectively store the answers in the function itself.
01:28Now, the possible answers here, there are really only 12 situations.
01:33We have got 12 possible months.
01:34So what we are trying to store, in effect, would be the results or the numbers
01:38that we are seeing in column F, over here.
01:42And so, starting with this, we are using month as a starting point. What we want
01:46to use is the function called Choose.
01:49And Choose begins with some value that we are trying to lookup, and in this
01:53case, it will be the month that we are pulling out of the date in column A.
01:57, That's the index number comma.
02:00Now, if that happens to be a 1, it's January, it's going to be in the first
02:04, quarter 1, comma. If it's February it's still in the first quarter, another 1, and if
02:09it's March, another 1.
02:10So you probably get the idea here.
02:13If this is April, the value is 4.
02:16Then here's the answer when it was a 1, here's the answer when it was 2,
02:20February, here is the answer when it was 3, March, and now we come to April,
02:24it's going to be a 2.
02:26So we need the same answer for May and also June, and then moving into the next
02:30quarter, three 3s here.
02:32And then three 4s and that's it.
02:35And because we have nested functions here, we do need the closing set of parenthesis.
02:40So here are the 12 different answers, and, of course, they differ only in the
02:44sense that we have got four unique entries, but 12 separate answers there,
02:47depending upon whether the month equals 1, 2, 3, etcetera.
02:51So there is the result and March is in the first quarter, and of course I didn't
02:55need to make the column wider, but for display reasons, we want to see this.
02:58So double-clicking to fill in the other formulas here and a quick check here
03:03does verify that this is working properly.
03:06Now, if for example, you work for the Federal government, or you have a fiscal
03:09year where the quarters line up differently, then you will adjust this a bit,
03:13and you can imagine how that might be.
03:15In the Federal government, in a quick adjustment here, if it's January,
03:19February, March, those are in the second quarter.
03:21So we would take out the three 1s right here and put them at the end,
03:26following the 4, comma, 1, comma, 1, comma 1.
03:31Federal Government style recopy, and it's used in some other organizations as well too.
03:36So March is in the second quarter, November is in the first quarter and we see
03:40how this is playing out here.
03:42Once again, it's the Choose function.
03:43So we have no external table.
03:45We essentially have the table built-in right here.
03:48How many entries can you here? Up to 254.
03:51In prior versions, it was more like 31.
03:54So a potentially powerful feature, I've used it occasionally with great effect,
03:58and it does save you the need of setting up the external table.
Collapse this transcript
Locating data with MATCH
00:00Despite the power of the VLOOKUP and HLOOKUP functions, there will be times when
00:05you are trying to look up information and they just don't work.
00:08They can't get the information that you need.
00:11On the screen here, I've got a list of Social Security numbers.
00:15For ease of display, I've put the information on the same worksheet here, in
00:19other word, these numbers here.
00:21The table that I want to use is over here to the left.
00:24Imagine a more likely scenario would be this is in a different worksheet,
00:28possibly even a different workbook.
00:31Now with the VLOOKUP, we can't look up information unless it's in the left column
00:36of a table, and sometimes what we are trying to do is simply verify the
00:40existence of information, and there too, VLOOKUP is a shortcoming.
00:45We don't use VLOOKUP here to see if information actually exists.
00:50So imagine how we might take information like this to see if this information
00:56exists, for example, in column B. Now again, in a real-life situation, it's
01:01more likely that we are doing this, where this column E information is located elsewhere.
01:05So instead of a VLOOKUP here, let's use a function called Match.
01:08Now, match, by itself, doesn't usually give us everything we need, but in this
01:13case, it might, if we're only saying at the beginning here "Let's see if the
01:18"information exists over in column B," and what is that we're trying to find? This
01:23information, right here.
01:24Now these are formatted entries, the real value of this is simply the
01:28text string 145-69-6388.
01:31No hyphens, and that's the same kind of information in column B, comma,
01:36and wherever possible and appropriate, if it makes sense, use the entire column reference.
01:41So we'll just use column B here.
01:43So, the Match function is very similar in some respects to a VLOOKUP function.
01:48There is a lookup value.
01:50That's that Social Security number.
01:51We are looking in an array.
01:53Now this needs to be a column or a portion of a column, or a row, or part of a row.
01:59It's not a two-dimensional range there. Comma.
02:03Now, you see what pops up on the screen.
02:05We're looking for an exact match here, and put in a zero.
02:11We need to find that, exactly.
02:12We want to see if that number exists there. What kind of an answer are we
02:16going to get out of this?
02:17The positioning within the column it's in, because we've used the entire column
02:22B, it's in the 17th row and if you look in the 17th row, you see that right here.
02:27That does match up with what we are trying to find.
02:30So the answer isn't complete in one sense.
02:33Although, if your sole purpose was to see do we have this in our list? Yes we do
02:38and that's the result.
02:39And we see that pretty quickly and readily with the Match function.
02:43Similar in some respects to VLOOKUP, when you are using an exact match there,
02:46that fourth argument that you need in some VLOOKUP functions is a zero.
02:49And here it is, here for an exact match.
02:52If you need the other approach words 1 or -1, then the order of the information
02:56in the column has to be ascending or descending.
03:00Now, there is another use for Match that might occur in a situation like this,
03:04where we've got entries in columns J and K and the names are in, as you see, last
03:12and first name, split out this way.
03:14Does Yvonne Randall exist in the list?
03:17Well here, for purposes of example, we see yes and we can find it, but it's a
03:22short list you see over there, but it's in this display order.
03:26Now imagine certain kinds of databases that you might have.
03:30You've got thousands of these.
03:32Obviously, you need a way to do it other than just eyeballing it.
03:35So what we want to do now is, in effect, pull these two together in a Match
03:41function to see if, together, that exists over here.
03:46And you may or may not be familiar with how to concatenate, so we'll use that
03:48technique here, but we will be using the Match function to say, in effect, let's
03:54see the combination of these.
03:55How do we put these together?
03:57In order to match up with what we are seeing in column P, we want to pick up the
04:01entry from J2 here, and along with this, use the ampersand, double quote, comma,
04:07Space, double quote.
04:09So following the last name, Randall, we are looking for Randall and a comma space.
04:15As you see they are in column P and along with that last name and comma, space,
04:20we also want to see the first name, Yvonne.
04:23So this is what we're looking for.
04:25Randall, comma, space, Yvonne, comma.
04:29So all this is the lookup value.
04:33The table here is simply column P again, like in the entire previous example,
04:38the entire column where appropriate.
04:40Comma, and we are looking for an exact match. Zero we're done.
04:47And looking ahead there, you see Yvonne Randall. That's in the 13th row. That's our answer.
04:52It's the 13th position in column P.
04:57Now, usually you'll use additional features or possibly use this in a VLOOKUP to
05:03find other information, but match, by itself, simply gives us the position of
05:08information in a column or in a row.
05:11If Yvonne isn't found here, or maybe someone spelled Yvonne's name differently
05:16here, you're going to get a different kind of answer, N/A. So this tells us
05:20when the information is not found, and sometimes that's an appropriate use of the function too.
05:25We either want to see if it's there or if it's not, and if it is, it gives us
05:29the positioning within the array.
05:31If not, it simply says N/A, couldn't find the information.
Collapse this transcript
Retrieving information by location with INDEX
00:01As you look at the table of information in column C through J here, the orange
00:05colored cells, these represent prices based on perhaps packages. This
00:10represents the size of the package.
00:12Now, a more sophisticated example might have this broken out by weight, but
00:16let's imagine, based on the size of a package, and where it is to be shipped from
00:21a particular location, we've got different shipping zones here.
00:25From the table, we want to be able to pull out information based on size and zone.
00:31A function called Index allows us to pull out information from a large table, as
00:36long as we provide the row and column reference.
00:39So let's imagine a simple example here. In cell D11, we want to see the price of an item
00:45that's Size 3 to be shipped to Zone 6. =index.
00:50Index begins with the actual location of the array.
00:55Now, there is a range name here.
00:56You will see it pop in the place as I highlight the cells.
00:59The range name is ShippingCost, comma.
01:02Throughout Excel, you will find different functions that use row and column,
01:06always the row comes first, RC, remember that.
01:10It's not always the case that everything lines up perfectly, but in this
01:14particular example, it does.
01:15The Size here is 3, and so we can use this cell right here if we wished. If
01:20we were doing it manually, we just type 3, but let's use the cell right here that has the size.
01:25That gives us the row number, comma, and the column number here.
01:30It's the 6th column.
01:31That's found right here. That's the Zone.
01:34So what's it going to cost?
01:35And looking ahead, you can see where the 3 and the 6 intersect this way, $35.29,
01:40and that's the answer.
01:43So we pulled out information from a table, based on the row and column number.
01:47Now in columns, L, M, N and O we see a similar need for this.
01:52We've got a huge list of items and we want to know what the shipping cost is,
01:56based on the size of the item in the shipping zone.
02:00So once again, the Index function here, we're looking at this table again.
02:04So either type it or highlight it, comma, and the row number we need here
02:10relates to the size.
02:11It's going to come out of cell M2, comma and the shipping zone, it's going to
02:17represent the zones here.
02:18The column number, that's right here.
02:20And we are all done with that, Enter, and we'll recopy this, and you can see how
02:25we've used the Index function in these examples to pull information out of a
02:29table, based on a row and column reference.
Collapse this transcript
Using MATCH and INDEX together
00:01If you've worked with the Match and Index functions, I think you recognize
00:04that they each have power in their own right and yet, at times, each one of them
00:08doesn't quite complete what we need.
00:10And at other times, you are thinking, "Well, I need to get information out of a
00:13"table. Why not VLOOKUP."
00:15There are times there, too when it doesn't quite meet your needs.
00:19Let's look at the situation here.
00:20There is a table in columns D through I. Imagine that this, possibly, is on another
00:25worksheet, and again, for ease of use, we'll put this on the same worksheet here,
00:29but we want to be able to extract information from here, based on, for example,
00:34April, DVD Drives. Looking ahead, of course, we'd be looking in here and that's
00:39the number we hope to get a hold of.
00:40And we can't really come up with a sensible way to do this with a VLOOKUP,
00:46and Match will tell us where this is within a given range, both for the month
00:50and this, but we need to put this together in pieces perhaps, at least the
00:54first time through.
00:55So let's show different ways to use the Match and Index function together.
01:00First of all, let's locate April in this list by simply using the Match function.
01:05We are trying to find April, comma, in this list.
01:09We know it's there. We see it, and it's located, comma, and we'll find out in a
01:15moment, of course, we would know ahead of time. We're looking for an exact match here.
01:19The Match function tells us the relative position of April in this list.
01:24It's in the fourth position, pretty apparent, and we want to do the same kind of
01:28thing with disk drives and we will be looking up here.
01:31It's in the first position of the list up there.
01:34You see that ahead of time, so a similar function trying to match DVD Drives,
01:39comma, using this range.
01:41That's where we're looking and we need to find an exact match.
01:44We put in a zero and we have that information.
01:47So with that knowledge in hand, we can use an Index function now to look at
01:54this range of data here. Index gives us the ability to first define the table
02:01we are looking at and we need to get information out of a certain row here, and
02:05it's the fourth row because it's April, but we see that right here, so we'll refer to this
02:10cell here. We'll reposition this in a second. We'll recreate this using Match inside of
02:15Index. For the moment, we're just picking up the references.
02:17So, comma, and the column was derived from the fact that DVD Drives here, it's
02:22actually the third position and that's all we need.
02:27This is the table we're looking to extract information from.
02:30This is the row reference. This is the column reference. We're done, 4565.
02:35We see that information under April, DVD Drives, right there.
02:40Now, as you use these more often and more often, not everybody, but certainly
02:46some of you, will use them with enough frequency to, in effect, build these as you
02:50go and there's no real requirement to do this. In fact, some people might think
02:54it's better to leave the function like this, but why not, rather than having this here,
03:00go back to this function here, highlight this text here and simply hit Ctrl+C or
03:06you can use the Copy button here of the Home tab right then in there, copy just
03:10that part without the equal sign, hit Escape, come back into here, perhaps
03:15double-click or do it in the Formula Bar, instead of this, let's paste in Ctrl+V
03:20or the Paste button that argument, complete that for the moment, come back here
03:24and do the same sort of thing with this reference?
03:27Highlight just that portion of it, copy it, Escape, come back into the function
03:33here, and position this here, and paste that into there.
03:38Now, that may or may not be the ideal solution.
03:41It depends upon who is going to be using this.
03:43Is it you? Do you use these frequently? And so on, but using Match and Index
03:47together, and perhaps using them separately, or putting them together the way we
03:52see here, there is no question that it gets us the answer.
03:56But I think you might debate with yourself sometime about, what might be most efficient.
03:59But you see how we can use the two together to get information out of this table.
04:04Now, there is another set of information off to the right here, in columns K, L,
04:08M, and let's imagine too that that information is located in one worksheet and in
04:15another location, perhaps another workbook, another worksheet,
04:18we need to find the person's name here.
04:21Here is the Social Security number.
04:23Now, once again, first thought might be VLOOKUP.
04:27We are trying to lookup this information.
04:30But VLOOKUP requires that we look up information in the left column of a table
04:35and there is no possibility with VLOOKUP to then look leftward.
04:39First thought might be, "Why don't you just move the table columns around a little bit?"
04:43Let's imagine that this is in a worksheet and other formulas are already created,
04:48or maybe this is in a different workbook that you can only use to extract
04:52information from, let's say that this arrangement is there, it's cast in stone
04:57as we say, you cannot change it.
04:59We need to find out not only that this exists but we need to find out the
05:02name of this person.
05:04So the first approach here would be to use the Match function to see where it
05:08appears in column M, =match, left parenthesis.
05:13We looking at this value, comma, we are looking at column M and we need to
05:18find an exact match, comma, zero, and that's found in the 12th positioning.
05:24There it is right there.
05:25We see it ahead of time.
05:27Now once we found that, we now want to use that as the row reference in an Index.
05:32So leaving this here in place, let's use Index.
05:37Now, where are we looking here?
05:39We actually need to only look in column K. Now, column K and column M are in
05:45sync with each other in the sense that they are parallel, comma. In this table in
05:49column K, we need to get information out of which row?
05:53It's going to be the 12th row and we already know the row from here, so that's in place.
05:59Now, since it's only a single column, we don't even need to put in a column reference.
06:05If we did have a situation where this had to come out of a different column, we'd put that in.
06:08We don't need that here.
06:10We do need the right parenthesis and by hitting Enter, we've got the name.
06:14There is Thomas Watson.
06:16And so this will work for the other entries as well.
06:18Simply double-click and they all fall into place.
06:22So sometimes you'll use an Index and Match, using this approach, which is
06:26certainly more direct than our previous example, but you get the idea of how
06:30Match and Index frequently are used together to circumvent some of the
06:35limitations of VLOOKUP.
Collapse this transcript
5. Power Functions
Tabulating information on a single criterion with COUNTIF, SUMIF, and AVERAGEIF
00:01Whenever you have database-like data that you are managing in an Excel list,
00:04invariably, you need to tabulate some information, some sub-totals, some grand
00:09totals, and there are tons of ways to do this in Excel.
00:12Sometimes a PivotTable is the best solution, sometimes it's a new column of
00:16data, sometimes you just want a set of statistics, maybe off to the right of your list.
00:20There are three related functions that might come into play here.
00:24One of them is brand new in Excel 2007.
00:28Sometimes, just looking at the data, an idle question comes up.
00:31For example, there's a list here and quite a few names, see the status of
00:34people, salary, and someone just says out of the blue, "How many full time
00:39"people do we have here?"
00:40So, what we would like to be able to do is simply count the number of times that
00:44we see that phrase, Full Time, in column B, and column B might have a ton of
00:49entries or maybe just a few.
00:50It doesn't make any difference.
00:52The function we are talking about here, first of all, is called COUNTIF and as
00:56always, if where we are looking is in a column where there's nothing else, let's
01:00refer to the entire column, make it simpler.
01:02We are looking in column B, and what are we looking for here?
01:04Well, one way to approach this is simply within double quotes to put in the text entry.
01:09Now sometimes you might be looking for values and you can simply enter the value
01:13to see how many times that occurs.
01:15We'll type Full Time.
01:17By the way, the uppercase here isn't critical, but logically, you would type it
01:20this way, because you see that's the way it's entered.
01:23The space is critical, of course.
01:25Full Time, double quote. That's it.
01:28How often does Full Time appear in column because?
01:31And there it is, 162 times.
01:34Now, if you'd like to do this for the other kinds of statuses that appear in
01:37column B, the list off to the right, which is prepared ahead of time, we can
01:42simply convert to that.
01:43And although it doesn't really have to be in the same row, I'll just drag this
01:46up here and change this entry here.
01:49Instead of referring to the text entry, we'll make it refer to the cell right
01:52here, and we would get a similar answer, and now we can simply drag this down
01:56three more cells to get our totals for the other.
02:00And that total is 296, and you'll see that down in the status bar.
02:05If you were to click on column B, as I'm doing right now, you might not see
02:09anything in that status bar, but if you were to right-click down there, you
02:12can certainly control,
02:13and this might be a reason for having this around all the time, do a count of
02:17the cells that have entries in them, and you see they are popping up already.
02:21And as soon as I click outside of this, you'll see 297 entries there.
02:25Of course, that's counting B1 also, so that accounts for the difference.
02:29But getting back to the idea of COUNTIF. That's fast, that's easy, and when
02:33you're referring to a list, perhaps it's clearer.
02:35It depends upon what your needs are.
02:37Let me point out a variation on this too.
02:39Although this isn't a powerful use of it, but I think you can sense how it could be.
02:43You can use wildcards here.
02:45Let's show how, in a function, COUNTIF, looking again in column B, we
02:51want to find all the people who are full-time or half-time, either way.
02:55So, what they both have in common, of course, is the word 'time'.
02:58In this situation, we use a double quote and the asterisk.
03:01That's a commonly used wildcard, which you perhaps have seen before and then the word 'time'.
03:08Anytime, in column B, where we see the word 'time' preceded by anything, we want to
03:13know how many times this has occurred.
03:15It's 198 and, of course, that's the total as we see up here.
03:18We were to highlight those two cells.
03:19It's the total of the full -time and the half-time.
03:22So, be alert to that possibility as well.
03:25Now, the long time, I used to call it companion to COUNTIF is SUMIF.
03:29SUMIF begins and starts essentially the same way.
03:34Let's say, again, we would like to know not only how many full time people we
03:39have here, but what are their total salaries?
03:41SUMIF has a third argument.
03:45It starts off in essentially the same way as COUNTIF.
03:48We're looking in column B, comma, and I will use the cell reference G1, which has the
03:54word Full Time in it.
03:56And every time we find an entry here, that's Full Time, we would like to get the
04:01Salary and the word sum, of course, suggests we want to be adding them, so we
04:04are going to get the salaries out of Column C.
04:07In situations where you are highlighting cells, for example, if we were to
04:11choose to do this by B2:B300 or something like that, you would want the C
04:16reference to match that exactly to avoid problems.
04:20If this says B2 to B300, then over here at Column C, you would indicate C2:C300.
04:27So, how much are we paying these full-time people?
04:29A quick fix here, there.
04:32It's 8,847,265 and based on that, of course, you'd imagine wanting to know
04:37Half-Time, Contract, Hourly.
04:39We'll just drag this down here, and we see the total there, 15.09 million.
04:43Click on column C. That's the same total, and we are seeing that in the
04:46Status bar as well.
04:47So, that's a cross verification, you might say.
04:50Now in all prior versions of Excel, if you wanted to get an average salary, you would
04:55just take an entry, like this, and then divide it by the count.
04:59So, we possibly could put the two together.
05:01That wouldn't be that outrageous or difficult.
05:02We could take this and then divide it by the COUNTIF that we used up above here.
05:07But there is a new variation, a new function in Excel 2007, called AVERAGEIF. Left parenthesis.
05:15What are we looking here?
05:16Like before, we are looking in column B, comma. We're looking for the Full Time people.
05:21We'll just pick up the information from G1 like before, comma and we're looking
05:26at the salaries in column C. What's the average salary of the Full Time people? And there it is.
05:33And we can quickly verify this too by writing a simple formula here, equals,
05:37whatever we got earlier with the SUMIF for the Full Time people, divided by the
05:42COUNTIF of the Full Time people, and we have the same information.
05:46Obviously a rounding difference on the display, but it is the same information.
05:50So AVERAGEIF, which is a new function in Excel 2007, will simply make this
05:55process simpler and more direct.
05:57And as in the previous situation, if we wanted to get the average for
06:00Half-Time, Contract, and Hourly, just drag this down three more cells and we
06:04have those as well.
06:06So SUMIF, COUNTIF, and AVERAGEIF, great features for tabulating information
06:12from a list of data.
Collapse this transcript
Tabulating information on multiple criteria with COUNTIFS, SUMIFS, and AVERAGEIFS
00:01In versions of Excel prior to 2007, if you were trying to tabulate information
00:06from a database based on multiple criteria, you might need to be more
00:11knowledgeable about, and you need to learn about, how to use what are called Array
00:15formulas or Array functions.
00:17In Excel 2007, are three new functions: COUNTIFS, SUMIFS and AVERAGEIFS, and, of
00:26course, they have a relationship with SUMIF, COUNTIF, and AVERAGEIF.
00:31They allow us to tabulate information based on multiple criteria.
00:35There's a formula in F2 here, function, COUNTIF.
00:38It simply tabulates the number of full time people here.
00:42Now an extended idea, based on that bit of information, is how many of these full
00:47time people have a job rating of 5, and rather than working off of this, just use
00:52the new function, New in Excel 2007, called COUNTIFS, and we're looking at two
00:59criteria here, the status and the job rating.
01:02So you'll notice in the popup here, it's says criteria_range1.
01:05We're looking in column B, comma, and we are trying to narrow this down by
01:10criteria1, criterion.
01:12We are using singular, Full-Time, comma, and notice how another set has come up.
01:21So these can be in pairs, and we can have many of them.
01:23We're only going to have two pairs here, but notice how we're starting off here.
01:27criteria_range1, criteria1 and now criteria_range2 will be job rating,
01:37comma, and since this is a value and not text, we don't need to put this in double quotes.
01:42Just simply the value 5.
01:44Now if we had more columns next to the A, B, C, D there, we could be doing
01:49this for even more sets.
01:50We got two sets here.
01:51This is the first set.
01:53We are looking in column B to see who is full-time, and in column C to see who
01:57has the job rating of 5, so how may people fall into this category here?
02:01So 32 of those 162 people have a job rating of 5.
02:05Now SUMIFS and COUNTIFS work in a similar fashion but they're structured
02:10slightly differently.
02:12And I want to use a different set of data here, off to the right.
02:15In columns I, J, K, and L, you see information about items that have been
02:20shipped, and depending upon the size of the items, and where they have been
02:25shipped, by the shipping zone, the cost is different.
02:29And so there are quite a few entries here.
02:31It goes down to 297, so we have got 296 different items that have been shipped,
02:36and we want to know the total cost by size and shipping zone, looking at just
02:41this one for the moment, that 37.79 that we see in L2 there, eventually would
02:47emerge over in the right, at this location, there, as part of a bigger total.
02:52In other words, all the items of size 5 sent to shipping zone 5, what's the cost?
02:58So we want to use a SUMIFS.
02:59Let's begin right in the upper left hand corne,r as it's typically done.
03:03=SUMIFS and we would like to add information from column L, and this is where
03:09it's different from COUNTIFS.
03:12Add information from column L. We see criteria_range1, criteria1,
03:16criteria_range2, and we can't see the rest of it, but now we'll have pairs,
03:212, 4, 6, 8, etcetera.
03:24So, where are we looking here?
03:26We're looking in column J, comma, and for the moment, we're only thinking about what's
03:31going to go into cell Q3 here, where we're typing this.
03:34So we want to get information out of P3, in other words, all the entries from
03:39column J that are size 1, or equal to the value of 1, so that's one pairing.
03:44Now we need also do this for the pair out of column K, and those are going to
03:50be equal to, for the moment, just this cell, the value of 1 as we see it in Q2, right there.
03:57So for all the items that are size 1 that went to shipping zone 1, how much did
04:02we pay for all of that? 64.14.
04:05We can verify this pretty quickly here by clicking in column K, going to the
04:08Data tab and clicking AZ to sort this, and doing the same thing in column J.
04:13Click in there, hit the AZ button, and here are all the items, size 1 shipping zone 1.
04:20As we highlight these, you see the total cost down the status bar, 64.14, that's
04:25the same value we're getting here.
04:27Now if we need to copy this as we would, downward and rightward here, we need to
04:31adjust this formula, a little tricky here maybe, but not too lengthy.
04:35So in editing this, we want the reference to column L to be absolute.
04:39Let's click F4 to take care of that.
04:41We want the reference to column J to be absolute, F4, and column K and with the
04:48other two references, they need to be what's called relative.
04:51All of the size references will come out of column P. Therefore, in column P
04:56here, you can hit F4 a few times.
04:58We want the $ sign in front of the P not in front of the 3, and for the
05:02reference for Q2, those references are going to come out of row 2 all the time,
05:07so I'm clicking F4 a few times.
05:09We want the $ sign in front of the 2.
05:11So that would be the master formula here, and then we could drag this downward,
05:16and then rightward, and that's the total of all items that have been shipped out
05:21by size and zone, and that total, you can see it because it's highlighted,
05:25you'll see at the bottom, is $8,668.54, clicking column L, the same value.
05:32So it's working properly.
05:33We have the same exact totals.
05:35Now AVERAGEIFS is just the same idea.
05:38We could build off of this, if we wanted to.
05:40What's the average shipping cost per combination of size and zones?
05:45We could simply click in here, in the same general layout, and turn SUM into
05:49AVERAGE, complete that entry, recopy it downward, and then copy it to the
05:54right to have averages.
05:56We could possibly have done that on a separate table. We're, just for the moment,
05:59doing it right here.
06:00So these three new functions, SUMIFS, AVERAGEIFS and the previously noted
06:06COUNTIFS, all extend Excel's functional capabilities to even greater heights.
06:11This will eliminate the need for certain more complex Array formulas, but these
06:15are power tools to be sure.
Collapse this transcript
6. Statistical Functions
Finding the middle value with MEDIAN
00:01Many Excel users need, from time-to- time, to tabulate information and whether
00:05the data that you're working with is of a database-like nature as we see here
00:09in columns A through G or more spreadsheetlike in nature, for example, what
00:13we're seeing in columns K, L, M etcetera, invariably, the need for statistical
00:18function seems to arise.
00:20Strangely enough, in Excel, in the Ribbon, on the Formulas tab, you don't see,
00:25right at the beginning, Statistical functions as a category.
00:29Under More Functions, click here.
00:31You will see Statistical, and there's the complete list.
00:34And it's a pretty extensive list as well.
00:36Now, I'm not a statistician, and yet, like many people who use Excel, I do need
00:40to get to certain features and functions.
00:43And here's one right here that we want to talk about a bit, MEDIAN, and it's a
00:47fairly well-known measure, even if you haven't taken statistics, I think most of
00:51you have a sense of what it does.
00:53I see it referred too often in day-to- day life when talking, for example, about
00:56housing prices, and a median value is often contrasted with an average.
01:01And the definition of median is the middle value from a list of values.
01:05And as you know, sometimes you want to use a function.
01:09You can simply click here, and what I'm going to do is simply click into the
01:12worksheet here, and maybe contrast this, first of all, with average, the
01:16average, for example, salary, a quick way to get here would be to type =average,
01:22there are other ways to get here as well, and simply refer to the entire column
01:26and we have that information at our fingertips.
01:28Adding up all the salaries, dividing by the number of entries.
01:31Let's do contrast this with median, and the MEDIAN function simply looks for a
01:36set of values, in this case, perhaps column F. Again, what's the median salary?
01:41So rather than sorting the data and finding the one in the middle, this does
01:46all the work for us.
01:47Now, by definition, median means find the middle value.
01:52If there's an odd number, it's the one in the middle. It's the one.
01:56There are an equal number of entries on either side of it.
01:58If it's an even number, Excel simply takes the two middle values and comes up
02:03with an average of those two to provide a median.
02:05And so, from time-to-time, you'll need to contrast this with average and make
02:09your own conclusions about that.
02:11Similarly, here is a set of data, so it doesn't always have to be a column.
02:15It doesn't always have to be from a database's style listing here.
02:18Here too, we might want to compare the two.
02:20We're not always doing that with average and median, but why not do that here?
02:24What's the average of these numbers here? It's 577.
02:28How about a median?
02:29The same set of data and I like this.
02:33Here, the difference seems to be more substantial than I would have thought.
02:36Sometimes there's a closeness there, so,
02:38again, without drawing conclusions, necessarily, do be aware of the ease of using this.
02:43It's at your fingertips and it's one of those things that nearly everybody needs to use.
02:47Exploring those Statistical functions from time-to-time will reveal others that
02:50may or may not be of value to you, but there are quite a few of them.
Collapse this transcript
Ranking data without sorting with RANK
00:01In dealing with large sets of data or a database-type list, one of the things we
00:04all need at different times, we don't need a function for it,
00:07is simply to reorder the list.
00:09It might be valuable to look at this list with the salaries from high to low.
00:14We want to rank them that way, or in the reverse order, possibly.
00:17But at the same time, we might also want to carry with us, along with the data at
00:22any time, that is, a ranking, and it will change based on the adjustment of some
00:27of the salaries or the elimination of some of the records here.
00:30We'd like to have at our fingertips at all times,
00:32A ranking of the salaries here, and have it in a separate column.
00:35I have set aside two columns here and will show you how this might work in
00:40column C, if you want this to be a dynamic list and always know the ranking.
00:45We do need a function here, and sure enough, it's called Rank.
00:48It's pretty simple and straightforward.
00:51We are trying to compare this value here with all the other entries in column
00:55B. If column B has nothing else in it, simply comma, using the entire column reference.
01:01That's it for the first one.
01:02That's the 74th highest salary. This is top down.
01:07The number one salary, the highest salary will have the value of 1.
01:10So we'll copy this down a column by double-clicking the Fill Handle and
01:15here's the first salary.
01:16And right above this, notice something, and it's coincidence that these
01:20happened to be adjacent.
01:21But it's not coincidence, perhaps that they are the same.
01:24Because that's going to happen from time-to-time and the concern sometimes is
01:28what does ranking do?
01:30Well, these two entries share the second ranking, they are the second highest.
01:36And Rank ignores, in this case, a third rank and the next entry that you would
01:41find in the list, numerically is not level 3 or third highest, but the fourth.
01:48And, of course, the way to explain this is this is the fourth highest entry.
01:51That's true, this is the fourth highest entry because up here we've got the
01:55first highest and these share second and third, but we see the number 2 there.
02:00If you really needed to have this displayed in such a way that you've got 1,
02:03two 2s and then you want that number 4 really to be 3, then you will have to
02:07explore that using array formula which were much, much more complicated than
02:12what we are using here.
02:13So Rank does the job and I think most people would be happy with the way it does it.
02:18Now based on certain kinds of data, not necessarily salary data, but sometimes
02:22it makes more sense or your need is based on saying well, for example, I want
02:27the lowest sorry to be 1 and then the highest salary to be 99.
02:31Sometimes you want a reverse order here.
02:33And there is no X rank or D rank or some other way to say this.
02:37We simply have to put together some functions here.
02:40And what we need to know is the total count of salaries, or, expressed in a
02:45different way, we begin with the idea we want to know how many entries in
02:49column B have values.
02:51In other words, we do not want to count B1.
02:53The function we are talking about here is Count, and its purpose simply is to
02:58tell us how many cells in this particular range, namely column B, have values?
03:04There are 99 of them.
03:06So they are actually 100 rows of data here.
03:08Row 1 has the labels and all the other rows have values.
03:13So they are 99 entries here and what we want to do with that value is subtract
03:18from it the ranking.
03:19Now we could possibly use the data in column C, but let's do this as is if we wanted
03:23this completely separate in its own column.
03:26We want to repeat that same calculation for rank.
03:29How does this salary, comma, compare with all the others in column B? and because we
03:35don't want a zero in one of our answers, and we would get that here,
03:38we need to add one.
03:40So this first person's ranking now is 26, and as we copy this down the column by
03:45double-clicking the Fill Handle, we see the entries this way.
03:48So the entry here that is first is now the 99th and somewhere in this list we'll
03:54see an entry of this 1st in our new way of calculation.
03:57Here it is, and previously this had been 99.
04:00So that's how to do a reverse order here.
04:02Now there are other times, too, when maybe these rankings are more interesting
04:06when you're dealing with a smaller group of data.
04:09Again, in a larger context, if this is near other information, we might want to
04:13do a ranking here and a little shortcut that will come in handy from
04:17time to time, which you can use in a lot of functions and formulas,
04:20Why not just highlight the data all at once here? =rank.
04:24We want to compare this entry here, comma, with all the others in column I.
04:29Simply hit Ctrl+Enter here and we've got our ranking there, and here too,
04:34you'll see some repeats.
04:35This is the fourth highest, but this one too is also fourth highest, so there is
04:39no fifth entry in there.
04:41So similarly used, although with a much smaller group of data, the Rank function
04:44certainly has its role to play in showing us rankings without necessarily
04:48forcing us to sort the data.
Collapse this transcript
Finding the magnitude data with LARGE and SMALL
00:00A common function known by many Excel users is simply to find the highest value
00:05from a list of entries.
00:07And in cell I2, we see the Max function meaning Maximum being used, the highest
00:12salary found in column F is simply this value here, straightforward.
00:18I remember, for years, not necessarily needing but then suddenly needing a way to
00:22calculate the second-highest entry in a list and also third and I ended up
00:27sorting the data and that was okay for the moment, because I just simply wanted
00:31to see the information, but certainly there are times and there have been times
00:34in my situations too where I really need to tabulate the information.
00:38I want to know the second-highest salary or the third, based on any ranking that I might need.
00:44The function is called Large.
00:47Pretty easy, pretty straightforward, where are we looking here?
00:49For example, in column F, Salary, comma. Want the second-highest salary? Put in a 2.
00:56It's as straightforward as that.
00:58If you wanted to build a list of these like, I've already got the highest
01:01here, and it's going to put in some numbers over here, but 2, 3, 4, 5 and we
01:06could work off of that and create a little list of, if we wanted to see the
01:10five highest salaries.
01:12So instead of this being a 2, just make it referred to a cell that has that
01:15value in it, and recopy these by double- clicking and we have all these entries
01:19and a quick format, it looks pretty good, and there we go.
01:22Easy to use, the Large function. Just like that.
01:26Rather than trying to come up with some obscure way of taking the original value
01:30and subtracting from our total and so on, there is a Companion function, and sure
01:34enough, you guessed it.
01:35It's called Small and works, of course, from the bottom up.
01:38Looking at all the entries here, what's the second smallest?
01:42If we really want to find the smallest, of course, we could use the MIN function.
01:46But we may want to know the second smallest, third smallest, etcetera.
01:49Second smallest is 8,904.
01:50That's one of our part-time employees here.
01:54So quick and easy to use, the Small function, the Companion to Large.
01:58One of those functions that you don't necessarily need, but when you do need
02:02the capability it's there and it's a reminder that there are so many different
02:05functions in Excel you just might not have had the need for until one day, and there it is.
Collapse this transcript
Tabulating blank cells with COUNTBLANK
00:00In looking at the information you are seeing on the screen here,
00:03in column G, you see that some people have benefits, the D presumably for
00:06Dental, M for Medical, R for Retirement.
00:09Not everybody in this list has a benefits package.
00:12We might want to know, who doesn't, or perhaps, from a different perspective,
00:17how many people do not.
00:19In other words, what we'd really like to do is come up with the way to count the
00:22entries in column G that contain spaces.
00:24A COUNTIF comes to mind as one possibility.
00:28But there is a function that gets directly to the point and it's called
00:31COUNTBLANK, and this example here, let's just highlight the cells we are looking
00:36at. It would be in column G here, just highlight these cells.
00:39Now this is a larger list.
00:41This is more of a drag perhaps, but nevertheless, not too big here.
00:44How many blanks are found there?
00:46And that will tell us. How many people do not have benefits? It's 28.
00:50That's the number of blanks we found in column G. And if you are using that with
00:56a larger list, be prepared either to drag or possibly to type in the entry.
01:00If you refer the entire column, you will be coming up with a value like this, or
01:04near something like this.
01:06This is the total number of rows in Excel 2007 and so a simple COUNTBLANK here will
01:12reveal and this might be trivia, but on the other hand just to point this out,
01:15if we do this for the entire column G, that number is based on this minus the
01:21ones where there are entries.
01:23So the other question that might come out of this is, how many people do have benefits?
01:27And so here what we'd use is equals and we'd probably start off with just a simple
01:31idea of how many entries in column G do have any data at all, with count A? And
01:39this will tell us how many actual entries there are in column G, and one of
01:42those is G1, so we'd be mentally subtracting 1 there.
01:46So there are 71 people who do have benefits here.
01:49You could approach to that in a different way with COUNTBLANK function, but I
01:52think this is probably the better way to do it here, simply subtract 1.
01:56Now, another technique here, too. If you'd like to fill in the blanks here,
02:00you can't click column G, and not so well-known is that on the Home tab, in the
02:05Editing group, on the extreme right side, under Find and Select, there is a Go To
02:09Special and you could click that button and choose just the blanks here.
02:14So all the blank cells are highlighted, and not the ones below the data, but
02:18just within that solid cluster of data here.
02:20You might just want to put in here N/A possibly, or any word that might be appropriate.
02:26If you do put in N/A, it might get lost in the mix, so you might put in the
02:29space, put in some hyphens or something. Do that in a way that makes it stand
02:32out, and just type Ctrl+Enter to complete the entry and those will all be
02:37filled in with NAs.
02:38That's a thought, not necessarily related to what we are doing with COUNTBLANK
02:41but that might have some merit, in its own right.
02:44Now as we look at the information over here, here is another example, and
02:48just to point out that we are not always looking in a single column or in a single row.
02:52How many blanks are here?
02:53You can see pretty clearly, there are three.
02:55But just point out the idea that COUNTBLANK certainly has its uses here and
02:59there to give us a quick count of how many cells, here, contain nothing in
03:04this group right here?
03:06And here the answer is going to be 3.
03:08So a quick, easy-to-use function which has its uses here and there, as you are
03:12trying to tabulate information from various sets of data.
Collapse this transcript
7. Date Functions
Understanding Excel date/time capabilities in formulas
00:00The Excel Date Time system is comprehensive and very powerful and valuable.
00:06Many people really need to use Dates and Times in their worksheets and they also
00:09need to do some tabulation with them.
00:11I think a lot of people also overlook some of the capabilities of Excel's
00:15Date and Time system.
00:16It's a long story to talk about where the Date system came from and its origin
00:21and how it all works.
00:22But often it boils down to this.
00:24A date entry in Excel, if you follow certain basic rules, actually stores a
00:29value in the cell, and although you don't necessarily need to see that value
00:34it is the core behind how the entire Date system works.
00:38If you do enter dates properly in Excel, you can later figure out what day of the week it is.
00:44You can subtract dates.
00:45You can look into the future, into the past.
00:47You can indicate length, and some of the things we are seeing on the screen here
00:51in column B suggest things we do with dates.
00:54In column D, there are a few dates and couple points here about data entry too.
00:59If you're entering dates that are in the first decade of the 20th century,
01:03first of all when you type in a month most people don't type in 08 for August.
01:07They will simply type an 8. That's fine.
01:09And always use slash or hyphen.
01:11That optimizes your use of the system.
01:13Whatever is more convenient for you.
01:15I think slash is more common, month/ day, and if it's a one digit day just
01:20the simple day, 8/3/.
01:23If this is a 2007, put in a 7. That's it.
01:26Good enough.
01:28The other thing you should do when you're putting in dates and you might already
01:31be seeing something in column D that looks a little bit strange.
01:34Make the column wider. I am doing this here on purpose now. Of course something
01:39does look a little bit different and you probably know as most of us do that
01:42there is no November 31st.
01:45You wouldn't have seen that obvious typo, if the column was as narrow as it had been.
01:50So just at least temporarily, you can later adjust it, for Date columns, make it
01:55wider than is necessary and impossible dates like this. 2/29. Now it doesn't
02:01make any difference whether you put in a four digit year or not.
02:04You can't fool Excel.
02:05There is no such date, so it becomes left aligned.
02:08Now you will defeat the purpose of this indicator, if you happen to have a
02:13column right aligned.
02:14Now just the label is here, but if we make the entire column right aligned,
02:18you are not going to see those typos and you might have some bad dates in there.
02:21So don't keep it right aligned.
02:24So make the data entry as you wish.
02:26There's some other issues here that might surprise you regarding Dates and Times in Excel.
02:32Here are two dates a year apart.
02:34Well, actually they are not a year apart, are they?
02:36They are a century apart practically, but it does bring up an issue here.
02:39You see the numbers over here, 30-99.
02:41I have put them there for reference.
02:44Any entry for a year that you might make, and if you were typing this and say
02:48you're dealing with issues regarding ages of people, maybe this is the Social
02:52Security office or it's an office of a retirement community.
02:55You got the ages of people possibly.
02:5712/3/30, what happens? It becomes 1930.
03:03What if you type 12/3/29?
03:07You are thinking of a person who is exactly a year older than the other
03:09person and you hit Enter. What happens?
03:12It's 2029.
03:14Microsoft has decided and they made this decision 10 years ago, and they'll
03:18probably have to change the default entries in another five years or so.
03:22Any time you put a year in a date entry that's 0-29, it's in the 21st century.
03:29If the year is 30-99, it's in the previous century, the 20th century.
03:35Now, if you use four digit displays, you will see the result immediately
03:39adjusted and of course the solution here is to type a four digit year when necessary.
03:44But if you do have these displayed, for example using format cells with a two
03:48digit year, you're not going to see this difference, and here and there
03:52it's going to cause some problems down the road, as it might here.
03:56That's 1930, this is 2029, you can see that in the Formula Bar.
04:00Now some basic issues here with Date math.
04:03In cell B3 we want to know how much time has elapsed between these two dates,
04:07how many days?
04:09This might have to do with a person's tenure within an organization.
04:12It might have to do with that copying machine down the hall, which just went on the blink.
04:16How long have we had it?
04:17Let's subtract these. The unit of measure in the Date Time system is one equals a day.
04:24Equal higher date, the later date minus the earlier date.
04:29Now, what you don't necessarily know, I mentioned the fact that Excel is
04:33actually storing values here.
04:36The entire Excel Date system begins January 1, 1900 goes all the way until the year 10,000.
04:42And whether you know it or not, when you're entering a date you are actually
04:45putting in a value, provided it's a proper date.
04:48If you want a quick look at this, and it's not critical, you might click the comma button.
04:52It's in the number group on the Home tab, and you would see this value and
04:56of course there is another value for this and Excel is just subtracting the values there.
05:01Now, we can look into the future just as easily.
05:04By the way, I meant to point out here too, in Excel 2003 and in all prior
05:09versions, when you subtract dates, the answer comes up as a date and
05:13it really is unsettling and you have to kind of know what you are doing and then
05:16turn it into a value.
05:18But in 2007, they have corrected that so that works nicely.
05:22Sometimes you will have to look into the future.
05:24When is 1,500 days from the date of this installation?
05:27Equals that date plus the 1500.
05:30Remember unit of time is a day.
05:331,500 days into the future, there it is.
05:36And certainly looking into the past, the same general idea.
05:3990 days ago, if this were today's date or the date in question equal this minus 90.
05:47There we go, 90 days ago.
05:52Not only can Excel handle dates, but it also handles times, and you want to be
05:56thinking of time as a portion of a day.
05:59And here too, there is a value being stored.
06:01It's a little bit past 8 AM.
06:02That's roughly a third of a day, and again, you don't usually need to know this
06:06or think too much about it, because Excel can handle time math as well.
06:11A quick look here, just with the comma button, it's .34 days.
06:16So a day is broken into hours, and if we did this by math, for exactly 8 o'clock,
06:21that will be .3333 etcetera.
06:23Noon would be .5 and so.
06:27Usually, you don't worry about that.
06:28Two different entries here.
06:30Now how do you make time entries?
06:32If you simply put in a time, if it's below 12 hours, it's automatically AM.
06:37So an entry like 8:13 is automatically, whether you see the AM or not, it's an AM entry.
06:45If you type 4:41 and do nothing else, that's 4:41 AM.
06:52And you got two options there.
06:544:41 p, Enter, good enough.
06:59It puts in 24-hour style.
07:02And of course you could have typed it as 16:41 if you're familiar with
07:06that style of reference.
07:08So on putting in those kinds of times, think about what's most convenient to you.
07:13If we subtract times, we sometimes get a slightly funny variation on this.
07:17Equals a later time.
07:19That's this minus this.
07:218 hours 28 minutes.
07:24Because this cell was previously formatted, it looks like this.
07:27Sometimes you'll see AM and PM in the answer and that throws you a little bit.
07:31So you'll have to reformat that or make it look proper, if it doesn't.
07:35Now the question also comes up, what if, because maybe it has something to do with
07:39working time and you say, well, I took 45 minutes for lunch.
07:42You're going to subtract 45 minutes from this.
07:44Well, one thought that might run through your head is, well, an hour is 1/24th of a day.
07:49If we subtracted 1/24th from this, it would be an hour less.
07:53But we are talking about 45 minutes and that's three quarters of 1/24th.
07:57I mean, you could do the math.
07:59That's one 32nd and so on.
08:00So, that's a little bit clunky and cumbersome and kind of geeky too.
08:04But surprisingly you can actually subtract a time this way, "0:45." 45 minutes less.
08:157 hours and 43 minutes we are talking about here.
08:18And you can also do time math across multiple days.
08:21Now you can't make the entry like this, but if you look at these for a second or two,
08:25you will see if it had been on the ending date here 6 PM, that would be
08:30exactly 2 days or 48 hours.
08:32So it's three hours short of that.
08:33It should be 45 hours.
08:35I'm going to move these over here for reference.
08:37How do we put an entry like this in here?
08:40And you can do it in one cell, 11/18 is the date, /9.
08:47We could type it that way even, space, and it's 6 PM. How about 6 p?
08:52Enter. Notice that it does go in the standard kind of way and that is a value
08:57being stored there.
08:59Same idea here, 11/20/9 3 p, Enter.
09:08When we subtract the two here, equal the later time minus the earlier time,
09:14we are hoping to see 45 hours.
09:18But we get a strange number.
09:20So immediately let's jump right into Format Cells, and of course we would want
09:26to display this is as a time, and this would be the choice to make.
09:31We don't want to see AM/PM here because we are subtracting times.
09:36And yet that's not right either.
09:38So what's going on here?
09:39From time to time when you're dealing with time math, either addition or
09:43subtraction, you need to do a special format.
09:47Unfortunately, Excel doesn't tell you what to do here in the Time category in
09:52the list of examples here.
09:53The one with the 37 is the one that we need to use.
09:56Now, certainly not obvious.
09:58Since we don't care about seconds here, the other fix you'd probably want to
10:02make here is to jump over into Custom once you selected this and keep only the
10:08hours and the minutes in the display here.
10:10The hours within brackets means that it will handle hours over 24.
10:15To look at that number again, that's 24 hours short of what it needs to be.
10:19Click OK, and finally we get our answer there.
10:21So you can tabulate times across multiple days.
10:24I think you can see there is just a wealth of opportunity here for any situation
10:29where you have got dates and times, and you're trying to measure the various
10:32kinds of differences that occur with these kinds of entries.
Collapse this transcript
Identifying the day of the week with WEEKDAY
00:00An important piece of information when dealing with Date data can be day of the week.
00:06For example, you're trying to tabulate sales.
00:08Are sales better on Tuesday or they better on Thursday?
00:11You have got a huge list potentially.
00:13Let's find out what day of the week a particular date entry happens to be.
00:18In column A here, we see some sale dates.
00:20We would like to know day of the week, real convenient function, =weekday.
00:25Unfortunately, the answer is not appealing. What does 2 mean?
00:29Monday. 1 is Sunday, 7 is Saturday and so on.
00:33In order to make this appear as a day of the week, we have got a couple of quick
00:37options but we do have to make a formatting change.
00:40Looking ahead here we can simply double-click to see the others.
00:43The number that might out here could be a little strange depending upon the work environment.
00:47Maybe this is an operation that was not open on Sundays.
00:50So this emerges as a Sunday.
00:52That's the weekday of that particular date.
00:56So maybe that's a mistake.
00:57Maybe it's a typo or something weird happened, but that would certainly get your attention.
01:01But if we want to see the actual day of the week here, might as well format all these at once.
01:06Jump right into right-click Format Cells, and a Custom format consisting
01:14simply of 3 d's, if we would like to abbreviate it, so it would look like this.
01:19Or same place, right-click Format Cells, 4 d's to get a full spelling, if that's important.
01:26The key idea of course is the numbers by themselves do the work but you got to
01:30make the display be worthwhile depending upon who needs to see this.
01:33So that might be a better approach.
01:35And maybe that's a typo and maybe not, but you will certainly look into it.
01:39So that's good information.
01:41And the other issue that might come out of this, someone is looking at this
01:44and saying, "could we sort this and look at all of our Monday sale dates today here, could we do this?"
01:48If you were to do a sort on this, what's actually being dealt with here,
01:53what's happening in the background?
01:55If we jump into the Data tab and use the AZ Sort button, that contiguous
02:00data will be sorted.
02:02And we see what's happening here.
02:04Now because the numbers are underneath it or behind the scenes, that's why it's working.
02:08So here are all of our Monday sales and again, imagine how this might play out
02:12with a much larger list if you need that sort of order.
02:16Sometimes we need more sophisticated use of this.
02:18Let's talk about this idea.
02:20In your organization you've got the product.
02:22When a sale occurs then some packing has to be done, some assembly possibly,
02:29before this is ready to be shipped.
02:31And maybe these are some kinds of large items, four days have to occur before
02:35the shipping date here.
02:36So we could do simply, = whatever the value is plus 4 to set up a shipping date.
02:43So you can see what would happen here.
02:45However, what if the shipping date is a Sunday and you don't do shipping on Sunday?
02:49So what we might do in a situation like this is in effect say, okay, we want to
02:53do this most of the time, but on the other hand we might want to put in a check
02:57here to see if the weekday of this four days later, this there right here.
03:05If the weekday of that =1, meaning Sunday, then what do we want to do with the
03:10shipping date, what do we want it to be?
03:12We want it to be this date Plus 5.
03:15Otherwise we will turn it into simply this value right here.
03:20I am hitting Ctrl+C here to copy it and make that be the answer.
03:25So once again, if the intended four day difference there turns out to be a Sunday,
03:31we don't want that to be the shipping date.
03:32We will add 5 to the date.
03:35Otherwise, we will simply keep that date plus 4.
03:38So as we tabulate this here, and of course we don't know the answers at glance here,
03:41but that's a simple choice here of the difference of the two, equal this,
03:47minus this, Ctrl+Enter here because they are all highlighted.
03:51Here and there we see what's happened. This got bumped into a Monday and so did this one.
03:55So different creative uses of the Weekday function, and you can imagine possibly
03:59setting up some data validation rules to do this in a slightly different way.
04:03But again, that Weekday function gives us potentially valuable information.
04:08Imagine analyzing your workflow and a variety of different business issues that
04:13are going to come up when you know the day of the week.
Collapse this transcript
Counting working days with NETWORKDAYS
00:00In dealing with dates in Excel, sometimes you need to know not just the
00:04difference between two dates, the number of days elapsed but the actual
00:07number of working days.
00:09For example, Monday through Fridays.
00:11And even though some operations work different numbers of days of the week,
00:14we are talking about working days, meaning specifically Mondays through Fridays,
00:19not Saturdays and Sundays.
00:21An illustration of the issue and the differences might come up simply when we
00:25are trying to measure the difference between two dates, and notice this initial
00:29set of dates here is being repeated in the next two rows.
00:33How much time is between the two dates equal the later date minus the earlier date,
00:39and there is the answer.
00:41Now that does include Saturdays and Sundays, and so that's not a pure measure of
00:45actual working days.
00:47In this case, we need to use a function called NETWORKDAYS.
00:50It's one of those longer functions.
00:54So when you are typing it, =n, we see the list of all the others.
00:59You could possibly just click on this instead of typing it and use the Tab key
01:02to save yourself a little bit of time.
01:04The starting date is the A3 cell containing June 11th, Comma.
01:09The ending date is September 14th.
01:13Now there is an additional optional third argument, which I'm going to ignore
01:16here, and you do know of course, there are holidays between those two dates.
01:20We will simply hit Enter here.
01:22And a major difference of course between the previous entry, because we are now
01:27not counting Saturdays and Sundays, but there are some holidays in here too.
01:31And in some organizations July 3rd was a holiday because of the weekend and so on.
01:36Here is July 4.
01:37It happened to been a Saturday in 09.
01:40It will not be discounted twice because it's already a Saturday.
01:44But let's see how this is going to work a little bit differently.
01:47In the next use of this and to simplify it I will copy this first and then
01:51adjust this to now take into account the holidays.
01:56Although, I could highlight just the cells in question, why not just
01:59highlight all of these?
02:00It might make it simpler to copy.
02:02If we are going to be copying this too, we do want to make this be an
02:07absolute reference.
02:08So I will highlight that and hit F4.
02:10So in this case now instead of 68 days, it's 66 days.
02:14And the difference is this time around not only did it not copy or include
02:19Fridays and Saturdays as in the previous case, but in this case here it also did
02:24not include these dates here.
02:27And again, because one of those was already a weekend, we didn't get the
02:29double count on it.
02:31And so tabulating into the future, and we have got our list of holidays, that
02:35list could go across many years if you wanted to.
02:37We will simply double-click and see the differences here.
02:40Now one of these, I made a mistake on the entry, so we will simply adjust this here.
02:44We will make the one over here be, for example, make it just be the first.
02:48That's a short entry for sure.
02:49But we see what's happening there, just 9 days.
02:52So you can see how this plays out.
02:54If you're trying this in previous versions of Excel by the way you might not be
02:58able to get to the function because it was one of those special functions that
03:02require the addition of the Analysis Tool Pack.
03:05So it's automatically built into Excel 2007, and very valuable in some situations and easy to use.
Collapse this transcript
Determining a completion date with WORKDAY
00:00If you are dealing with data entries, and trying to calculate into the future
00:04how long a project might take, for example, the information in columns C and D
00:09is setup automatically.
00:11Notice that I have put in the starting date in the Project Length three times
00:15here to illustrate a difference.
00:16A simple use of the method to add dates and times allows us to simply say equals
00:23this value, plus this 60 days from June 11th is this.
00:28Now unless your environment is a 24x7 kind of operation, this would mean the
00:33project beginning on June 11th working day by day by day takes 60 days, it would
00:37be finished on August 10th.
00:40But many, many operations don't work Saturdays and Sundays, so we don't want to include those.
00:45So for comparison here let's use a function called WORKDAY.
00:49The WORKDAY function begins with a starting date at June 11th, comma. And how many days?
00:57We will be working 60 days.
01:00We do not want to count Saturdays and Sundays.
01:02And the optional holidays we'll show you in just a second.
01:05So when is this completion date now as we look at it?
01:08Now it's quite a bit later.
01:10It's on September 3rd, but there are potentially some holidays in the next year.
01:16And having a list of holidays nearby will make a difference. In this case,
01:20we got a couple of dates that July 4th weekend. Maybe not a huge difference.
01:24Let's do the same sort of thing here.
01:26Copy this and adjust it by putting in holidays.
01:30Now you can certainly include a list that goes well beyond the holidays we need,
01:35but let's say we might be using this list from time to time with other dates in
01:38the same column here.
01:40So we'll highlight them all, and make that be an Absolute Reference and
01:45a different ending date than we saw previously, and then the other examples and of
01:48course the difference here is that the July 3rd which was a Friday is not
01:52included, July 4th is the Saturday, it wasn't included anyway, and I am going to
01:56quick double-click here gives us some other completion dates.
02:00In all cases here the function is taking into account, not the Saturdays and
02:05Sundays and not the holidays that are part of that list that we see over in
02:10column A. So easy to use just sort of variation on the other kinds of DATE
02:14functions, but again it gives us that quick ability to tabulate information and
02:19not include Saturdays and Sundays.
Collapse this transcript
Tabulating date/time differences with DATEDIF
00:00If you're trying to tabulate differences between dates, there is a great feature
00:05in Excel that you might not be able to find.
00:08In fact it's a function that you will not find in the Excel Help System and is
00:13called DATEDIF, and interestingly enough anytime you type the equal sign
00:20followed by a letter, you'll see functions that begin with that letter and where
00:24is DATEDIF? It is not there, and start looking to the Excel Help System, if you'd
00:29like to waste a lot of time, because you will not find this one.
00:33And I am not sure why Microsoft has taken that approach.
00:35This has a number of great options.
00:37I think most people will use it most often in the following way.
00:41We are trying to tabulate the difference between two dates begin with the
00:45starting date, in this case the starting date is in A2, the ending date is in B2.
00:52Quick math in your head.
00:53That's about six years.
00:54But we can make the answer be a variety of different things and the answer in
00:59this case perhaps, we want to know, years.
01:02Now, we are not looking for a fraction here, how many whole years has it been.
01:05It's been six years and a few days, but within double quotes, we will put in the
01:10letter Y. Now notice over in Column E, we have some other options.
01:13That's it, how many years, and I'll do a quick double-click here so we can
01:17see what's happening.
01:19In the other entries and column A and B, it's equivalent to what we do
01:23with birthdays as well.
01:24So let me change a date here, and you can imagine what it might be doing here.
01:28I am going to change the starting date here to be July 1st.
01:34And you can say well that person has been here almost 6 years, while yeah, almost.
01:37But this is what we do with our birthdays, if you are sensitive about that as
01:41all of us tend to be after a while. You're 39.
01:43You are not 40 yet, until that date maybe. This is exactly what it does.
01:47It's like an anniversary date.
01:48So that certainly has its role to play, Y. Now in doing this with live data,
01:55what you sometimes will want to do is maybe not have an end date, but maybe have
02:01today's date in here.
02:03Now at the time of this taping, it's November 4th of '09.
02:07But let's put in the function called TODAY, followed by two parentheses.
02:12That's the function and we get a different answer here.
02:15And again, it's November 4th of '09.
02:17In this case let me just hide this to get that out of the way for the moment,
02:21think of November 4th, '09 and recopy these.
02:24Now for some kinds of worksheet structures, this might be a starting date.
02:28This might be years of service.
02:30How many years has this person been here?
02:32And again, these are like anniversary dates or like birthdays in that sense.
02:36If we use Y, and again it's not always that you would use the TODAY function,
02:41but for those kinds of situations, it would be an ideal use of it.
02:44Let me revert to the previous example because we have that on the screen, and
02:47I'll come back and unhide this, and go back to a previous use here of actually
02:53using that date that we see there because it's a better visual reference here, and a recopy.
02:59Now we could tabulate the number of months.
03:01You're less likely to need this, but still how many months have elapsed there,
03:05and again, four months and one more day and that would be 72 months.
03:10That would be exactly 6 years.
03:116 times 12, you get the idea of the months.
03:15But notice some other combination days again, probably less likely although in
03:19some situations if we were talking about equipment, or program or something,
03:23how many days has that been around between those two dates or how many dates
03:27was it around, 2191.
03:29So that's a day tabulation.
03:31But in other case as you're trying to figure out how many months have occurred
03:34since the last yearly anniversary.
03:37So we put the YM here, how many months since the last anniversary.
03:42Now this person here, since I changed the date.
03:45It's almost 12 months, but not yet.
03:48It's still the 11 months, since the last yearly anniversary.
03:51Again changing the date for a different reference point here.
03:54What if this had been October?
03:57That's about four months short of the year. There we go.
04:01It's 8 months since the last yearly anniversary.
04:04In other words, looking at the data here, you can see how it's eight months
04:07since, in this case that would have been October 30th of '08.
04:11So you kind of get the idea, and you're less likely to use the other three here,
04:15but hang on, the number of days since the last yearly anniversary a quick look
04:18there using those adjusted dates. 116 days, and one last one, there you see,
04:25the number of days since the last monthly anniversary so the value here has got to
04:29be under 32, depending on where we are in this particular set of dates.
04:33So some really valuable information. Again, stressing the fact that Y is probably
04:37the most useful for most people and again bringing up the idea that you will not
04:42find anything about this in the Excel Help System.
04:44I use this all the time.
04:46I think it's great.
04:47So take a look at it and you'll just have to remember what you have seen here.
Collapse this transcript
8. Math Functions
Working with rounding functions
00:00A particular problem that many of you encounter when dealing with information is
00:05the fact that sometimes totals don't quite add up.
00:09We are talking about rounding issues, and there is a huge mistake that some
00:13Excel users make and that's doing rounding off of the ribbon by showing fewer decimals.
00:20Now here is a real simple example and if you were to try what I am about to try,
00:24you would say, is he crazy?
00:26These numbers here -- and with a total, we are adding up the numbers.
00:30So, no higher math here at all.
00:32Nothing unusual about that.
00:34You might say, well that would look better if they were all displayed in
00:38the same layout style.
00:39So, on the Home tab in the Number group, common choice here could be if they're $ signs
00:46and you probably don't want dollar signs on everyone, but it certainly
00:48wouldn't be wrong to use that.
00:49And this automatically gives us two decimal places, and that's a
00:52reasonable display.
00:54If you didn't want the dollar sign, why not the comma?
00:56Someone said, I don't want all that complication, don't show the decimals.
00:59Okay, you might try that.
01:03But you probably wouldn't leave it looking like this.
01:05It looks like five 5's equals 23.
01:07Now what's going on here?
01:10Well the total truly is accurate. However it's certainly not accurate based on
01:15the values that are showing.
01:16And is that really a five?
01:19You can look in the formula bar and see that it's a 4.6.
01:21So, I can imagine anybody keeping the format looking like this.
01:26But to say that we are throwing away the decimals, and that's the way some
01:30people think of this, is just dead wrong.
01:33And so what you need to do in a situation like this would be simply display
01:37those decimals, if you want any kind of coherence in the worksheet.
01:42Now this plays out in different ways with formulas.
01:45Here's a formula here that's calculating a new price for this item, and
01:49we're not looking at any sophistication here necessarily.
01:52You can see the formula.
01:53It looks like this.
01:54And it's all prepared to be copied down the column, but just a simple little
01:58issue might come up.
02:00Maybe this is the price of some office supplier or something.
02:02Maybe it's a stapler, box of rubber bands, and some international company
02:06orders 10,000 of these.
02:08So, just a simple little formula out here =10000 times this amount.
02:15Well, I can do the math in your head, right?
02:16That's going to be 90,000. And you hit Enter.
02:20Well, it's not 90,000 and it's not that much short percentage wise.
02:24Well that's $41.68, but that money has to be accounted for somewhere.
02:29It has to go somewhere, or not go somewhere, and that's a concern.
02:33So, what's going on here?
02:34Well, first of all let's jump back to the data here.
02:38This could have been displayed with more decimals.
02:41Often you wouldn't do that, but if we increase the decimals here with this
02:46button here in the Number group on the Home tab, we see that the real answer is this.
02:51Now as I do this, the calculation to the right is not changing in any way
02:57and you can see that.
02:58So, no matter how any decimals I'm showing here, we are not seeing any
03:02difference in the calculation.
03:05So, this is not changing the value at all.
03:07It's simply changing the display.
03:09And I couldn't think of any better way to show you how that's when you see it,
03:13that sure is obvious and yet some people will make that mistake of saying, well
03:17let's just round this off.
03:19Well, it's visual rounding.
03:21And in situations like this, imagine how this might get multiplied across
03:25other price items here.
03:27So, what do we need to do here to make this coherent?
03:30We need to round this at the formula level, and the Round function is the one
03:34most people are more likely to use.
03:37We embed the formula within that and then we round it based on decimals.
03:42Now, if we want us to go to the nearest penny and that would be $9, we would put
03:47in two, two decimal places.
03:50And as soon as I hit Enter here, watch the value in F2 change.
03:54Because we're changing this now to be exactly in this example $9, and the answer
04:00changes immediately, and this truly is 9.00.
04:04Now, we can share more decimals, not to change this, but certainly to change the
04:08display of it, to see the real value and there it is.
04:12That's the real value.
04:14So, we have altered the value by using the Round function.
04:17Now, if you had some scheme in mind that says well, all of our prices end in nine,
04:22you might play a game through this.
04:24By putting in 1 here, you are actually rounding it to the nearest 10 cents and
04:28then you could subtract a penny -0.01, if that's important to you. So that's 8.99.
04:37Other examples here, and we don't know what these are likely to be, but in this
04:40situation here, we'll drag it down a few.
04:42These are all going to end in nine, if that's your pricing scheme and that goes with this.
04:46Of course, the exact percentage of increase isn't really 4.36 anymore.
04:51But sometimes that's the pricing scheme or pricing mechanism.
04:54Now, at other times what you want to do, we'll do a couple of Undos here, to
04:58knock around to the nearest values that ends in 9 cents.
05:02Sometimes what you want to do with the situation here is to round in a
05:05different direction.
05:06The Round function uses standard techniques and as soon as we reach in this case
05:10a half-cent, it goes upward to the next penny.
05:14But sometimes you want to force it upward no matter what, and before doing this,
05:18what I want to do is make a copy of few of these here, just to see what it is
05:21using a typical round, and then we'll see how this might be changing.
05:25And the two companion function to this that override traditional rounding
05:30techniques would be ROUNDup.
05:31Now that probably won't change this one.
05:35It might change the next one. It didn't.
05:37It did change this one.
05:39And again, we are talking pennies here, but with similar situations using
05:43different rounding capabilities, this has some potential long-term impact.
05:48If we go back for a second here, I'll do an Undo.
05:51And recopy this calculation here.
05:54We are talking about 43,400. This is a ROUNDup.
05:59Make the next one to be a round up.
06:01Well it's $500 difference based on the scheme.
06:04And of course, you'd expect the other variation on this is to use a ROUNDdown,
06:09and the easiest thing to remember here is this is what we do with our ages.
06:12So, if you are 39 years and 11 months, there is 39 and we ROUNDdown to the previous year.
06:19In this case, that would be an 8.99 and again, not necessarily remembering what
06:23all these had been but here and there, these will drop depending upon what it
06:27might have been earlier compared with rounding up.
06:29So ROUNDup, ROUNDdown have their roles to play.
06:33And if you use a zero by the way instead of 2, that means round to the
06:36nearest whole dollar, and that might be a more appropriate thing to do here with salaries.
06:42In some organizations yearly salaries and here we are simply showing a
06:46calculation where an existing salary is being upgraded, all these salaries are
06:51about to be changed by 4.43%.
06:55If this organization decides not to carry pennies in salary calculations,
06:59probably what they would do here is to use Round, but in this case round zero,
07:04if they want to round it to the nearest dollar.
07:07So, zero as the number of decimal places, comma 0 and we see all these would end that way.
07:14And you probably wouldn't be displaying the pennies, but you certainly could.
07:17And here too a ROUNDup, ROUNDdown might make sense.
07:21But there is another angle too that you might not have thought of, and I have
07:24seen this in some organizations, just for ease-of-use, some manipulation,
07:27all salaries end in a multiple of a hundred.
07:31So, in adjusting these salaries, maybe we'll just change them to the nearest
07:35hundred and that would be -2.
07:38Two places to the left of the decimal.
07:41And so dragging down, where is that one going to go?
07:43That's going to go down to 69,500, next one up to 80,100 and so on.
07:51And here too, you could imagine the implications of ROUNDup and ROUNDdown.
07:55If we use ROUNDup potentially some of these could be different than simple
08:00entry by going up as much as $99.99, if we use a ROUNDup and of course there is ROUNDdown too.
08:08Another variation on these, and it's a three whole set of functions is sometimes
08:13you need to round the values that aren't necessarily decimally based.
08:17For example, a pricing scheme here might say let's just round these and then go
08:21to the go to the nearest nickel, the nearest five cents.
08:25In a certain description of that, you might say, wasn't that a multiple decimals?
08:28Well, possibly.
08:29But let's just make this simpler.
08:31Instead of using a ROUNDup or ROUNDdown, what if we use mround?
08:36This works a little bit differently.
08:37We want to take this calculation here, and round it to the nearest 0.05,
08:43the nearest nickel.
08:44In this case, it's probably going to be $9 again, but another example below
08:49this here, that's probably going to go up to 35 and you can sort predict based
08:53on what the entries might have been previously, up or down to the nearest five cents.
08:58We can see that here.
09:00And its corresponding companions to ROUNDup and ROUNDdown are not as you might
09:05expect mround up or mround down, but you may go upward. How about this?
09:11ceiling.
09:14It's going to go up to the next penny, so on some of these, they are going to change a bit.
09:19They haven't yet but that one went from 10 to 15.
09:23And sure enough, if you know ceiling, you know it's opposite. If we want to do
09:27the equivalent of a ROUNDdown when it's not decimally based.
09:30Here it's going to be Floor, same idea.
09:35Two other functions of note, INT.
09:37You may have seen INT.
09:39This simply ignores everything to the right of decimal.
09:42I doubt if we would be using it in examples here.
09:45Possibly we could've used it with salaries.
09:47You might want to take this calculation. INT means integer.
09:51And we are not talking about the nearest.
09:53We are simply going to ignore.
09:55In this case, we ignore everything to the right of the decimal.
09:59And who knows whether this is going up and down?
10:01We need the previous reference, but INT simply and that could have been the choice here.
10:06It simply drops the pennies. Just drops them.
10:10That's it.
10:11And a similar function called Trunc, short for truncated, works exactly the same
10:17unless you've got negative data.
10:20And the details are not worth talking about now, but if you ever have to
10:23strip-off decimally based data, usually it's going to be INT.
10:28But if you have got negatives, possibly INT or Trunc.
10:32And one other obscure one I just want to throw it in here. I doubt if we are
10:37going to use this. If you ever have a set of entries and you want to change
10:40them by rounding them up to the next odd number, or the next even number.
10:45So, here are some values here. I'll just do these all at once.
10:47One is Odd already, but suppose we want to take these to the nearest odd number,
10:52and I think I would use this once.
10:54Not that I am the judge of how often you'll use it, but nevertheless we see
10:57here what's happening.
10:58This takes us up to the next odd number, and similarly there is a function
11:02called Even that does the same kind of thing.
11:05We'll just use it here real fast, =even. This will take us up to the next even
11:10number in all these cases here.
11:13So, lots of functions for doing rounding. Keep the idea of the round function.
11:17I think for most people is going to be 90% of what you do, if you need this kind
11:21of feature, but just don't make that mistake of adjusting information with these
11:26buttons and think that you're really rounding, because you're not.
Collapse this transcript
Finding the remainder with MOD
00:00Among the many functions in Excel is a mathematical function called MOD, and
00:05many people when they see the description of this, they are likely to say, so what?
00:09What's the big deal?
00:10How would I ever use this, =MOD, what is this all about, MOD?
00:15It derives from the word module and that's not necessarily very helpful.
00:20Its purpose is to calculate the remainder in a division and again, that doesn't
00:25give you a good reason for using it.
00:27But here's a simple little example where I choose-- I'm going to show you
00:30another example as well.
00:32You got a bunch of items.
00:33Maybe these are warehouse type items and you're closing up shop in an
00:37organization and you got a bunch of items, and you got 162 of these.
00:41You want to put them back in their original container box and you can get 16 per box.
00:46Now if you do this for your various items, you're going to have some left over.
00:50So how would you do the calculation here?
00:52Divide 162 by 16, you'll get an answer. It's 10.
00:55You're going to have remainder of 2.
00:57How many items you're going to have left over after packing?
01:00So =mod and we don't put in a division symbol or anything.
01:07We just indicate the value that we're looking at, comma and essentially the
01:12divisor and the answer we get here is the remainder.
01:16With most of these, you could probably do the math in your head and so on, but
01:19you'll quickly see the answer here as we copy this into other cells by
01:23double-clicking that fill handle.
01:25So here, the same general idea. Depending upon the item and different
01:29number of items in each.
01:30That one has got a huge number.
01:32If that were 144, then we'd have 0 here.
01:37As we do in this one, because this is evenly divisible.
01:4024 times 7 is 168, and we get none left over here and you see the result.
01:46So here and there, there's that kind of application.
01:49Another one I use this for is a situation where I've got a database, maybe
01:54something like this or maybe something much, much longer, and for ease of
01:58readability, I'd like to have every 5th row, every 7th row, every 10th row, to
02:03be a different color.
02:05A number like 5 or 10 probably makes more sense.
02:07Some people might find 2 okay as well.
02:10And we're not taking about using a table feature in Excel, which is another way
02:13to do this, if you simply wanted every other row to be highlighted.
02:17Just select the entire worksheet here and use a feature called
02:21Conditional Formatting.
02:22So on the Home tab, Conditional Formatting, and let's create a new rule here.
02:27That's a great feature by the way if you haven't looked at Conditional
02:30Formatting, lots of colors and options, but how about a new rule here using this
02:35Mod function, a new formatting rule?
02:38Use a formula to determine which cells to format, and the formula will be =mod(,
02:45and another function you might not have used called ROW, and we actually want
02:54every cell in this worksheet in effect to be looking at this formula, and each
02:59cell in effect is going to be looking at its row number.
03:02By the way, that's two parenthesis.
03:04It sort of looks like a football there.
03:05It's an open and closed parenthesis.
03:07We will consider for every given cell, its row number and then ,5.
03:14In other words, we want to divide the row number by 5 and if that remainder is 0,
03:20that means it's row 5, row 10, row 15, etcetera.
03:24So in those cases, when the division of the row number by 5 gives us a 0,
03:29we want to use a special format and the more obvious one would be, although it can
03:34be any combination of Font, Border and Fill colors, I'll just use green here.
03:40Click OK, click OK, and every fifth row is green, and you can imagine having fun
03:46with that using different numbers and other combinations.
03:49And if we happened to delete some rows, and I'll just delete these, this will
03:53automatically readjust and every fifth row would be green, and of course,
03:57it will not be matching up with the numbers that we're currently seeing being
04:00green as I delete these.
04:02So that may not be the world's most important news, but on the other hand,
04:05it does illustrate how this MOD function, and I am sure, mathematicians who have a
04:10little more creativity using functions like this, but the two examples here I
04:15think you can see there is some real value with the MOD function.
Collapse this transcript
Building random number generators with RAND and RANDBETWEEN
00:00The ability to create random numbers might seem like an obscure need for
00:04many people using Excel.
00:06It's a mathematical function and it's a great mathematical tool.
00:10And the word random has different meanings for different people, but let's give
00:13you two examples of how you might want to use this particular capability.
00:17We're talking about two functions here.
00:19The first one is RAND, =rand and its purpose simply in an isolated case is to
00:27create a random number between 0 and 1.
00:29I am just going to put it out here in the middle of nowhere for the moment, =rand.
00:32It's one of these functions that has parentheses but nothing between the
00:36parentheses, just type it like that, Enter, and depending on how many decimals
00:41you've got displayed here, it's a random number between 0 and 1, and so that's
00:46not really giving us much rationale for using it.
00:49Now, here is a list of data. It's a database.
00:52It currently looks like it's sorted by department.
00:54There are times when you've got a list.
00:56Now it doesn't necessarily have to be an HR list like this might be.
00:59It could be a list of items.
01:01It could be a list of sales.
01:03Sometimes what you want to do is sort of a primitive version of quality control.
01:08You simply want to pull out some of these rows at random to review them, to see
01:12if the information has been processed, and it could be almost any kind of data.
01:16So how might you randomize this list?
01:19Well, we've got an empty column to the right here.
01:21Simply put in =rand here, left parenthesis, Enter there.
01:26You probably want to display at least something so you know that's not wrong there.
01:29So we could show a few decimals just to see what it is.
01:32Double-click to copy this down the column and use this as a vehicle for sorting
01:37the data, and to make it fall into place pretty quick here, give it a temporary title,
01:41practically anything.
01:42Just qq or whatever. That's okay.
01:45By the way, you may have noticed there.
01:46The numbers have all changed.
01:48This is one of those functions that adjusts every time you make a worksheet change.
01:52Now I could click over here and type in a number and hit Enter and they all change again.
01:56We're not going to let that bother us. Just leave this here.
01:59But if we use this as our sorting vehicle and the fastest way to do this,
02:04since it is adjacent to all of this data and this is not associated with the data to the right.
02:08This is an empty column.
02:10We could simply click the Data tab, hit the AZ or ZA button and it sorts
02:16the entire list and now as you look at this list, it is in no apparent order whatsoever.
02:22And in fact, the numbers that it was based on that were here got all changed
02:27again, and anytime you make a worksheet change, these change.
02:31Now we don't care about these numbers anymore.
02:33This list is in random order, and so we could throw away the numbers.
02:38Maybe if we needed to do a spot check of 10 of these, we'll just pick the
02:42first 10 and go at it.
02:44Review those and no others.
02:46Another approach to this could be something a little bit different.
02:48We might just type in an entry here, =rand().
02:55If for example, we wanted to do 10% of these, how about =rand()<10%?
03:02Type that and we're going to get true or false.
03:04Double-click to copy this down the column and 10% of these are true roughly.
03:09The others are false.
03:10So we could just freeze those if we wanted to, and then sort that way.
03:14That's a little more obscure and probably not as likely to be used, but
03:17again, another use of it.
03:19So eventually or at least, all of these are in random order.
03:21You'll decide what to do with them, but eventually, you would get rid of this column.
03:27A companion function of this, which I find useful because I prepare a lot of
03:31sample data and am forever adjusting it.
03:34In a real business-like environment, you're probably not going to use in the way that I
03:37might use it here, but for purposes of a certain example, I need some random
03:41numbers in here, and not numbers between 0 and 1, but numbers that are relevant
03:47to the context in question.
03:49And so I'm tabulating. It might be sales.
03:52It might be well ratings.
03:54It could be anything, but the values here typically are between,
03:57for example, 100 and 700.
04:00So here's a function called RANDBETWEEN.
04:03So RANDBETWEEN, and this deals with whole numbers.
04:08RANDBETWEEN, a lower value first, a higher value next, and since these are all
04:16highlighted ahead time, I'll just hit Ctrl+Enter and we'll adjust the
04:21formatting kind of quickly on the Home tab here.
04:23Just hit Comma, and don't show those decimals, there we go.
04:27We have got some whole numbers, and they too will change every time you make
04:31a worksheet change.
04:32Here and there with smaller sets of data, I've had situations where I didn't
04:35like the numbers, and so you can quickly regenerate them.
04:38I doubt if you need that here.
04:39Just by hitting F9, it will do a recalculation, and they all change.
04:43Some people could figure out a way to pick the lotto numbers maybe and don't like them
04:47and they'll change them.
04:48But if you did want these to freeze at some point, you can simply with the
04:52right-mouse button, drag these into another set of cells and immediately right
04:56back on top of the current ones, like when Copy Here as Values Only.
05:00So here and there, creating quick random data for samples, that's easy.
05:05RANDBETWEEN, and if you wanted to have a series of dates here, for the same idea,
05:12between those two dates, that's 2010 and 2011.
05:16That's two years of data there.
05:17Here we could do simply =randbetween, a starting date, an ending date, and we do
05:27want these to be absolute here, so we'll hit F4.
05:32We've got a bunch of random dates, and for the moment, those too will change,
05:35and so if you want to freeze them, the same idea.
05:38There are obviously some uses here well beyond the mathematical concept of a
05:42random number that might have some value, as you work with data, and either need
05:47to sort data in a random way or possibly create some sample data quickly.
Collapse this transcript
Converting a value between measurement systems with CONVERT
00:00If you deal with scientific data in Excel, you should probably know about
00:04the CONVERT function.
00:06Now some of the applications that we are going to be using there are quite common.
00:09Even if you're not in the scientific arena, I think they are going to
00:12be helpful for you.
00:13And in Column G and H, you'll see a few of these.
00:16If you check out the Excel Help System, you see quite a few others as well.
00:20The categories I have shown here Temperature, Liquid, Measure, etcetera are more
00:24commonly used but you will also see a set of conversion issues related to power,
00:28pressure, force, energy and magnetism, but let's just give you a couple of
00:33examples of how this might work.
00:34You want to convert kilometers to miles, so in cell B2, we'd use the CONVERT function.
00:39Many times when you make a mistake with the issues here, it has to do with
00:42upper and lower case.
00:44So the titles as you see them here, and I wouldn't normally setup titles this way
00:48but I am in this case to extenuate this idea.
00:51Here's the value of 180. It refers to kilometers. Comma.
00:56We are converting from what? "km", and we are trying to convert to miles "mi".
01:07So 180 kilometers is 111.8 miles.
01:11And certainly from time to time, you would want to do the opposite, so in
01:14the case here a CONVERT from these miles into how many kilometers, same general idea.
01:20And here too having seen the first example, you would know what to do.
01:24That's the unit of measure, and it's in miles "mi,".
01:27We want to convert to kilometers "km," we are all set. There we go.
01:33143.2 kilometers is the equivalent of 89 miles. And then Celsius and Fahrenheit.
01:43And here I have capitalized the two words to extenuate the idea that we will be
01:47using the letters upper case C and upper case F. Aame general idea here as we
01:52convert, and in this case this is the temperature, "C", "F." 98.6 is the
02:07Fahrenheit equivalent to 37 degrees Celsius and looking the reverse way here is
02:11the Fahrenheit of 90, what is that in Celsius? Same general idea, =convert.
02:19The value in question here is 90. So =convert.
02:24This time I can put it in the cell.
02:25You can of course do this with real values this way and this time I will be typing.
02:28I am just going to click on it, E3 comma, moving from Fahrenheit in this case to Celsius.
02:37And one more. The same general idea and here too I have not used capitalization
02:41to extenuate the idea, 100 meters, how many feet is that?
02:44We are converting from meters "m", into feet, and this time ft.
02:54How many feet is that?
02:57Here we go. 328 feet.
03:00And of course this is a mile as we know it. 5280, how many meters in a mile, or
03:05how many meters in this many feet?
03:09And that's in cell E8 and we are moving in this case "ft", "m".
03:20So 1609.3 feet in a meter. You get the general work idea. It works smoothly.
03:25There are tons of options. The ones being displayed over in columns G and H are
03:29perhaps a third to less than a half of the possibilities and you want to
03:33explore that a bit more.
03:34It also allows for various prefixes and we actually use them here for example,
03:39the K in front of M is kilometers and so on.
03:42There is a complete list of prefixes you can use as well.
03:45So anytime you got data that's in varying measurement indices, you might want to
03:51if necessary convert them into another measure by using some of the techniques
03:55and options available with the CONVERT function.
Collapse this transcript
9. Array Formulas and Functions
Extending formula capabilities with Arrays
00:00No matter how adept you are at using Excel formulas and functions, there are
00:04likely to be times when you are going to hit a brick wall.
00:07You're trying to come up with a formula and you just can't make it work to
00:11tabulate some information you trying to get at.
00:13Starting with a simple example here, in columns B and C and D, you see
00:19information about some items and simple multiplication formulas in column D
00:24are showing us the total for this order. The units sold times the unit price,
00:29simple formulas.
00:30We're adding these up to get a grand total for this particular set of orders.
00:35There are times when you don't necessarily need the interim information.
00:40The important number coming out of here might be this total.
00:44So how can we get here in a different kind of way? One thought might occur to
00:49you that you would like to say, let's multiply those two and then those two and
00:53then those two, and why don't we just do this all at once?
00:57Why can't we say =sum?
00:58Let's add up every one of these, times every one of those, meaning of course
01:06B2*C2 and then B3*C3 and so on and so on and so.
01:11And if you try this and complete the entry, you're going to be disappointed
01:15because it does not work and you might just give up there.
01:19Now an Array formula in essence allows us to perform actions across
01:24entire ranges of cells.
01:26It's not exactly a definition but the more examples you see, the more you'll see
01:30what these often have in common as we are trying to deal with information out
01:35separate columns or of separate rows, often in a parallel kind of situation.
01:40Now looking at this formula again, this will work if you complete the entry not
01:46simply by hitting Enter but by pressing the combination Ctrl+Shift+Enter.
01:52Now that's the same answer here.
01:55By the way look in the Formula bar, you will notice that the formula is in braces.
01:59It's the same answer we see in D11 but D11 is the total of the products that we
02:06saw earlier. The formula in C13 does everything all at once.
02:11Now if you start to edit this or you want to make an adjustment to it, if you
02:15click either in the Formula bar or you hit F2 in the cell, you don't see the
02:19braces and you don't type the braces.
02:22And I haven't joked about how it sounds as if I'm making this up as I go along.
02:26Here's the formula.
02:27You see it in the Formula bar.
02:28It's embedded in braces.
02:30They will not appear there unless you press Ctrl+Shift+Enter and when you edit the cell,
02:35you don't see them, and a common mistake when you're working with these
02:39and if you with work them only rarely, you will make this mistake often.
02:42You'll be editing here to trying to adjust it.
02:44You are going to press Enter, instead of Ctrl+Shift+Enter.
02:49For this first example of an Array formula, this particular function it wasn't
02:53necessary to use an Array formula because for situations like this, since they
02:57are more common than other array formula situations, there is a separate
03:01function you might want to know about called SumProduct and you could say it's
03:07a built-in variation on an Array formula that does allow us to take one set of data,
03:12comma in this case, not the asterisk and then another set of data,
03:16potentially others as well, and just a simple Enter here.
03:19We get the same answers as we got in the other cases.
03:22So SumProduct is a unique variation on the idea of an Array formula but it has
03:27its own separate function.
03:28So let's look at another situation.
03:31You'll see in column F and G in Order Date and the Shipping Date,
03:35what's the elapsed time here.
03:37Well, you can see there it's what 11 days and here it's quite a few more days.
03:40We don't necessarily have to know that.
03:42We might well know the average elapsed time of these orders and certainly as in
03:47the previous example we could tabulate that here.
03:50It would be a subtraction.
03:51We could take this date minus this date and do that for the rest of the column
03:56and so on but let's just cut to the chase here and put in an Array formula right here
04:01where we would like to take all of the shipping dates minus all the order dates
04:05and come up with the average elapsed time equal average, left parenthesis,
04:11the shipping dates in mass minus the Order Date.
04:15We are all done, Ctrl+Shift+Enter. Average 17.17 days. Rather than providing all
04:24of the interim detail that we sometimes don't want or need.
04:28Now let's scroll to the right here and look at information in columns M, all the
04:32way out into column V. We don't have to necessarily see all those columns but
04:36there is data out there all the way across.
04:39Now a great feature in Excel 2007, and much easier to use than in prior versions
04:44is we might have discovered in looking through the data here that we got a duplicate.
04:49Now here's one we see right here and that jumps out at us and you know how it is
04:54when you see these manually and say, wow!
04:56Glad, I found not one, but then you begin to worry about how many others you
04:59might have and then Excel 2007 you can certainly get rid of these pretty readily
05:04with that great feature under Data Tools in that group of the Data tab in the
05:08Ribbon called Remove Duplicates.
05:10But it's very important sometimes to know which records were duplicated and I
05:16wrote a formula ahead of time and I put it here because you don't want to watch
05:19me typing this and I don't want to type it again.
05:22But here it is and it's about -- you will see it here.
05:26This formula is comparing cell by cell, from column M into column V to see if M3
05:35and M2 have the same data in it and does N3 and N2, column by column all the way
05:41up in to column V. When all of these comparisons are true,
05:47we have got a duplicate record. That's the answer.
05:49When any one of them is different, we do not have the duplicate record.
05:52So in this case here that's a unique entry and just dragging this down far
05:57enough to catch that duplicate down here. Oops!
05:59There we go. We've got a duplicate.
06:02Not only are those two the same, but these two are the same and so on and so on
06:06and so on all the way across.
06:07Now that's a pretty long formula and you know you are going to make a typing
06:11mistake when you do that.
06:12But let's recast it now and think of it in terms of what we might be able to do
06:17with an Array formula.
06:19We want to take all the cells in row three from M3 over to V3.
06:24So let's change this part of it here to be M3:V3.
06:31We want to check all the cells in row three to see if they are equal to all the
06:35cells in row 2, and that's going to M2:V2 and we don't need any of these
06:44information of to the right here, much, much, much shorter.
06:50If all those comparisons are true, we have got a duplicate record.
06:53If not, it's unique. And what did I forget to do there? And I didn't do it on purpose.
06:58I forgot to hit Ctrl+Shift+Enter.
07:01So once again Ctrl+Shift+ Enter. This is an Array formula.
07:07Drag this down a few cells just to check it out.
07:10We got two duplicates there on the screen and in the remainder of the list,
07:13perhaps a few more, because down about 700 rows or so.
07:17So a much, much shorter and much more easy to read function and when it's
07:23certainly gets the job done quickly and easily, an Array formula is the correct way
07:27to say this and once again, we don't see those braces.
07:30We don't type them.
07:31We hit Ctrl+Shift+Enter, they are in place and the formula works and it saves us
07:35a ton of time in building a formula and it gives us our answer too.
Collapse this transcript
Counting unique entries in a range with an Array formula
00:00You might imagine that there is a function in Excel to tabulate the number of
00:04unique entries within a range.
00:06But there isn't, and I wish, well, there should be a function called Unique.
00:11Still there is a way to get to this capability by way of an array formula.
00:16And this is one of the stranger array formulas, and yet I don't mean strange in
00:20the sense that you'll never use it. I think you might use it a lot.
00:24I know I have and I remember when I first started using this, I did not
00:27understand how it worked, but I knew that it worked.
00:30And so, let's go down that same path and set up the situation where you need to know this.
00:36This set of data here has quite a few rows in the hundreds and you will see that
00:40it's sorted by department.
00:42Question just comes up, how many different departments do we have here?
00:45In other words, how many unique entries do we see over there in column B?
00:50Well, here's the formula and then we will backtrack and give you some
00:52explanation of it, =sum and this will be an array formula, (1/(count if(.
01:07Do not use column references here.
01:09Use the actual cells.
01:10Now, you don't necessarily have to drag through them if you know that this
01:13goes down so many cells.
01:15Maybe in this case I will forget how many I have had on purpose here and
01:17just drag through them.
01:19Next time I will remember maybe.
01:20So how many cells do we have here? Okay, 687.
01:25Comma, and rather then dragging in I will just copy this all over again and
01:31put it there, and make our parenthesis match up and this is an array formula, Ctrl+Shift+Enter.
01:46There are 24 unique entries in the data from B2 down to B687, and that's great
01:53and now, do you need to explain this to somebody else? Maybe you don't.
01:55You are happy. You move on.
01:58Something has caught my eye and perhaps yours too.
02:01In column B, if you're looking at the Admin Trainings down at Row 21, it looks
02:06like someone forgot a space down here.
02:09So the 24 entries, then it's probably off.
02:11Let's readjust this one.
02:12Put in a space there to make it match up with the others. Could have copied the other one.
02:17Now it's down to 23.
02:20But looking at this, how would you ever reach to conclusion this is the way to go?
02:23Let me give a little bit of background in this.
02:26Simple little example here, here is some entries.
02:28You see there are the states there, and of course some of them are repeating.
02:32How many times does Colorado appear here?
02:35You can imagine using this function.
02:36It's quite commonly used.
02:38Count If, compare Colorado here, or actually we are looking in this range.
02:42We are looking at Colorado, and we are looking at the range here, and how often
02:49does Colorado appear there?
02:50If we are going to be copying this down the column then we should also make this
02:54an absolute reference, highlight it and hit Function key F4.
02:58It's an absolute reference.
03:00Colorado appears there four times.
03:02We will double-click and doing this little exercise doesn't seem to be taking us very far.
03:07We see it again Ohio is there three times.
03:10There is Colorado again.
03:11It's there four times.
03:12Now, a simple division will send us on the path to possibly understanding
03:16the array formula here.
03:18What if we simply make this be the denominator, the reciprocal as it's called.
03:211/count if, do that and recopy these.
03:28Now what we have here, this is one quarter of all the Colorado entries.
03:33This is a quarter of all the Kentucky entries, a fifth of the
03:36California entries, and so on.
03:38And if we highlight all these together, what's the total of that?
03:41And we see at the bottom of the screen, it adds up to 4.
03:44We have got four unique entries.
03:47So as we look at this and this is looking more like what we had seen earlier,
03:52make a slight change here, put the sum in front of this and instead of doing
03:58this just for these cells, in the small example we have got here, we essentially
04:02want to take this comparison here and copy it and make it be repeated here.
04:08And this is essentially the same kind of formula that we saw in I2 previously.
04:13And we will match up our parenthesis one more out here, and this time we will
04:17hit Ctrl+Shift+Enter and there is the answer.
04:20There are four unique entries in this list.
04:23You don't necessarily need to go into explaining it, but in this case, if you
04:27want to make some sense out of an array formula sometimes you got to do things like that.
04:31I have used this many, many times.
04:33Here and there I forget it. I try it again.
04:35It's great. It comes in handy in a lot of situations.
04:38It doesn't give you the list, but it gives you the result.
04:41It's a specialized use of an array formula.
Collapse this transcript
Determining frequency distributions with FREQUENCY
00:00Creating a frequency distribution in Excel is something many an Excel user needs,
00:05and it does involve an array function, not an array formula that you
00:11might need to create on your own, but an array function.
00:14And the function called Frequency is an array function.
00:18Even if you're not a statistician, you're probably familiar with the idea.
00:21A list of entries in this worksheet, about 620 or so, by Social Security and
00:26salary, of how many people in this organization fall into the various
00:30categories based on an arbitrary list that you might set up anywhere.
00:36A common approach might be something like let's just put down the salary
00:39breakout here, 10,000, 20,000 and so on.
00:43So the number we would be seeing here would be the number of salaries up to
00:47and including 10,000.
00:49And then here we'll see all the salaries above 10,000 up to and including 20,000
00:53and so on and so on and so on.
00:55We just want a rough count of how many people fall into each of the categories here.
01:00The initial process for creating a frequency distribution is to set up a list
01:05usually in a column anywhere you want.
01:08This is referred to as a Bins list.
01:11Now, the salaries in question are over here.
01:13But we also want to setup a set of cells, a range where we are going to put the
01:18answer and here we are going to type =frequency.
01:22That's the function name. Left parentheses.
01:27Data array, which data are we talking about here?
01:29It's all the data from here downward.
01:31Wile you are doing this by the way,
01:33you can hit Shift+Ctrl+Down arrow to highlight those cells.
01:37There we go, and you see what's happened in the Formula Car.
01:40You might want to scroll back again. Comma.
01:43Now what? The bins array.
01:45So scrolling back up top here, we are going to highlight these cells and that's
01:50all we need, but this is an array function, so we'll press Ctrl+Shift+Enter.
01:56There's our answer right there.
02:00Then you discover as you look at this cell and this cell, they appear to have
02:04exactly the same function in each one and they do and yet we're getting
02:09different answers and that's a little bit unsettling at first.
02:12But these answers are correct and a quick search of the data here, a quick
02:17sorting would actually make some sense out of it.
02:18For example, just click here and on the Data tab just hit AZ here.
02:23Well, sure enough, what have we got here?
02:254 salaries here, up to an equal 10,000, there they are and we could to the same
02:29thing with the next range, this cluster right in here...
02:32We're going to have about 32 of those. There we go.
02:33You see the number 32?
02:35So you have got 32 of those and so on and so on and so on.
02:38Sometimes what you want to do with this is turn this into a chart real quickly.
02:43It'll work most efficiently if you display these as text, so a real fast entry here,
02:47if simply using the text version of those numbers.
02:50It's just a faster way to do some of things we need to do from time to time.
02:54This is not an array formula here.
02:56It's just a simple conversion of this information here into a text layout that
03:01matches a format for example,like this and there are a quite few variations, on
03:04which you might try with this particular format. Okay.
03:09If we were to highlight this in Excel 2007, just like Alt+F1 and we'll have a
03:13nice chart to go along with our data as well.
03:16Probably we want to clean up the bottom of that, take out the legend and so on,
03:19but a frequency distribution often seems to be accompanied by a chart.
03:23It just makes things easier to see and that mirrors the data that we are
03:26seeing there in column F.
03:28So Frequency is a function, but it's an array function and once again, clicking
03:32back on one of the cells here, you look in the Formula Bar, you see the braces,
03:36you do press Ctrl+Shift+ Enter to complete the entry.
Collapse this transcript
Flipping row/column orientation with TRANSPOSE
00:00In Excel, there's a great feature called Transposing.
00:03And I find myself using it many times when I am laying out data.
00:07I will often pause and consider whether I should have put data, like we are
00:10seeing on the screen here in a vertical alignment with the months down the
00:14left-hand side of the screen and Sales, Expenses, Profits across the top.
00:18And so looking,at this data, what I would like to do is transpose it and
00:21it's somewhat analogous to things you might be familiar with when using a PivotTable.
00:25But if you could imagine a diagonal line along here, maybe transpose this
00:29without destroying it and not using a function just yet, but simply copying
00:33this data and then, right below it for contrast, right-click here, Paste
00:38Special and Transpose.
00:41Not only is it the same data, but after adjusting the column widths here,
00:44we'll see that the formulas themselves got transposed.
00:47So a formula right here, which is adding up 6 cells to it's left, does get
00:52transposed into a formula here that's adding up the 6 cells from above.
00:57And usually in situations like this and sometimes you'll be doing this with
01:00only a single row or a single column, you make your decision as to which one
01:04looks better and get rid of one of them and keep the other one and proceed.
01:09There can be other times when what you would like to do maybe a set up
01:13something like this and maybe on another worksheet, and have the two sets
01:18of values be in sync.
01:19In other words you might want to have this be kind of a mirror image in a
01:23different worksheet and have it be actually linked to the data.
01:27When you do a simple copy and transpose, a change up here causes nothing down here
01:33and as I change this to 150, this set of data in the upper part of the
01:37screen here is changing but not in the lower part.
01:40So, if you want them to be in sync and you need that kind of a situation.
01:44What you need to set up is what's called the Transpose function and it is an array function.
01:52So getting rid of the data here, and doing it on the same worksheet, so you can
01:56see the example better.
01:58Let's setup a transposed area and here's what we have to do first.
02:02If you drag across starting area here, as you do this, you recognize and you'll
02:07see to the left of the Formula Bar in the Name Box, the indicator 4R x 9C,
02:13meaning 4 rows by 9 columns.
02:16Now the transposed version of that will be 9 rows by 4 columns.
02:20So what we now need to do is go highlight a range that is the reverse of this.
02:25So it's going to be 9 rows by 4 columns and as you do that you can see the display there.
02:32So highlight that area ahead of time, =transpose, using this data, [00:02:3963] Ctrl+Shift+Enter.
02:42Obviously, we would want to do some formatting before we do much else.
02:47So we will ignore that for the moment.
02:48But every one of these is an array function and here too, looking a little bit
02:54strange because they all look alike.
02:56But in this example here, if I change this to 150 and remember I did that in the
03:01prior situation, it didn't change the lower data. Here it does.
03:04Now, probably you would not be doing this on the same worksheet and
03:08you certainly can and I certainly did it here.
03:11But you might want to consider how this might work for you when you need
03:14parallel kinds of views perhaps on different worksheets.
03:18The data here is in sync and forever linked to the other data.
03:22So it's a powerful tool.
03:24It's a Transpose function, which is an array function.
Collapse this transcript
Building analysis via regression techniques with TREND and GROWTH
00:00On your screen, you are seeing some monthly sales data in column B.
00:05Columns C and D have been labeled, but there's no data there yet, and the chart to
00:09the right currently is displaying information from column B. Now I have got
00:13the chart setup in such way that as soon as data does go into columns C and D,
00:18we are going to see these on the chart as well in the form of different kinds of lines.
00:23You may or may not be familiar with regression analysis.
00:25I had a cursory knowledge of it. I am not sure if I can explain it the way I need to.
00:30But let's imagine the following situation.
00:33To provide the underpinnings for what might be a look ahead at the sales trend here,
00:38I am using trend there in a common sense, where are we headed with growth
00:43in this particular environment here?
00:45In order to create an analysis of this line, you can use charting techniques.
00:50But there's also a function called a trend, an array functions that will take
00:55advantage of the values found here, and then in effect create a straight line
01:01set of values here that are a reflection of the data that's in column B.
01:06As with the Frequency function and the Transpose function, we highlight the
01:10cells that are going to get the results first.
01:13We highlight all of them. What we are about to create here is a straight line,
01:18regression line, based on the data in column B. =trend(.
01:26Now this function has more possibilities, more capabilities I should say,
01:30than what I am using here.
01:31Here is a somewhat simple and straightforward use.
01:34We simply want to be analyzing the data here.
01:37We are not bringing out the r-squared factor in it or anything like that, if you
01:41are familiar with regression analysis.
01:42We are simply going to be creating a new line in column C or a new set of data.
01:47It will be reflected in chart.
01:49There is the function. Ctrl+Shift+Enter and there's that straight line regression.
01:57Similarly, the word Growth represents another function and this will perform an
02:02exponential analysis of the data in column B. Same general approach.
02:07Highlight the information here, =growth(, highlight the column B data again.
02:15Ctrl+Shift+Enter.
02:17Now anybody who has worked with regression analysis know there's a lot more
02:23to it than the simple example we are seeing here, and yet this is a quick and
02:27efficient way of creating those additional lines that will lead us into a better
02:31explanation of what has happened, and what is likely to happen, and where this
02:35organization is headed in terms of sales.
Collapse this transcript
Combining multiple functions in arrays
00:00If you're familiar with the VLOOKUP, MATCH, and INDEX functions, you know how
00:05powerful they are, and yet there will be times when they just don't seem to work
00:09properly, unless you have some new techniques available.
00:13As we look at the information in column G, we see the name of a person here and
00:19imagine this data here possibly is on a different worksheet, it's in a
00:23different workbook, and we are trying to find the information regarding the
00:28sales for this person.
00:30Now over in columns A, B and C, we see that information, but it's displayed
00:34somewhat differently.
00:35Here's the name Teason Anderson right here.
00:37We see the sales value of the 59,597.
00:42So what we would like to be able to do here and probably a VLOOKUP is to say
00:46take this value, and go find it over here.
00:49The problem is that VLOOKUP looks in the left-hand column of the range that we
00:54are selecting, and we could somehow figure out way to pull out Anderson, but in
00:59a short list here we don't have any repeats, but you can bet in a longer list
01:03you're going to have some last names that are going to be identical.
01:06So what we are really looking for here is that combination of names.
01:11As we see these two here. And if we start to use a VLOOKUP immediately, even if
01:16you're familiar various concatenation techniques, and other ideas,
01:19other possibilities in Excel, in effect you're trying to say let's take this value and locate it.
01:25And then we start to think, well I guess we could put these together, couldn't we?
01:29But we need to find information in the left-hand column that would be here, and
01:34then we've got to go into column 3 to get the data.
01:37So if you start to kick this around, you'll realize this is not going to work
01:41the way we see this now.
01:43So instead we might start with a MATCH function, and here too we are going to
01:47run into some difficulty.
01:48Now the MATCH function sometimes is used simply to tell us if information is found,
01:54and let's start off with that thought in mind.
01:57If Teason Anderson here is found over in column A, B of that other list, which you
02:01remember might be in another worksheet,
02:04match(G2, but let's pull together the information from columns A and B.
02:11The last names are found in column A. So let's take all these at once, and we
02:15are going to be using an array to pull these together.
02:18We'd like to take not just A2 and B2, and then A3 and B3, but all of column A,
02:26as well as all the data in column B. But to make these entries match up, we need
02:31to also put in here, by way of a concatenation symbol, we need to put in double quote
02:37comma space double quote.
02:40In other words we need to take the last names as they appear in column A, put in
02:44a comma space, one more And there, and the information from column B.
02:52And we must find an exact match.
02:54So the third argument in the match function is 0.
02:59Second argument here of course is quite large.
03:01We are looking here in column A along with a comma space and column B. [00:03:0 7.83] And youcan't deal with cells like this without making this an array formula.
03:12So we must hit Ctrl+Shift+Enter and if found, this tells us where within
03:18the array it was found.
03:20It was found in the 11th position.
03:22Well that's actually the 12th row, because we're looking at data starting right here.
03:26So we could've changed this.
03:28We could start it at A1. I will do it anyway to show how that might play out
03:31a little bit, and B1.
03:34This time Ctrl+Shift+Enter, so at least it matches up the row number.
03:38It's a little easier to verify.
03:40So that tells the row number, then we need to use that row number as the second
03:45argument in an INDEX functions.
03:48INDEX simply says we're looking at a table of data.
03:52It might be only a single column, like this data right here, comma.
03:57This tells us the row number and since it's only a single column, we don't
04:01need a column number.
04:02We do need a right parenthesis.
04:04It's still an array formula. Ctrl+Shift+Enter, and there is that answer
04:10that we're looking for.
04:11There it is right there, Teason Anderson, 59,597 and before copying this,
04:17we'd want to make sure that we've got absolute addresses.
04:19So the formula is going to look even more complex, as we throw in those dollar
04:23signs with the F4 key and we'll need to do that here also and here, and again
04:29it just makes the complexity of the formula look greater.
04:33It doesn't necessarily. Ctrl+Shift+ Enter, copy these down the column.
04:38Now we have the answers for all persons here except there are two situations
04:42where we didn't even find the name.
04:44Now had we done the MATCH function first for all of these that would have popped
04:48out immediately, but Renee Hood as we see here, and we find it over here in the list,
04:53but look at the way her first name is spelled.
04:55That's an obvious difference and with Yvonne Randell right here, that's Yvonne,
05:01this is Yvone and of course that's going to happen from time to time.
05:06But as we look at this formula again, the combination of INDEX and MATCH,
05:11it's an array formula.
05:12Now remember you are not seeing those braces until you hit Ctrl+Shift+Enter,
05:16but incredible power here.
05:17There is just no other easy way to do this.
05:20Although this might not seem easy the first two times around, remember you do a
05:24lot of work to come up with the answer once and then when you copy down the column,
05:28you've taken care of thousands of cells potentially.
05:30There is no question this is one of Excel's greatest power tools, an array
05:35formula and often used with other functions together.
Collapse this transcript
10. Text Functions
Locating and extracting data with FIND and MID
00:00One category of Excel functions that doesn't always get its due and yet it
00:05consists of a variety of really powerful functions is a category called text functions.
00:11On the Formulas tab in the Ribbon, you will see a list of them here and two of
00:17the more prominent ones, although when you first see some of these you are not
00:20quite sure how you might use it, involve the word were FIND, which almost
00:25defines itself and the word Mid.
00:27Let's take a look at how we might use some of these.
00:30Small situations, we have a small example.
00:33The Part numbers being used in this organization are based on the timeline or
00:37concept that the character position of these Part numbers has some meaning.
00:42And in a variety of different ways you will here and there hear about a
00:45descriptive number where maybe the third character, the third and fourth
00:49characters together represent either the size of the item, the cost of it, where
00:53it might have been made, the year, the color, all those kinds of things.
00:58And for whatever reason it's important in this particular example maybe to see
01:02if the letter G is in here.
01:04Now maybe it's context, particular position, maybe not.
01:07We just want to know if that letter exists.
01:10Now we are really talking about another feature that here and there might be
01:14what you need and that would be the feature off of the Home tab, the extreme
01:19right group called Editing, Find & Select.
01:22So, sometimes you might just want to find and see if the letter G is in here
01:27and you don't want to match the entire cell contents if you are trying to look inside of it.
01:31Maybe we are just looking here and we could find them one by one or maybe
01:35just go to Find All.
01:37And we will get a little list here and you will see that it was found and cell A3.
01:41You can see that clearly.
01:42Actually there are two Gs in there and also on cell A5.
01:46It's the second character there.
01:48So, that certainly has its role to play.
01:50But sometimes we need that information right here, because maybe based on that
01:55we might want other information in a worksheet.
01:58So, one approach to this is to use the function called FIND. What are we looking for?
02:04Put this in double quotes. Double quote. We are looking for a G.
02:08Now, I should be capitalizing it, right?
02:10Because we are looking for a capital G and we will get back to that issue in a bit,
02:13because that's of concern too.
02:14We are looking for the letter G. Where are we looking?
02:19We are looking in cell A2.
02:22Now there might be times when you need to start not at the leftmost position
02:27of the cell and if you do, you need to put in a third argument here that
02:31indicates the starting character.
02:33Now, that's a much more rarely used feature and so very often you won't need any
02:38more than what we are seeing right here.
02:41We want to find the letter G in cell A2 and the result here if found will give
02:47us the character position.
02:48And of course you can see here, it will not be found, so we will get this as a result.
02:53Simply by dragging this down we will see and of course we can see it clearly on
02:57the screen where this is working and in situation number two there, that's
03:01actually row 3, G was found in the second position.
03:05Now, notice it didn't find the third one or it didn't mention that there is a
03:08second one in there.
03:09That's the first place it found it and in both cases here, it finds it in position two.
03:14Now, I had mentioned here the idea that I used uppercase. How about lowercase here?
03:19Is this going to work here?
03:21No, there is no lowercase G.
03:24Now, there might be times when you are going to find a G, if it's uppercase or
03:29lowercase, in that situation what you would want to use is the functions that's
03:33very similar and same general syntax and everything, but it's called SEARCH.
03:37There we go and the SEARCH function and let's focus on this one particularly.
03:42SEARCH says I am looking for G. Now even though I had used lowercase here,
03:46it finds the capital G. And so you have to think out different variations on when
03:51you are specifically looking for the upper and lowercase.
03:54You want to use the FIND function, but if you don't care use SEARCH.
03:58Now, another function that allows us to work with that data and sometimes either
04:03by itself or in combination with a Find or Search is a function called MID.
04:09Now, think of the word middle here and let's not take that word literally.
04:13But the MID function allows us to pull out information from the middle of a
04:18character and again, not necessarily the exact middle.
04:21Here is one example and possibly you might approach this differently too by
04:25taking the information in the column C and splitting it into different columns.
04:29But we might want to extract from here the state. In all cases, the state
04:34entered here is two characters, but where is it?
04:37If we were to approach this, while we are just looking at the MID function or
04:41thinking of it only by itself, we would say well, what are we starting at here?
04:45What are we trying to find out of here?
04:47And so we're looking at this text right here, but we don't know where to start.
04:52And the first case here of Boulder Colorado, Boulder, that's seven characters,
04:59the comma is eighth and the space is ninth.
05:01We need to start at the tenth position.
05:04Obviously, in the next entry it's not going to be ten or the entry after that.
05:08So, sometimes you will use these together, and not always. I don't mean to
05:12suggest of the MID function is used always with FIND because it isn't, but there
05:17can be situations where you need to pull out data from a given starting point.
05:21So, in this case we might start with =find, just like we did in the previous
05:26example and what indicates the end of the city? The comma.
05:31So, we are looking for within double quotes the comma, and we are looking in
05:37the cell right here.
05:39So, this of course is going to tell us where the comma is found.
05:42It's in the eighth position.
05:43So, armed with that knowledge, we can then use the MID function and say we're
05:49looking here, comma. And where do we want to start extracting data from?
05:54This tells us where the comma is.
05:57We want to start two characters later, not one character later.
06:00That's the space, but two characters later, so we are going to add 2 to this, comma.
06:06Now how many characters do we want to extract?
06:09Just two to pick up the state. Multiple parenthesis, we need to put it in the
06:14closing parenthesis, so this will extract the state.
06:18Now, if you have any choice in redesigning the way this data is displayed,
06:22ideally the data in column C really should be split into three columns.
06:26That's a different issue.
06:27But we are able to pull out information. In this case using the MID function
06:32along with the FIND function.
06:35Now based on different needs at different times and looking back at the data in
06:39column A, you will at different times to have a different need for this.
06:43You will want to pull data out of column A. Maybe it so happens that the
06:48fourth and fifth positions in column A reflect the color code of the items in questio.n =mid.
06:55We are looking at the Part# here.
06:57We are looking here and we want to start at the fourth position.
07:02In that first example that would be the letter K. So we want to start at the
07:05fourth position and extract two characters from there.
07:10So, we want to pull out of that first set of data there with the first cell in A2.
07:14We want to pull out K9 and that's what we will see.
07:19And you will see what's happening in the others of course.
07:20Same general idea. We are pulling out information, not necessarily from the pure
07:25middle, but the word Mid helps us remember what it means.
07:29One by one functions like this are not always that compelling and yet sometimes
07:34used in combination or in dealing with data that we didn't design,
07:39they can be extremely viable when trying to extract data from cells that we
07:43didn't necessarily design, yet we have them on our screens and we need to get to the information quickly.
Collapse this transcript
Extracting specific data with LEFT and RIGHT
00:01A common problem in some kinds of data in Excel is that there is perhaps too
00:05much information in a given column.
00:07Now, we don't need to go into all the details to tell you why maybe column A
00:10would've been better if we split out the names or column F would have been
00:14better if we split that into three separate columns.
00:17Let's imagine a situation like we see in column C. There is nothing wrong with
00:20that display, but we might just need to get information either from the left or
00:25the right side of the entries there.
00:27And like a lot of part number codes maybe these are position sensitive and
00:31perhaps in this example here, the first two characters from the left represent a
00:36color code or size code.
00:38Let's extract two characters from the left-hand side of the data in C2 for
00:42starters, using the function =left. Where are we looking?
00:48Right there in C2, comma. How many characters do we want to extract from there? Two.
00:53And we see what happens of course on the other cells.
00:55We just pull out the two leftmost characters.
00:59Similarly, as you might imagine in a different scenario, a different situation,
01:03maybe there are the three rightmost characters have some meaning and so without
01:06skipping a beat here, we could simply use for that example here
01:10RIGHT, meaning right of course and from the right-hand side, how about three characters?
01:15Just to show the contrast here, pretty simple, pretty straightforward.
01:20And also take a look at column F. Again without going into the details of why
01:24that could have been better, let's simply pullout the five rightmost characters,
01:28because we'd like to sort our data by zip code.
01:31We need to isolate the zip code. =right, simply looking at this data, comma, 5
01:39and we'll do that for the other cells as well.
01:42Pretty straightforward!
01:43Now, the data in column A is in an appropriate order but we might want to
01:47isolate the last name only, and possibly the first name too.
01:51That might take a little bit more work here but let's just pullout the last name only.
01:55The problem here might be that we don't always need the same number of
01:58characters, so we can't use the same function exactly unless we happen to know that,
02:03and we do know, let's say a comma tells us the end of the name.
02:08So if we were to find the comma first, this is again a suggestion along the
02:12lines of one-by-one some of the text functions might not be that strong and yet
02:17when used with others really can give us some power here.
02:21So let's find the comma first, =find, find the comma in A2, and in this case,
02:30it's in the 6th position so when we know that, then we can then say we want to
02:35pull out data from the left-side of A2 and if we use the value that we've got
02:43from comma, we're going to be extracting in this first case Baker comma.
02:48So wherever we found the comma, we want to takeaway 1 from that.
02:51In effect in this case, we want to extract the five leftmost characters, and
02:57that's exactly what happens here, and it would do the same thing here.
03:00So once again, you can get a little creative using these in combination, but for
03:03the most part the Left and Right functions are fairly straightforward.
03:07You are extracting data from the left or the right side of a given cell.
Collapse this transcript
Removing excess spaces with TRIM
00:01Looking at the data in column A reveals some obvious problems.
00:05We're seeing too many spaces here and there. Some leading spaces in row 8, and in row 15.
00:12Too many spaces between names in row 3 and row 4 and perhaps a few others and
00:17we want to clean these up fast.
00:19Now in a large list, leading spaces, particular if there is only one, don't
00:24always jump out at you.
00:26You might have a much smaller zoom factor.
00:28You might have thousands of records and then one day you happen to sort the information.
00:32I'm going to do a quick sort on this column here.
00:35Notice the last names are first.
00:37This will be a sensible thing to want to do, and you got a good deal of data.
00:41The fast way to do it on the Data tab is a simple A to Z Sort, and sure enough,
00:46this would get our attention immediately, and there it is.
00:49We've got leading spaces.
00:50Two of them there, one there and we've got some multiple spaces.
00:54How do we deal with this?
00:56Pretty easy, pretty direct with the function called TRIM. And by the way,
01:01there might be some trailing spaces and how do we locate those manually?
01:06You can double-click in the cell.
01:07You can also do this in the Formula Bar.
01:09There is none there, none there.
01:12This is going to get old, isn't it?
01:13We're going to find any of this way?
01:15Well, I happened to know that there is one here right there. I'm going to
01:18double-click in row 13, there is a trailing space there.
01:22You would also see that in the Formula Bar, if you click up there, off to the
01:25right somewhere as opposed to maybe some other cell, right here, click out there
01:30to the right, you see what's happening.
01:31You can certainly find them manually, but you know that's not what you want to do here.
01:36The function called TRIM will effectively do three things for us.
01:39It's going to give us this data without any leading spaces, without any
01:44trailing spaces and multiple consecutive inner spaces, like we see here, will be reduced to 1.
01:51So it's simply =trim.
01:55You don't know or you don't see that anything might have been done to the
01:59trailing spaces, but the results here do not contain trailing spaces and so
02:04we'll see for the entire column.
02:06Again, the obvious, leading and multiple inner spaces are dealt with, and
02:11we don't even know yet that it's corrected here, because these are still formulas.
02:16Now a lot of you know that you can quickly turn these into results, simply with
02:22the right mouse button, dragging them temporarily elsewhere then right back on
02:26top of themselves to convert them to values real fast, just like that.
02:30And the example there, no trailing space.
02:34Now, not only do you want to do this for sorting reasons, but you also need to
02:39do this if you've got any kind of logic involved with trying to locate items.
02:43It's perhaps not too common to try and use other functions to find names, as it
02:49might be items, say sales items or codes or something.
02:53But just a simple example here will point out an issue.
02:57Imagine on a different worksheet you've got some names. Here is a name here.
03:01You want to see if this name is found in column A in this worksheet.
03:06You might use an If function.
03:07You might try a VLOOKUP and more direct to probably give you the MATCH function.
03:11How about a simple MATCH here? =match.
03:13We'll try and find Ryan Long in column A that is.
03:18We're looking for Ryan and here is the data we're looking at and the MATCH
03:23function requires us to put into zero to find that exact match and are we
03:27going to find Ryan Long? No, we are not.
03:30And if you knew that leading spaces were in effect here, what you might do is to
03:35say okay, I'd like to look somehow for the trimmed version of this, but that
03:40would get involved in using array formulas.
03:43So you better clean up your data, but could we do this here?
03:45Yeah we could do a TRIM, couldn't we?
03:47We can do that there, but we are going to have to hit Ctrl+Shift+Enter and do it
03:51with an array formula.
03:52Then it will find it in the 12th position, but it's much, much better to clean
03:56up the original data and that would be the way we did this in column B.
04:01So backtracking a little bit here, and changing all of this to simply be
04:05looking at column B, if we have our data cleaned up, we wouldn't need to worry about this.
04:11And it will find Ryan Long now in the 12th row of that range.
04:15Here it is, right there.
04:17This is Ryan Long without a trailing space.
04:19So there is no question that here and there you will need to use the TRIM
04:23function to cleanup data. It's fast.
04:26It's easy and you never want to be retyping data very much and particularly not
04:29in a case like this where you've got thousands of entries.
Collapse this transcript
Using CONCATENATE with functions
00:01Although the information in columns A, B and C happens to be correct, it might
00:05be more efficient from your perspective to gather that information and
00:09essentially to put it in one cell in column D. And a typical approach to this
00:15would be, as we look at the information, for example, in row 2 we would like to
00:19see in cell D2 Baker, Mark S. So we need to pull together information, from
00:29different locations.
00:30Two broad approaches to this.
00:32One is a function called Concatenate and another is using what's called the
00:38Concatenation symbol, the ampersand above the number 7 key on most keyboards.
00:42Let's talk about Concatenate first.
00:45This is pulling together information from different sources and we see it in the list here.
00:50You can just click here, Tab, Concatenate and it simply suggest text1, text2,
00:56a whole series of entries, some of which will come from existing cells, some of
01:01which will come from text string that we put in with sets of double quotes.
01:05So we need to get the information for the Last name that's right here. Comma.
01:09The next thing we need to follow Baker is the text string of comma and space.
01:15This needs to be embedded within double quotes and then a comma to indicate we
01:19put in that information.
01:21Now we need to get information from cell A2 and typically following the first name Mark,
01:28we would want to see a space so we put in Mark in this case.
01:32Now we need to put in the text string simply a space and after this another
01:38comma and we need to put in the middle initial and we want put in after that
01:44a period, double quote period, double quote and we see that entry.
01:49And let's test it out on a few cells and we've got a little problem it looks like.
01:56Hansen, Sheila. The trailing space.
01:59So we don't really want that period all the time. What are we going to be doing here?
02:03If cell C3 is blank, how are we going to change the logic here?
02:09One approach is to insert an if, to do it right here to say if that cell is
02:16blank or to phrase in other way, if it's not blank we do want to put the period.
02:20If it is blank, we don't want to put the period in.
02:22So what essentially do we do here?
02:24How about an if function right here right in the middle of this?
02:28Check to see if this particular cell right here.
02:32If it is blank we want to see nothing.
02:35If it's not we want to see the period.
02:37A function you may or may not be aware of this function called isblank. Is cell C2 blank?
02:46Is the logical test here, comma.
02:48If it is, what do we want to see here?
02:50Nothing additional.
02:51That null string is a sometimes called, double quote double quote. Nothing at all.
02:57In all other situations, when it's not blank we want to see the period.
03:03And so this is an if function, inside of concatenate, right parenthesis.
03:08First situation we don't know yet if it's going to be working.
03:11Check it out on a few cells.
03:13It appears to be working and from here, we could just drag it downward, there we go.
03:18And so that's one way to pull together information from different locations,
03:22the Concatenate function. And you don't always need this of course with the IF function.
03:27Now that may or may not be your preference, but the other choice here would be
03:31not to use concatenate but simply to use the symbols.
03:35And in this situation here, you might just work off of this and by editing,
03:39instead of this and you can see the plus will be that we don't need this
03:44long function name here.
03:46But we do need to put in the ampersand repeatedly and so we would like to see B2
03:51and the comma space, and you see what's happening here.
03:56For the most part replacing those comma separators with the ampersands.
04:01So we got to put these in over and over and over again.
04:05And the rest of this should work properly. There we go.
04:11Now I might compare this with the second one here, back and forth a little bit,
04:15or possibly just hit Ctrl using the Tilde symbol, which is usually on my keybard
04:19over the Tab key, the Shift key, to compare the two of them there.
04:23You see the top two in terms of length.
04:25That's not always the way to measure how difficult a function is but you kind of
04:29see the two together and can make a comparison.
04:31I tend to use the first example more than second.
04:34But again, you can have your choices.
04:36Both of them get to the heart of the matter and that's pulling together data
04:40from different sources.
04:41Let me hit Ctrl+Tilde again to get back to a normal display.
04:45Whether you're using Concatenate or the Concatenation symbol, you can see how
04:49effective this is in pulling together information, not only from different
04:53locations, but by actually using text strings that are needed in these examples.
Collapse this transcript
Adjusting case within cells with PROPER, UPPER, and LOWER
00:00There's nothing really wrong with the data in column A, nor the data in columns
00:06D and E. But let's face it.
00:07Many times we don't want to see data that's all uppercase.
00:12And in B2, we see the way we might want to see Donna O'Brien's name.
00:18Just the O and the B capitalized in O'Brien and the D in Donna.
00:21And we certainly don't want to re-type this.
00:23It's is a great function for this, simple and easy to use, =proper.
00:28Proper will capitalize the first letter of the entry as well as any letter that
00:34follows a space or any punctuation.
00:37So the B that follows the O actually follows an apostrophe. It's going to be capitalized.
00:42And we're simply looking at the data here and D will be capitalized and fast and
00:47easy, what else do you need?
00:49Copy this down in the column
00:51Occasionally, I get a question when I'm teaching this in live session.
00:54Anything we can do here with McDonald?
00:56Is there way to make that D capitalized?
00:59Certainly no easy direct way, and you might imagine somewhere down the road
01:02in the future that maybe there will be a way to do this.
01:05It does work here with the apostrophe.
01:06But you see what's happening in all other cases.
01:09Keep in mind this works for other kinds of situations. If these are book titles,
01:13it might be what you want too.
01:15But it will be capitalizing all those Thes and the As and the Ans and so on.
01:20You don't have to adjust those manually.
01:22This not a question.
01:23This is a fast and easy choice here.
01:25And in column F, you might want to do, not only an adjustment here, but also
01:30pulling these together.
01:31And it's just a reminder that sometimes knowing different capabilities with
01:34text strings allows us to do this.
01:36So a quick adjustment here might be let's use proper here, along with the
01:41ability to pull together, for example, Baker just coming out of E2 and then
01:47after that double quote comma space and Mark and that's all we need there.
01:54So we're pulling together the names from different locations as well as using
01:58the Proper function here, to make only these significant letters be capitalized.
02:03There are other times when you got letters in lowercase, the way we see them in
02:06the column H, and we want to make the letters here in uppercase.
02:11So the function of course is called Upper.
02:14It does nothing with the numbers that are in there. Nothing it can do with those.
02:17It simply checks the text entries and makes them uppercase.
02:20So here we've got upper.
02:22All the text entries here become uppercase.
02:25If for whatever reason, you have data like this and you did want those letters
02:29to be in lowercase, you would use this function.
02:32And I just can't think of a very good example when I would ever use the Lower
02:35and I can't think when I have ever used it except just to prove an example.
02:38So that's Lower looking at the data in column A.
02:42So fast and easy and a quick adjustment. In all these situations where you're
02:46using these functions to adjust, the follow-up step most of the time is to say,
02:52okay I would like to keep this data and throw away the original.
02:57And a very fast way to do this is simply to take the results by way of these
03:02functions and with the right mouse button, drag them on top of the old data as
03:06we might do here, drag it on top of the old data with the right mouse button and
03:12from the pop-up menu Copy Here as Values Only then, we could just get rid of
03:16this and we're all set.
03:18And sometimes, you'll do that to itself, like in this case, here put a new title
03:23up there, perhaps take this data and simply with the right mouse button copy it
03:28up or down, left or right, to bring it right back on top of itself, let go.
03:32Copy Here as Values Only.
03:35The formulas are all gone, the results are left, get rid of this.
03:38You don't need that anymore.
03:39So fast, easy techniques for adjusting upper and lowercase using the three
03:44functions Proper, Upper and Lower.
Collapse this transcript
Adjusting character content with REPLACE and SUBSTITUTE
00:00The two text functions Replace and Substitute have something in common.
00:05And the Replace function actually has something in common with one of the
00:08command sequences in Excel.
00:10Let's see how these two different text functions are related to one another.
00:14In column A and B, we see some entries and in this first cluster of
00:19information right here, I've titled in B1 what we actually want to see below
00:24and this is manually done here.
00:26There are times when you want to replace a given character with either other
00:32characters or perhaps nothing, and you see the effect of what's happening here.
00:37Now if we wanted to replace all the hyphens in a list like this, we could
00:42just easily jump in on the Home tab in the extreme right in the Editing group, Find and Select.
00:48They can do replace here and simply say every time we've got a hyphen here,
00:53we replace it with.
00:54We don't even have to jump into the next panel below where it says Replace with.
00:57We will just do a Replace All, and all hyphens, and remember there are two
01:01in each of that set of data that are in column A, they are all replaced and
01:05it tells us how many.
01:06Simple straightforward.
01:07You don't need a function for that.
01:08So I am going to click OK and close and then Undo, Quick Access Toolbar there.
01:14But sometimes we might to want to replace this either with a specific character
01:18or with something else.
01:19Let's talk about how to use the Replace function here, =replace, and this is position based.
01:26We are not looking for a text here.
01:27We are going to do this by position.
01:29What might throw you at first is it says old text.
01:32You certainly can use double quotes here, but we want to be working off of the
01:35data in cell A2 here, and we are looking for what's in the fifth position and
01:41 in all cases here the fifth position has a hyphen.
01:45So we put in the 5.
01:47And we only want to replace one character.
01:50It says number of characters.
01:52We want to replace one character and what do we want to replace it with? Nothing.
01:57So I will just put on a comma, all done here and we see what has happened.
02:01Of course, we can copy that down and see the effect of the way it's done
02:05manually, but this is how it's done here.
02:07We are replacing the fifth character and only the fifth character with
02:12effectively nothing.
02:13Now, a slight alteration here.
02:15If we wanted to replace the hyphen with some other character, all right,
02:18or it can be a letter certainly, if you wanted to. Whatever it takes here.
02:21First of all, double quotes are required, but you want to replace this with the
02:24letter X. That's big and prominent, just to show what it would do here.
02:28Something like that and you see the effect there.
02:32Similarly, if these were multiple characters, you might put in XXX, just to show
02:37how that might work.
02:39So here we are replacing one character with three characters and it looks like that.
02:44So lots of variations and as soon as you will see a few examples of these,
02:47you will just keep that in the back of your mind. Here and there when you have
02:50to massage data, when the command isn't appropriate because you don't want to
02:53get rid of all characters, this is based on a character position. That's where we remove.
02:59Example over here, just for variety, same general idea.
03:02Here's the eighth character, and if you look at the original data, the eighth
03:06character is a hyphen over there, a dash, and replace that with the (USA) and so
03:12just a quick look of this =replace and same general idea.
03:16This is the data we are looking at.
03:18In this case, we are starting in the eighth character and we want to replace
03:21one character over there again, but this time what we are replacing with is
03:25within "(USA)" and done.
03:32So you see how that could be done too.
03:34Quite a variety of options with this.
03:37Now the other function called Substitute, in contrast with the Replace function,
03:43the Substitute function is about content not about positioning.
03:47The description at first looks similar to the one related to Replace up in row 1,
03:52but in row 7, this says Substitute - remove the first dash.
03:56Now we can remove the second dash, as you see over in column E there.
03:59This works a little bit differently.
04:01Same general idea though.
04:03We are trying to change the content of the body of cells, group of cells perhaps.
04:07Type =substitute this time and here's what we are looking at, comma, what we
04:14are trying to substitute for it, as the case may be a hyphen, and what we want
04:19to put in place of that is essentially nothing, so we can just leave that argument blank.
04:24But we only want to replace the first instance of it, and there we go and
04:27you see what's happened.
04:29The second one remains there.
04:30So we only removed the first one.
04:32Again, so you don't necessarily get the idea of that the Substitute means
04:36remove, because it doesn't.
04:37Instead of that hyphen, we might want to put in, and again I'll use just
04:41a different symbol.
04:42Maybe it's the pound sign, "#", just something else to put in there instead of the
04:48hyphen and you see what happens there.
04:51If we wanted to do that for all occurrences of this, if we just leave off the
04:56last argument here, this will replace all occurrences of hyphen with a pound and
05:01there too we might be thinking about using this by way of the command rather
05:05than actually using a function here.
05:07But we wanted to do just a second occurrence, so we will put in a ,2
05:10and this will change the second dash there to a pound sign.
05:14So you could see variations on how that might work.
05:17In the example on the right, similar idea, here we are replacing that
05:21second hyphen with XXX.
05:24Once again, a quick look at this Substitute.
05:28Here's the data we are looking at, once again we are using that hyphen or dash
05:32here and we want to replace that with, in this case, XXX and we only want to do
05:38it for the second example.
05:39And you see what's happening there, and that's what's done in the other cases as well.
05:44So here and there using Replace and Substitute might be quite valuable when
05:48you're dealing with tons of data.
Collapse this transcript
Reviewing additional text functions
00:01If you download data from other sources, from other software, sometimes you run
00:05into situations where the data is inappropriately displayed and you really can't
00:10work with it effectively.
00:13Look at the data in column A, where you'll see trailing minuses.
00:17Some software indicates negatives in that style.
00:21When it comes into Excel, typically it's turned into a text entry.
00:25And if we try to perform any kind of mathematical operation on a cell like that,
00:29for example, if I attempt to use that value in A2, at least it looks like a value,
00:34and double it, we get something like this and that's not very helpful.
00:39In fact, it's not helpful at all.
00:40What we need to do is effectively get rid of the trailing minus but actually
00:44make it keep its negative meaning.
00:46We'd like it to look the way it does right here in B2, but we actually want to
00:50show how you can do this by using various text functions.
00:55If you're familiar with how to isolate characters within the cells, you'll know
00:59that it's the rightmost character here that we need to pull out.
01:03The other text function that's going to come into play here is one that simply
01:07tells us the length of an entry.
01:09Now in an isolated example, this doesn't always mean a whole lot, but here is a
01:13simple example here, =len.
01:16Think of it as being short for length.
01:19What's the length of cell A2?
01:22How many characters are found over there?
01:25And you look at it. It's 7.
01:27We have got the three characters, decimal point, two characters and the trailing minus.
01:31There are seven characters there.
01:33Now again, by itself that doesn't mean a whole lot but when it comes to
01:36picking apart this information and doing something with it, that's going to come into play.
01:42Now, as I write the function here, I want to be sure that we can see it
01:45clearly as well as A2.
01:46So I want to make the column wider temporarily so we can see this clearly.
01:51So the first thing we need to do here is to find out if the rightmost
01:55character is a minus.
01:58And in other cases, for example, in A3 and A5, it isn't.
02:01But we want to cover both bases.
02:03So we are looking, first of all, to see if the rightmost character--
02:08So we use the text function right.
02:10We are looking here, comma.
02:12We are looking at the one character on the right, is that equal to and we've got
02:17to put it in double quotes, a minus, comma.
02:21Well, if it is, what is it that we want to do?
02:23We want to pick everything up out of that cell A2 to the left of the hyphen.
02:29So we need to use the Left function and the numbers may vary.
02:32They could be in a hundreds of thousands, the tens of thousands, so the number
02:36of characters we pick up from the Left here needs to be one less than the
02:40length of the entry in A2.
02:43So the number of characters we need, that's the next part of the argument here for Left,
02:47will be the length of A2 minus 1.
02:54Now this portion of the formula right here, if we could look at it for the
02:58moment, contains 345.45.
03:03What we need to do with that is to multiply it by -1, because we truly want to
03:08take those numerical entries there, the pure numbers and make sure they come up as a negative.
03:13So we can put an asterisk minus 1 comma.
03:17So if we do find the rightmost character being a minus, this is what we want
03:22to do with the data.
03:24If we do not find a minus on the right -hand side, we simply want to use the
03:28data as it is and Enter.
03:33Now don't necessarily count on seeing the hyphen here.
03:37That has to do with formatting.
03:38And so that cell might have been formatted earlier.
03:43If you go to Format Cells, you'll know there are lots of options for Number.
03:46Currently, this is the one in place.
03:48Now you don't necessarily have to show the leading hyphen.
03:51You might prefer this style or this style.
03:53So that's a different issue and let's not confuse them.
03:56This may be for some people more common style. In an accounting environment
04:00they like this look.
04:02So we might do that.
04:04And we certainly will be able to copy these down into the other cells.
04:07But the formatting issue is a different one, but you see what's happening here.
04:10In all cases here, we have cleaned up the data and we can use math with these.
04:14We can format them.
04:16We now have values at our disposal.
04:18That's a simple little example I used before where I took this and double it.
04:21Now if we do that, that works just fine.
04:24So that's a creative use of using three different functions there:
04:27Right and Left and Len together.
04:30And those are the things that make these text functions really valuable.
04:33You don't always sense their value when you're seeing them in an isolated case.
04:38Now another situation I hear about from time-to-time is what's occurring in
04:41column E. Perhaps these are code numbers and you're not about to use them in any
04:46computational sense, but you want them to look like this.
04:49And I think you know what happens if you type leading zeros.
04:52If you haven't done any kind of special formatting ahead of time,
04:54you type leading zeros and they disappear, and some people discovered that with zip codes.
04:59That's a different issue.
05:00You can format those for zip codes and avoid that.
05:02But a different situation here.
05:04We've got a whole bunch of numbers like this and again, imagine thousands of these maybe.
05:09You've got to make them look like this.
05:11And I hear a little horror stories every so often where people got a hundred of
05:15these and they retype them and format them as text and so on and so on.
05:19There are simpler ways.
05:20And what we want to do here is to simply write a formula that does this for us.
05:26This is using a function called Text.
05:30We simply want to take this data, comma and no matter how many entries we have
05:36here, let's say whoever has made the decision here, everything should be
05:39displayed as a five digit character, and wherever necessary put in the leading zeros.
05:46So the format will be, double quote and the text function does require that you
05:51put in a format and perhaps a little bit of knowledge of formatting in Excel is
05:55viable here but the simple example here is pretty straightforward, "000000". That's it.
06:03Looks like that.
06:04And the other data, which we've been putting manually, we'll change those so
06:08these all works too.
06:09So these are in each case here simply the data to the left with leading zeros.
06:13Now, those are text entries and it's highly unlikely that you need to treat
06:17these as values, but if you try to add these, Excel looks upward first.
06:20If it doesn't see any numbers and if you try to do this anyway, if you overrode what
06:24it tried to do there, you would get this.
06:26Now, sometimes what you can do too is, and I wouldn't say this is necessary
06:31but you could say let's add these up anyway but you would have to turn those into values.
06:36Another function that occasionally comes into play is a function called Value.
06:41And this takes data like this, which contains numbers but they're not really
06:45values, they are text.
06:48We want to convert those all into values, and because we are trying to do this
06:52across multiple cells and get the total at the same time, this would need to
06:56be an array formula, so we'll press Ctrl+ Shift+Enter and that is the total of those.
07:02Again, maybe that's a little unusual.
07:04You probably won't use that a whole lot.
07:05But if here and there you did have entries that were text entries, you can
07:10turn them into values.
07:11Possibly here we might do =value, if you want to do it this way too, on each one of these.
07:17We don't have any formatting there, there we go and just take this down there.
07:21So that's another need from time-to-time.
07:23Now, here is another issue too and it's actually related to that first example.
07:28You can create your own format and if you want negatives, I wouldn't exactly
07:32recommend it because it's inconsistent with a lot of other displays in Excel,
07:36and it's not an innate one built-in, but you can create your own format so that
07:41for negative numbers you'll have a trailing hyphen.
07:44Now as I click on this, you look in the Formula Bar, the value of this is -34.56.
07:51The format you can create for this, and there are a quite a few variations, I am
07:54simply clicking the right mouse button here, and going right in the Format Cells,
07:58you'll see here a Custom Format.
08:01And you can do this pretty easily by starting with one of the formats here that
08:06has two kinds of layouts.
08:09Whenever you see a semicolon here, in one example on each side of it, the one to
08:14the left is how the data is displayed when it's a positive or zero.
08:18The entry to the right is how it's displayed when it's negative.
08:21So you might just click one of these, adjust it slightly, put in a trailing
08:24minus and that's simply the format here for negative numbers.
08:28And again, I am not strongly recommending that, but it is possible to actually
08:32have this look and have it be treated as a value.
08:35So in this case, in this situation here, we've seen a number of different uses
08:40of Text functions pulled together.
08:42Putting them together in an interesting way sometimes does allow us to do some
08:46really creative things with massaging our data and getting it into the shape
08:50that we really want it to be in.
Collapse this transcript
11. Financial Functions
Calculating payments with PMT
00:01In Excel there were over 50 financial functions on the Formulas tab in the Ribbon.
00:07Click Financial and you will see the names of all them.
00:09And if you are in the world of banking and finance and mortgaging, you certainly
00:13have an insight into what some of these are likely to do for you.
00:16Of all the ones you'll see here, certainly the one that's most widely used and not
00:21necessarily by people in that industry at all is one that allows us to calculate
00:26the monthly or yearly or quarterly interest on a loan.
00:30And in cells A1 and A2 are two typical kinds of scenarios.
00:35The first one when someone needs to borrow some money for a car, say $25,000,
00:40wants to pay it off over four years, has an interest rate of 6%.
00:43I put this information in the cells here just as pure entries right here, and
00:49here I want to show how the PMT function works.
00:52It is pretty straightforward.
00:54=pmt meaning payment. What's the rate?
00:58Now, the one mistake that is likely to be made if you make a mistake in using
01:02this function is you forget to divide this by 12.
01:05Now, of course it isn't always 12.
01:0712 means how many payments do you have per year, or better yet what is the
01:12interest rate per payment period.
01:14If these are quarterly payments you would divide by 4, but if it is monthly,
01:18probably much more common, /12.
01:21Don't forget to put that in there. comma, nper, the number of periods.
01:26If this is a four-year loan, we could have put 48 in here or since we do have
01:31the 4 here, simply this times 12 to indicate how many payments we have got.
01:37Comma. And how much are we borrowing?
01:40Present value 25,000. That's it.
01:43Our monthly payment, principal, and interest will be this amount.
01:48If you want to plug this into your family budget it may be a bit awkward because
01:53it is displayed as a negative, and after all it is an outflow of money every
01:57month, so that's an appropriate entry.
01:59But if you want to work differently with this, you have two options. You can
02:02either put a minus sign in front of the 25,000 or perhaps better back in the
02:07function itself simply precede that PV entry with a minus if you want to have
02:13this displayed as a positive entry.
02:15Now you might also want to take this and build an Amortization Table, and for
02:20your information Excel does have a built-in template for that.
02:23You can go to the Office button, and choose New, and track that down if you wish.
02:28That may be to your liking.
02:30If you want to build your own, I just want to show you the beginnings of it.
02:33The key entry here will be how much interest you pay the very first month, and
02:38so month by month and you might have 48 entries here eventually.
02:42You want to know for each payment, how much principle, how much interest, and
02:47then the new balance each month.
02:49Some people find this exercise a little depressing but let's say we don't and
02:54let's talk about how we might do this.
02:56The interest rate for the very first month will be equal to the loan amount
03:01times the borrowed rate divided by 12.
03:06Now the principal is going to be the monthly payment minus this, and if we are
03:11thinking how this is going to be copied down the column as we put in the
03:14principle we want to be using cell D7 and make it absolute, and that's always
03:19going to be that minus the interest for the month.
03:23So these two together add up to the monthly payment of 587.13, and the balance
03:30each month is reduced by the amount of principle.
03:34So here is the balance minus the principle.
03:39You probably want to do one more just to make sure you got it right, so the next
03:43entry down here, remember here on the principle we were doing what?
03:45We were subtracting it from the interest.
03:47Now you could bring this down first.
03:49It will look funny because we didn't calculate the interest.
03:51But what do we want to do on the interest here every month from now on?
03:55We want to be basing the interest on the balance this way.
03:59Probably what I should have done here and I could readjust it on this first
04:01case here is simply say, instead of that referring to D6, make it refer to this value right here.
04:08So it is referring to the cell that's over and up one and that means if we drag
04:13this down that should be working okay.
04:16One more adjustment, the D4 reference should be absolute.
04:19Drag that down and since this was a subtraction in that order, same idea here.
04:27We could build our table this way.
04:29So dragging this down, eventually we would see.
04:32Drag it to whatever.
04:33It's going to be down here and eventually we will see what's happening, and
04:36I didn't quite complete this.
04:38We could drag it down this way.
04:39We would have to drag it down into row 48 to make this work probably, and it will.
04:46Actually a few rows beyond that, and it will end up at 0 eventually, right at 48.
04:49So it is easy to build them fast.
04:52Now with a loan for a house, things are going to be a bit different.
04:56Well substantially different.
04:57Another variation of what you might use PMT for and we could do it here in a
05:01different way, sometimes you are in an exploratory mood and so you could build
05:05little grid here using PMT, and the example here maybe you are exploring
05:10different possibilities as to how much you want to borrow, depends on the market
05:14of course, and what are the interest rates.
05:16So a quick idea here in building this using the PMT Function, this example what
05:21we would like to do and let's say that in all cases here it is going to be a 30
05:24year or 360 month kind of situation.
05:27So we start off here with the rate and looking ahead since every entry in this
05:33grid will need to get its entries out of row 1, we will use the F4 key here to
05:38make sure the reference there stays frozen in row 1 and mixed reference with an
05:43absolute reference for the row number.
05:45So that's going to be the rate divided by 12, comma, the constant here will be
05:50the 360 right here and we will hit F4 there so that's going to stay constant for
05:55all these, comma, and the amount we are borrowing will vary, but it is always
05:59going to come out of column I here.
06:00So we will want to press F4 a few times so that the reference stays in Column I,
06:07with the dollar sign in front of the I, comma, and we are done.
06:13And there too if you want that to be expressed as a positive number I think it
06:17would be better in this case to put a negative in front of this and then copy it
06:21downward and copy it across to see the various rates depending upon the interest
06:26and the amount being borrowed.
06:28And do keep in mind of course that with a house the payment we are seeing here
06:32is principal plus interests.
06:34We are not talking about insurance and taxes, and you might want to add this
06:37onto the end of this or simply use this as your starting point.
06:40So there is no question that PMT has a role to play.
06:42It is absolutely vital, as you would imagine, in mortgage and banking.
06:45But it is widely used outside of that.
06:47It is one of the more popular functions in Excel not used for work purposes.
Collapse this transcript
Finding future values with FV
00:01How much money will I have after five years if I pay $300 per month into an
00:05account earning 3% interest per year?
00:09These are the kind of questions you sometimes ask yourself. If you understand
00:13the math behind this you will realize it's a pretty sophisticated formula.
00:18Fortunately, a number of the financial functions in Excel do all the work for us here.
00:24And in this example we need a function called FV, future value.
00:29Another way to phrase this, how much more will I make this way instead of
00:32putting it in the cookie jar? =FV.
00:37In this example 3%, that may be optimistic depending upon which time of year
00:42it is and which year it is, but let's choose that as an example.
00:45And since most kinds of situations like this are likely to be monthly, I want to
00:50make sure that 3% interest is translated into a monthly rate, /12.
00:56The number of periods here, we are talking about 5 years times 12, 60 comma and
01:03how much are we putting into the account each month, 300.
01:06So, after 5 years how much will we have?
01:09Now, a quick math in your head says 5, 12, that's 60 times $300. $18,000 if we simply
01:16hold onto it and did nothing with it, and instead we get this much.
01:22And the information is expressed in a negative way. That is technically
01:25correct but I think a lot of people would prefer to have this be displayed as a positive.
01:29So quick change there.
01:31You put a minus in front of the 300 to express the number as a positive number.
01:36Now, a variation on this, you see the question on row 14.
01:40How much money will I have after five years based on a $15,000 deposit into an
01:45account earning 3% interest per year?
01:48We are not going to do anything with this other than deposit it and watch
01:52and see what happens.
01:54=fV(, once again we use 3% here.
01:5860 months just do it directly this time.
02:02Now, in this case we are not depositing anything, so we don't put anything in
02:05there, in this example here, for PMT but we do have a present value of $15,000.
02:12Like in the prior example we want to make this a negative. We are using a
02:15different argument in the function here, $15,000.
02:17With that going to be equal to after 5 years, and we see the answer there.
02:26Now you could probably do this mathematically pretty easily and you could show
02:29what it is year-by-year simply by using caret symbol above number six and
02:33compounding it that way.
02:35A lot of people know how to do that sort of thing, but this certainly gets us
02:37the answer pretty quickly and it does show the different variation on it.
02:41And what I did here in second example using a starting value could be used in
02:46the example up above too.
02:48For example, what if the money you are putting into this account, you are
02:51starting with $1000 balance to begin with.
02:55So following the -300, just before I do that, let's remind ourselves the answer here that
02:59we saw previously. 19,394.
03:02But what if we start with $1000? Comma and to be in sync with the other negative, -1000.
03:10So that's the money that's already there and so instead of the 19,000 that we
03:15saw earlier, that was 19,394, if we start with $1000 and then add $300 every
03:21month, how much will we have at the end of 5 years?
03:23This is the amount.
03:25And let's say in the example here we don't have a choice on the rate. Now 4% is
03:29probably too optimistic for some of these numbers.
03:30But still, what if we wanted to build a grid here showing what will happen if we
03:35put in $300, then $325, what's going to be the variation here?
03:40Now, the numbers here are already in place, but let's show how to create these.
03:43And you will make your own judgments as to what kind of variations you want here.
03:47If you want to do this every $10 just to show what it might be like here, so
03:51every $25 and this represents the years here.
03:55How would we build this?
03:57=fv, and we will use this percent right here, and if we are going to be
04:02copying this downward and the rightward, we will always want to be referring to that cell A5.
04:07So by pressing F4 to make this an absolute reference, divide that by 12, we are
04:13talking about monthly payments here comma and now the period of the loan.
04:18It is going to come out of A6 and all the others that we will be using here will
04:22come out of column A as well.
04:23So by pressing F4 repeatedly we will get the dollar sign in front of the A,
04:28meaning that part will become absolute, the row number will change.
04:31So we want that to look $A6, and that represents year so we need to multiply
04:36that by 12, comma and how much we are inserting for our deposit each time,
04:42it is going to be coming out of row 5 here.
04:45The first time it is going to be B5 and here too we want to use a mixed
04:49address to make sure that the row portion of this, the 5, remains absolute but not the column.
04:55So pressing F4 repeatedly gives us this look eventually.
04:59And here too we want this to be ultimately expressed as a positive number.
05:03So we will make this entry negative.
05:05So that would be the master formula here and then we can just double-click to
05:09copy this downward and then drag across to see what those different combinations
05:15of a deposit amount and the number of years adds up to. Powerful stuff.
05:20Pretty easy to get to with the Future Value function, FV.
Collapse this transcript
Determining total amount of future payments with PV
00:00An important function when it comes to investments is the PV function.
00:05Question at C1 stated, what is the present value of monthly payments of $2000 at
00:126% annual interest I will be making over the next 360 months?
00:15That's probably talking about a house here.
00:18What's that money worth right now? There it is.
00:21How do we get to this value?
00:23The function is pv, =pv.
00:276%, and in nearly every financial function that deals with rates, if it's
00:34anything related to payments, more often than not it's related to the monthly
00:37payments, so we will divide by 12. If it were quarterly, we divide by 4, and if it
00:42were yearly, we wouldn't put any division in, over 360 months, 2000.
00:46That's the present value of those payments we will be making.
00:52And as in many cases, although that is technically the correct answer, to make
00:57that appear and perhaps be able to want to use it and plug it into other
01:00formulas, that would probably work better for most people if it were a positive entry,
01:04so a quick edit here.
01:06Put a minus in front of the amount here, and it gets displayed as a positive entry.
01:12Another use for the PV function is expressed in Row 6 with the question,
01:17how much money do I need to invest now if I want to have $150,000 in ten years?
01:23Well, if you're confident that you can get 5%, you need to have $92,000 available.
01:296%, 7%. Are we talking stock market here or some other scheme that you are sure you
01:35know it's going to work?
01:36I am sort of making fun of the idea that we are not always so sure.
01:39But let's show how we can come to this value here by way of the PV function, =pv(.
01:49We want to be referring to this 5% right here, comma, 10 years.
01:54We are not going to be making any payments here, 0.
01:58We would like to reach $150,000.
02:02Be sure not to put a comma after the 150.
02:06If you work with financial functions you wouldn't do that, but sometimes you
02:09slip up a little bit.
02:10So what do we need here?
02:12That's the same value we saw before.
02:13Once again, it's negative, so ideally what we would do here, most people would
02:16put a negative in front of this so we get this value here.
02:20Now, if we would like to test this out for the other amounts here, we can
02:23simply copy this or double click it to copy it down a column to see how this
02:28stacks up with other rates.
02:29If we are confident we can get 10%, then this would be our starting point.
02:33This is how much money we need to invest if we are going to get 10%, to have
02:37$150,000 in 10 years.
02:40So here are some valuable uses of the present value.
02:43That's the PV function in Excel.
Collapse this transcript
12. Information Functions
Working with the IS information functions
00:01If you work with Excel functions a lot, you are probably aware of the fact that
00:04on the Formulas tab in the ribbon, there is a category under More Functions
00:08called Information Functions.
00:11And variety of these begin with the word IS and they are ideally used for
00:16cleaning up data, testing data.
00:19It makes certain kinds of functions easier to read and easier to deal with.
00:23And many of these are almost self-explanatory.
00:26Let's mention a few of them right at the beginning.
00:28I put these right here just for reference point.
00:30But on the screen here, you'll see ISTEXT, ISNUMBER ISNONTEXT.
00:34I recall situation a few years ago where I was adding of some data and I had
00:38simple Sum function and I am adding up numbers like this.
00:42Now there are 9 entries here, and they are all over 2000, so it's going to be
00:46rough math in your head about, 20,000 or so.
00:49But it's only 15000.
00:51Now if you have bee working with Excel, you can probably see what's going on here
00:54and I've rigged this example a little bit.
00:56But if you look closely you'll realize that the entry right here looks narrower
01:00than the others and looking again more closely.
01:02If you're familiar with it, the number one that typically appears in Excel
01:06and there's a one up there in that 1999 and you see how it looks and that
01:10really isn't a one.
01:12That's a capital I or it's a lowercase l. We don't necessarily care.
01:17Here's a different one here.
01:18So one of these 2. It's a capital I or a lowercase l. It's certainly not a 1.
01:24Now, when you are doing data entry, you should avoid aligning data until you're
01:29finished with the data entry.
01:30Now, I know sometimes you are never finished.
01:32But stay away from the idea that you want to align the data, because Excel
01:36performs a nice service for us.
01:37I am going to go back to the Home tab here and turn off Right alignment.
01:41When you don't have any alignment buttons selected, entries that contain
01:46non-numerics are automatically left aligned.
01:49They are considered text entries.
01:51That's a capital O, this is either a lowercase l or a capital I. We don't
01:56necessarily care here.
01:58When you see other numbers around, of course you make the comparison.
02:02That's an O clearly over here and over in column G not exactly nearby but
02:07that's two zeros there and we see the difference.
02:10But when data has been aligned and you got thousands of entries, sometimes these
02:13things aren't as clear as they might want to be.
02:15And I'm not suggesting you're going to be using all three of these at the same time,
02:19but a quick check of here, how this might work.
02:23Sometimes you'll just use this function with nothing else to it other than this
02:27and we're going to get a true or a false.
02:30Now this is a data entry here. Is that text?
02:34No, it's not. It actually is a value.
02:36How about the others here?
02:37And it's pretty obvious that is text, that is, that is, after that explanation that is.
02:43And similarly, in other situations it's more appropriate or it's just clearer
02:47to say, is this a number.
02:50Now in some cases, you might want to be using this with IF functions.
02:53I am going to put it inside of an IF to check and see if it is a number.
02:57You want to do some calculation otherwise.
02:59Maybe you want to put in a temporary value.
03:01Here we'll do these all at once =ISNUMBER and we'll be looking at the same
03:05cells and when we build the formula this way, the function just refers to the
03:10first cell, hit Ctrl+Enter, all of these will go in at the same time and you
03:14see this happening.
03:16In other situations, it might be clear to do this.
03:19You'll get the same kind of answers, =ISNONTEXT.
03:25Same general idea, click here, hit Ctrl+Enter and there are some others of a similar way too.
03:31And it will make sense, at certain points to be using these along with the IF
03:34function to take different courses of action.
03:37Maybe the approach here is going to be if there's a score here where we
03:42possibly are going to increase it by 10% or multiply by something or maybe just use it.
03:47But if it's blank maybe, we want to put in an indicator or a temporary value or
03:52zero or something like that.
03:54So many times the IF function will come into play.
03:56And one way to do this, and not necessarily the best way, would be to say
04:02if this cell is blank.
04:05In other words, if this equals and a programming kind of way, I am not trying to
04:11put them in a programming sense.
04:12But one way to do this is to say if this is equal to double quote double quote.
04:17Sometimes that's called the null string.
04:19In effect is it empty and if it is, maybe we'll just put in the value 0 here, or
04:24we'll put in number like 99, just something for whatever the situation calls for
04:29and if not maybe we will simply take the score, we will do nothing with it special,
04:33just put in as it is and we could copy this down the column and you can
04:38see pretty quickly what's happening here.
04:39Every time there's a blank cell, we get a 99 instead.
04:42Now it might be clear and for some people, it will be clear to say instead of
04:47saying all this, why don't we use this phrase isblank this G2 here, and skip
04:55that equal double quote, double quote stuff? There we go.
04:59If this cell blank and it's just clear and easier to read and sometimes that's
05:04what we are looking for in formulas.
05:06It's a little bit better documentation, even if you had never seen it.
05:10You make the educated guess, yeah, that's checking to see if that cell is blank
05:14and of course, the same answers as we saw and it just might be clearer.
05:18And at different time using the IF function along with these other indicators
05:22here would be appropriate as well.
05:25So again, use them as you need them, but I think in general, they're likely to
05:28be used for cleaning up data, scoping out data to see what's going on and
05:33you'll get the complete list of them on the Formulas tab under More Functions
05:37and under Information.
Collapse this transcript
Using error-checking functions: ISERR, ISERROR, IFERROR
00:00There's a certain kind of information functions in Excel that for want of a
00:05better term that we might call error checking functions.
00:09On the Formulas tab, in the ribbon if you click More Functions, and then go to
00:12Information, you will notice a function called ISERR, ISERROR.
00:19You'll also see a function called ISNA and there's one called NA.
00:24But let's explore some of those in this selection and very often, but certainly
00:27not always these are used along with the IS function.
00:30There's also a new function in Excel 2007 that goes by the name ISERROR and
00:36you'll see how this plays out in comparison with some of the other functions
00:40that have been around in Excel for awhile.
00:42Here's a worksheet, nothing too unusual about it.
00:44It's heavy with formulas. I could quickly hit Ctrl+Tilde here, no Shift key.
00:49I readjust the column width and you'll see pretty rapidly there are tons of formulas.
00:54What happens sometimes when you're not thinking ahead or it just doesn't occur
00:57to you, and I'll hit Ctrl+ Tilde and readjust the columns.
01:01Who would have thought that a formula here that's calculating profit change from
01:06month-to-month, here's an example, this particular formula. You probably learned
01:10something like this, back in the sixth grade, before you were using Excel.
01:14If you made $20 profit or $20,000 profit, whatever it is here, for April and
01:18then the next month, you make 40,000.
01:20That's a 100% increase.
01:22And you see what's happening in other months.
01:24We are tracking Sales Changes, Expense Changes, Profits Changes month-to-month
01:29and then it just so happens that on a given month, maybe this number is getting adjusted.
01:33I am going to make the expenses here be equal to the sales for this month.
01:36So simply make that 240 and that's going to turn the profits into 0 and you see
01:41what's happening down here.
01:43This formula is now trying to divide by 0, which of course is an impossibility
01:48and that's why we get the DIV/0 error.
01:52Now, what do you do in a situation like this?
01:54Some people just leave it here. It is true.
01:56It's accurate.
01:57It doesn't apply in this case.
01:59But if you're going to be making a presentation or you are going to be printing this.
02:02Usually you don't want people to be asking questions or you don't have to
02:06explain this unnecessarily.
02:07You would probably like to have a different answer.
02:09So there are a couple of different approaches here.
02:12Now, what I am going to do is change this formula and the, as you would expect
02:15we would be copying this into the three cells to the left and to the right to
02:19cover other potential situations as to what might happen here when this is 0.
02:24Another aspect of this too, which I don't want to cover but you can imagine
02:27wanting to cover is, if these go negative then you are going to be coming up with
02:31some very unusual answers too that you might want to screen out.
02:34Let's just focus on the idea here that we have an error.
02:38Here's one approach to this and this is the time honored to the traditional
02:41approach in Excel before 2007, which still works.
02:46A function used within the IF function and in English here is what we want to say.
02:51If this calculation somehow comes up with an impossible kind of
02:55calculation that will be an error,
02:57we'd rather not see this.
02:59So right here, in front of the function but after, the initial parentheses
03:04we want to say iserror().
03:11If all that is in error, what do we want to do?
03:14A lot of us would want to put in nothing, in which case it would be "",
03:19just leave it blank.
03:20Other people might prefer to put in as NA.
03:24And a third option, not so obvious, is to use a function called NA.
03:29Like all functions, it's followed by parentheses.
03:32The difference will be this will have a pound sign on the view that may not be to your liking.
03:35But that's what it will do.
03:37So the logic so far is if this calculation is going to give us an error,
03:42we want to display this or there are two other options you might have seen and it's your choice.
03:48If not, we actually, want to see this.
03:51I don't want to type that again, so I am going to highlight this, hit Ctrl+C or
03:54the Copy button is available for Home tab at present.
03:56Ctrl+C, click out here, Ctrl+V, there we go and one final parentheses and
04:03it certainly makes the formula look longer and so on.
04:08And as is often the case, happens to me too for sure, yes, I'll accept this.
04:13Usually this gets it right.
04:14Yeah, and that's what we want to see, not too many parentheses.
04:18In Excel 2007, there is a new function.
04:22I am going to write it under here, so we can compare the two.
04:25But instead of having to repeat that over and over and over and let me
04:28temporally put a space in front of it and just leave it there, so we can see this text.
04:32I'll make the column wider too, there we go, so we can see that at least temporarily.
04:36We will do the same formula over again, with the new function IFERROR, and
04:41this makes it substantially shorter.
04:43But what we want to do here is to say if this calculation, this left parentheses
04:48F4-E4 and that's all, so I'll just click on the cells up here.
04:54If this minus this, right parentheses divided by this, if that is an error or is
05:02it that we want to do? I don't know.
05:03What's the value when that's an error?
05:06Maybe we'll just put in the NA, like we did before, to be in sync here and
05:12we don't have to indicate what we do otherwise, because it will simply use this calculation.
05:18So we are all done here, expect for the final right parentheses, and there's the
05:22answer and displaying it momentarily, so I can compare it with the other one.
05:26A lot shorter, a lot easier to read and just more succinct.
05:29And as soon as you discover this, any other situations where you had been using
05:33the longer version, which is required in future versions of Excel, this is a lot better.
05:38The ultimate end is the same.
05:40You either want to display an NA as a function or possibly nothing or you have
05:45different approaches here, and what I am going to do is simply move this here,
05:48drag it with the right mouse button, do a move there, looks like that.
05:52And in real life situation, of course, we would copy this to here, and what
05:56happened here is it did copy the format.
05:58So before I do much more here, what I am going to do is copy this format to here,
06:02and then recopy this, there we go and copy to left of this as well.
06:08So the other numbers won't really change, but it does cover these situations.
06:11So this is certainly one approach to doing this.
06:14Now, when you have the NA in different situations, if you're trying to
06:18evaluate this, if you have this entered as a function and that's what I did
06:22here by putting this in.
06:23If you have formulas elsewhere that somehow need to refer to that, you can use
06:28this function =isna.
06:33Does that have an NA?
06:34We know it does here, this might seem rather obvious to do that, but it says true.
06:38Let me wind it up with that column properly. All the others up there well,
06:42of course, they are not and that's what you see there.
06:44Now, I'm not really pursuing this any further, other than to say you can check
06:48for the existence of ISNA.
06:50Now, there's another small variation on this too.
06:53If you're looking at data in one location from another location, sometimes you
06:58want to check if it's an error and you will notice in a sort of subtle
07:02distinction, but at least be aware of it.
07:03There is the ability to say ISERROR or ISERR and what's the difference?
07:13ISERROR, as it says below, will check to see whether a value is an error and
07:21you see in parentheses in the pop-up tip here all the things that it looks for, and
07:25what's the difference between that and using just ISERR?
07:30It doesn't check for the Na.
07:33Subtle difference, probably won't make a whole lot of difference to most people
07:36but just be alert of the fact that there is a difference there.
07:40But I think the bigger question might be,
07:42why are we using this at all if the new function called IFERROR is around?
07:46I think it's a better approach.
07:47So just some ideas here behind checking the accuracy of information and
07:53somehow screening out the kinds of things you don't necessarily want to show on your worksheet.
07:57I know some of you wouldn't want to see this.
07:59A reminder once again by going back to this particular function here.
08:03Maybe we don't even want to show this.
08:05Maybe we want to show nothing.
08:06How about double quotes, double quote?
08:09So different situations where you can use these functions at your own discretion.
Collapse this transcript
Getting data from remote cells with OFFSET
00:00As you look at the data in columns A and B and also the information in columns
00:04D and E, you can imagine what we are trying to set up in this particular worksheet.
00:09Column A will grow and grow and grow as will column B. We're tracking a closing rate,
00:15maybe it's stock market, maybe some kind of futures market, some kind of
00:18number that's vital to our interest and we want to track the information and
00:22maybe we've been tracking it for only months but for years, so column A could
00:26get quite long. And elsewhere not necessarily in the same worksheet, we always
00:32want to have the latest entry right here.
00:35And so if for example here, if the next entry is going to be the 10th year,
00:38I'll just drag it this way.
00:40We'd like to see this be the 10th and if the next number our here is going to
00:43be 267 or whatever,
00:45we want to see that right up here in cell E2 as we set up here on the screen
00:50and it's not changing.
00:53Now there's an unusual function and I say unusual because like certain kinds of
00:58functions you might just gloss right over it if you happen to encounter it.
01:02It actually is part of the lookup and reference category of functions and if you
01:06happen to click this button on the Formulas tab in the Ribbon and come to
01:12OFFSET, look at the description.
01:14It returns a reference to a range that is a given number of rows and columns
01:19from a given reference.
01:20And it's definitely programming- like in nature and that's certainly is
01:25insufficient in terms of explaining exactly what this does and yet that's just
01:30what we need in situations like this.
01:32So instead of the manual entry here, let's put in a function that will and this
01:38is going to be OFFSET function, of course.
01:40That will always keep track of the latest entry as they start to appear here in
01:46column A consecutively after the existing entries. =offset.
01:55Now the reference is going to be to the cell starting in cell A1.
02:01How many rows down do we need to go?
02:03This is going to vary.
02:05If we put information in A9, we'll have more entries than we have there now and
02:09obviously this will keep adding and that's going to be the case.
02:12So what we need next is some way count how many entries we have in column A
02:18and some of you are familiar with the function CountA. And just CountA.
02:24That counts text entries in column A. And right away you're probably thinking what is
02:31in that counting A1 as well? Yes it is.
02:33That's all right.
02:35Subtract one, do not count that.
02:38That's how many rows we want to move downward and you're probably saying
02:42yourself, what is the value of CountA looking at column A? The value is 8.
02:48We subtract one and so we're looking at 7.
02:51So what we're we about to say here?
02:53From position A1, move down, how many rows? Seven.
02:59How many columns do we move to the right? None, zero.
03:04In other words, we don't want to move into cell A9.
03:07We essentially want to move into A8 and grab that data.
03:13And we see this and a quick test of this occurs
03:16is so what if we do put in a different data after this?
03:23Immediately this is reacting.
03:24Now once again looking at the logic of this, what are we seeing?
03:27We're always looking at A1 as the count of entries in column A goes up.
03:33That's one bigger than the offset that we need.
03:36For example, right now we need to go into cell A9 and pick up that value.
03:41This is telling us there are nine entries.
03:44We want to subtract one so this moves down eight.
03:47And remember the nice shortcut too.
03:48When you're evaluating formulas, you can highlight a portion of it and simply
03:53hit F9 to see what that's equal to.
03:56It really helps understand certain functions.
03:59So, of course, now nine minus one would be eight, move down eight cells from A1
04:03that would take us down to A9. Don't bother with the column 0.
04:06We could even leave that off, and we don't hit Enter.
04:10We'll just hit Escape to adjust it and the same idea here.
04:14I could even copy this.
04:15If I drag it it's going to copy the format.
04:17Another way, I might just copy this here, right-click over here, do a Paste Special.
04:23Don't copy the format but just the formulas over there into E and this should be
04:29set up automatically too.
04:30And that's picking up the wrong-- well, not exactly the wrong entry yet because
04:34we don't have any number here.
04:36Let's put in a number down here and now we see how that works.
04:40Now you could say in a certain sense this is a specialized function but the use
04:45as it's seen here is the powerful one.
04:48If you do some exploring in various Excel Help menus, you'll see the OFFSET
04:52function being used for describing dynamic range names. That might be worth
04:57looking into on your own.
04:59This is certainly one of the more powerful uses of it.
05:01At first, it seems a little obscure but it's easy to understand the more you
05:05look at it and it certainly gets done what we need to get done.
05:08And this is going to work for a long, long time particularly if you get a
05:12situation where you keep adding dates, keep adding information to column A, keep
05:16adding information in column B, it's always going to pick up the last entry.
05:21When you've got situations like this too, make sure you don't have empty cells
05:25in there because then it's going to mess up the count.
05:27If you have only one, possibly you can make an adjustment and not subtract the
05:32one and somehow work around that but here's the basic idea.
05:35This is the Offset value right here, the number of rows to move downward, and
05:41the number of columns to move rightward in some cases. Like in this not at all. It's not an issue.
05:44So a great tool when you need it.
05:47It's the OFFSET function.
Collapse this transcript
Returning references with INDIRECT
00:00On the screen, we're looking at a worksheet.
00:02Its name is called Indirect-1.
00:05It's actually a summary worksheet and there is one that is great
00:09three-dimensional formulas in cell B3. It looks like this.
00:13This is adding up the other B3 cells on all the other sheets named East through
00:19West and the Sheet tabs are East, South, Midwest and West.
00:24All sheets, cell B3 on every one of them, we're getting nice total.
00:28Now, what we might also want here, and you can imagine how if we had many, many sheets,
00:33one for each state, one for each city within a cluster of city,
00:37something like that, we might have many, many sheets using this kind of a model.
00:41All these sheets have the same layout.
00:44Now, as it turns out on all these sheets, the total for each of the regions is
00:48going to be on cell G6.
00:51Now, it would be nice if we could simply put in a formula right here
00:56that gets the data from the East and if you're doing this manually, this would
01:00probably be as efficient as anyway. Rather than copying and pasting, build the
01:04formula at the destination.
01:07This is where we want to see the data.
01:09Equal, then click on the East sheet, click on the cell in question, and color
01:15out there and simply hit Enter, and that's what we see.
01:20If you look at the formula, you'll see that it refers to sheet names with an
01:24exclamation point. We see that there.
01:27Now, a very unusual function in Excel and it's one of those that I have seen so
01:32many descriptions over it that just don't do justice, and it always seems a
01:36little bit strange, is a function called INDIRECT, and many times the way it's
01:42described-- and let's actually use this from the Formulas tab under Lookup &
01:48Reference, INDIRECT. Returns the reference specified by a text string, and that
01:57doesn't tell us a whole lot, does it?
02:00Here is one example and this will not ring true. I'm going to put a cell
02:04address here, for example, B4.
02:09If I use the INDIRECT function and refer it to this cell, the answer is going to be 2,710.
02:22So by referring to D9, which has a cell address, it's going to use that
02:28you might say indirectly, in gathering the data. This in cell B4 it's 2,710 and
02:35I'm sure many of you would be saying, and I know I said when I first saw this,
02:38well, why would I ever use that?
02:40That doesn't really make any sense.
02:43Well, let's go back to this idea here. What would be efficient here
02:47and particularly if we had many, many sheets but even here it's going to be efficient.
02:52Why can't we just take this kind of a setup here and copy this formula
02:57downward into other cells?
03:00If we could somehow pick up these names as well.
03:03So what I'd like to do first of all to help with the example is to just move
03:08this over here, edit it, put a space in front of us, so we can just remind
03:13ourselves what it looks like.
03:14So I am temporarily turning that into a non-formula so we can see it here.
03:18Now, if we use the INDIRECT function to pick up the word East, then we can
03:23construct essentially this kind of a formula and then if we copy it downward,
03:28it's going to pick up the word South, and Midwest and West, give this a shot,
03:33=indirect, left parenthesis and we want to get the data from here and looking at
03:41the formula over in E9 as reminder.
03:43What do we want to come after the word East?
03:46Within double quotes we want to get the exclamation point and then G6.
03:50Don't really have to capitalize it.
03:51It looks better, G6, double quote and that's the answer.
03:59A quick jump over to the East sheet just to make sure, there it is, 17,980.
04:05And of course, quick formatting here.
04:07Maybe just copy this one down there.
04:08We'll drag it with the right mouse button, format, looking good, and if we
04:12double-click here, we've got our totals for the others as well.
04:16Again, at first looking a little strange and I'm thinking and begin to see this
04:20has some merit here.
04:22I do have model like this that uses all the states and of course it's
04:25very efficient there.
04:26We do this once and copy it down into 50 other entries. It works beautifully.
04:30So the INDIRECT function has some real power here.
04:33There's another power tool with this that is even more impressive and let's move
04:37into the next sheet to the right.
04:39It's called Indirect-2, second example here.
04:42On this worksheet the entry for column A is labeled State, the entry for
04:46column B is labeled City.
04:49A real popular feature in Excel these days is the pick list idea, by the way
04:54of data validation.
04:56Let's imagine in this particular scenario, the company has offices in various
05:00states, does businesses in various cities within those states, and to speed up
05:05data entry and to make life more efficient here, what we would like to be
05:09able do in column A is first of all setup a list of entries that must be state names.
05:15So I am going to zoom in a little bit up here, so we can see this little bit more clearly.
05:18The state names in question are right here.
05:22If you haven't used data validation, it's a great feature, often very
05:25straightforward, but in column A or the range you are interested in, go to the
05:30Data tab, Data Validation, setup a Data Validation rule and what we want to
05:37allow in column A here is information that only can come from this list, and
05:44what's the source of that list? I'll move this over, just these cells here.
05:49These are the only states we do business in.
05:52Click OK, and that's a simple single-level data validation.
05:56Anytime we click here, we get to pick one of these states.
05:59There is a scrollbar here and there you need that so on.
06:04Now for each state there is a different list of possible cities. For Illinois
06:09is these cities right here and for Ohio of course, these are a different set of cities.
06:13What we now want to do is another level of data validation, based on what's in
06:19column A. When we come to Illinois here, we want to get a drop arrow that shows
06:23only the Illinois cities.
06:25We come to Ohio we want to see a drop arrow that only shows us those.
06:29We want the data validation entries in column B to be based on what's in column A.
06:35Now, the missing ingredient here is how we make a reference to this and what
06:41we have to setup also is range names. In other words we want a range name for
06:46Illinois that essentially refers to these cells, and a range name for California
06:51that refers to these cells.
06:54As I scroll rightward a bit, one problematic issue is the different states have
06:58different numbers of cities in them, but we won't let that stop us, and I might
07:03zoom back a little bit, so we can see all of these cities.
07:05California for example has more cities, there we go.
07:07So here is what we'd like to do, and rather than painstakingly create range names,
07:12we want to take advantage of a capability here that lets us apply either
07:17the top row, bottom row, left column, right column, as the name.
07:23So in this case here we're going to be highlighting all of these cells and
07:28on the Formulas tab, Create from Selection, automatically generate names from the selected cell.
07:36The names we're going to create will be taken from the left column.
07:41So what we've done now is defined A Z to be a range name.
07:46That consists of these cells right here, all the way up to column O, in every
07:51case it's all the way up to column O, and that's a slight irritant, which
07:55we'll see in a bit.
07:57Now, what pulls this together is the fact that now we want to setup data
08:02validation here and for every state, we need to be looking into the cell to its left.
08:08If we do this for the entire column, we'll be making a reference to A1 and A1 itself.
08:14We'll use that simply because as we start here is to the left of B1.
08:19So it works better when you highlight the entire column.
08:22It just makes it more efficient.
08:24So in column B we want to setup another data validation rule using a list, but
08:34the source of the list will be =indirect.
08:38We are going to be using cell A1, even though literally A1 is not in
08:44question but by inference any cell we're using in B1 will automatically
08:48refer to the corresponding cell in A1, and that's why we'll get this funny
08:52message as we click OK here.
08:54It sends a shudder through some of us.
08:56We see it the first time, the source currently evaluates to an arrow.
08:59Do we want to continue?
09:00Yes, we do, and we're ignoring it.
09:03So now Illinois, we click here.
09:06We're only seeing the Illinois cities. There they are.
09:10That will be Chicago.
09:12Ohio, we're only seeing the Ohio cities.
09:15Now the scrolling here is the irritant that I alluded to and we'll adjust that in a second.
09:19Maybe that Cincinnati.
09:20We've got Colorado here, and more of the Colorado entries, and you'll see what's happening.
09:24Every single time, we're getting only the cities from the appropriate state.
09:29Now, what is annoying is that because we've got these blanks for some states,
09:34a lot more in fact blanks for every state, except California.
09:38What we'd like to do is effectively take all the blanks here and essentially get rid of them.
09:45Now they are part of the range name definition.
09:48So an obscure but powerful tool off the Home tab, the extreme right most
09:54button, Find & Select, Go To Special, let's select these blanks, blank
10:00cells within that range. There they are.
10:03Let's right-click on them and delete them.
10:06Delete just the blanks and shift those cells leftward.
10:12Now that was the least critical of all this, but now for example here,
10:16we'll make an entry, pick a different state, Illinois again, click there, drop arrow.
10:21It's much easier to read.
10:22We don't have to worry about seeing just a few of them.
10:25It's just a cleaner version of what we've seen earlier.
10:31Let's fill these in.
10:31There is no way to have done this without the INDIRECT function, and again
10:36recognizing it's a little bit obscure, if you go through these steps as you are
10:40trying this, you can see the enormous appeal of this.
10:43You might call it the double data validation definition here, to again allow people
10:48to pick items out of a list, rather than boring typing.
10:52It's a great feature.
Collapse this transcript
Conclusion
Goodbye
00:00Hi! This is Dennis Taylor.
00:03Thank you for watching and listening to these videos on Excel Formulas & Functions.
00:08I am sure that after watching these videos you are a much more confident user of Excel.
00:12You know a lot more about functions.
00:15And in the future, I think you are going to be less intimidated by what you
00:18see in Excel, and particularly if you have those challenges where you need to
00:21manipulate data and come up with totals that you just found a bit illusive in the past.
00:26I wish I could help each one of you on a one-to-one basis.
00:29We can't really do that of course, but it's been a pleasure presenting this
00:33information, and perhaps we'll together again soon in another course.
00:37Thank you!
Collapse this transcript


Are you sure you want to delete this bookmark?

cancel

Bookmark this Tutorial

Name

Description

{0} characters left

Tags

Separate tags with a space. Use quotes around multi-word tags. Suggested Tags:
loading
cancel

bookmark this course

{0} characters left Separate tags with a space. Use quotes around multi-word tags. Suggested Tags:
loading

Error:

go to playlists »

Create new playlist

name:
description:
save cancel

You must be a lynda.com member to watch this video.

Every course in the lynda.com library contains free videos that let you assess the quality of our tutorials before you subscribe—just click on the blue links to watch them. Become a member to access all 98,648 instructional videos.

start free trial learn more

If you are already an active lynda.com member, please log in to access the lynda.com library.

Get access to all lynda.com videos

You are currently signed into your admin account, which doesn't let you view lynda.com videos. For full access to the lynda.com library, log in through iplogin.lynda.com, or sign in through your organization's portal. You may also request a user account by calling 1 1 (888) 335-9632 or emailing us at cs@lynda.com.

Get access to all lynda.com videos

You are currently signed into your admin account, which doesn't let you view lynda.com videos. For full access to the lynda.com library, log in through iplogin.lynda.com, or sign in through your organization's portal. You may also request a user account by calling 1 1 (888) 335-9632 or emailing us at cs@lynda.com.

Access to lynda.com videos

Your organization has a limited access membership to the lynda.com library that allows access to only a specific, limited selection of courses.

You don't have access to this video.

You're logged in as an account administrator, but your membership is not active.

Contact a Training Solutions Advisor at 1 (888) 335-9632.

How to access this video.

If this course is one of your five classes, then your class currently isn't in session.

If you want to watch this video and it is not part of your class, upgrade your membership for unlimited access to the full library of 1,899 courses anytime, anywhere.

learn more upgrade

You can always watch the free content included in every course.

Questions? Call Customer Service at 1 1 (888) 335-9632 or email cs@lynda.com.

You don't have access to this video.

You're logged in as an account administrator, but your membership is no longer active. You can still access reports and account information.

To reactivate your account, contact a Training Solutions Advisor at 1 1 (888) 335-9632.

Need help accessing this video?

You can't access this video from your master administrator account.

Call Customer Service at 1 1 (888) 335-9632 or email cs@lynda.com for help accessing this video.


site feedback

Thanks for signing up.

We’ll send you a confirmation email shortly.


By signing up, you’ll receive about four emails per month, including

We’ll only use your email address to send you these mailings.

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

By signing up, you’ll receive about four emails per month, including

We’ll only use your email address to send you these mailings.

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked