Transcripts
1. Synopsis: Hello and welcome to this
course about Excel formulas. For those who do not know me. My name is Rami, and I combine expertise in business strategy and analytics. I hold an MBA from
Harvard Business School, as well as years of experience in a top consulting
company called McKinsey. And as a vice president
in a multi-national bank, leading their analytics and strategy practices
throughout my career. I've seen times n times again, people struggling with Excel to complete basic tasks.
And you know why? Because Excel is not taught in universities and high school. On top of this, you have
two trends in the industry. Number one, companies are
more and more relying on data to take decisions which will put more
pressure on you. And two, with half-a-million
companies in the US alone using Excel
as their basis. Excel is and will remain a
prominent tool for analysis, despite other tools like Python, because Excel is flexible
and easy to use. This is why I decided to
create this course for all levels from beginner
to advanced Excel users, you will be able to
benefit from it. This course contains
100 plus formulas with a mix of theory
and real-life examples. Unlike other courses, the goal for you is not to
memorize formulas, but to understand how it works. So when you see a new formula, you can dissect it and then use it correctly for your
business analysis. We will start with the
basics with formula syntax, common errors, and
formula auditing tools. We will also look
at if statements, statistical function, lookups,
date, and text functions. Also, I will show you how to use formulas with
conditional formatting. And finally, for
more advanced users, we will look at dynamic array
formulas and how to take advantage of the new
revolutionized calculation engine. So it's time to work
smarter, not harder.
2. S1 L1: Housekeeping & Expectations (material in Project section AllToDo, AllCompleted): Welcome to this Excel
course about formulas. My objective for you is that no matter your initial level, even if you are a
complete beginner, by the end of this course, you can take any formula,
dissected, understand it, use it correctly, and even build complicated
formulas if needs be. Also, I would like you
to be able to build interactive dynamic dashboards
to visualize your results. In this intro, I just wanted
to set a few expectations, talk about housekeeping items, and show you the course
curriculum quickly. Let's start. First of all, all the
demos that you're going to see here will be for Windows PC. If you have a Mac, you might struggle to follow in
some of the lessons. Now also I provided
the mac shortcuts. Sometimes the things in Mac might not work the same as SPC. Also, depending on
your Excel version, the layout might be
slightly different. But don't worry, you will be able to find most
of the options. Now, obviously, some of the formulas might come with
newer versions of Excel. If you don't have
them, it's okay. You can just follow here. If you want. You can just upgrade your
Excel version number two. Although there are more
than 500 formulas in Excel, we will only focus on the top hundred plus formulas because those are the ones
that are the most used. E.g. I. Don't want to spend
the time teaching you how to use the cosine formula, because very few of you
will be able to use it. What I want to
teach you is how to understand formula
without memorizing them. If you see a new formula, you'll be able to
see how it works. And remember practice
makes perfect. So always try to replicate the same exercises I'm doing
until you get it right. Number three, we're going to base this course on
real-life examples. So unlike other courses, I don't want to
show you a formula to tell you this is how
it works and that's it. I want to show you how to use the formula in the
business context. Number four, if you
are in trouble, there is something
you are stuck on. We are here to help you. So there is the Q&A
part in this course, you can ask your question and we will do our
best to answer it. Finally, if you can read this course whenever
you are ready, because my goal of
creating this course is to disseminate the information
I acquired over the years. So you can use it. And obviously, if you rate it and you
leave some comments, it will help me
improve this course. Now let's go briefly
to the course outline. So before I go into this, I just want to tell you that the material is
available for download. You will find it either
in this section. All you will find
the material for each section at the beginning
of the respective section, and you will see three
files for every section. 15 will be underscore to do, which is the file before I
started doing the exercises. The second file will be
underscore completed, which is after doing
the exercises. And you'll have the
PowerPoint slides. So let's deep dive into the content of this
course quickly. We'll start with the intro, which is where we are right now. The only thing I want to tell
you is that you will see a video which will explain to you how to
navigate the course. So if you are an advanced user, you will be able to select the lessons that are
more adapted to you. If you are a beginner, I advise you to go step-by-step so you can
build your knowledge. Then we will go to
Formulas one-on-one. Those are the basics to
be able to use formulas, to understand the syntax
of formulas and so on. If you add an advanced user, you might skip most
of the lessons here. If you are a beginner, this is very crucial because it will improve your
productivity in the long run. Part three is about if statements
and logical operators. We will see how to use them, how to combine them like
nested F and so on. But four is about
statistical functions. So you will see things like
percentile, rank, et cetera. And some of the
most use formulas, like some if S average if x, count F and so on. Part five is one
of the toughest. It's about lookups. So obviously you
will have VLookup, HLookup, index and
match and so on. But you'll also see advanced concepts like
offset and choose. But six is about texts. So all the formulas
related to text, part seven, date and time. You will see all the
formulas related to date and time and some
pro tricks like e.g. how to define your own
weekends in some formulas. Then you will see formatting, which is one of my
favorite parts. You will see how to apply
formulas in formatting. Now just formatting
cells normally in Excel. That will be very useful
when you are doing some fun and cool
visual dashboards. And finally, you will have
dynamic array formulas. Excel has revolutionized
its calculation engine. And you will have new
formulas that will help you simplify
your day to day work. I hope you are excited
to start this course. I'll see you in the next lesson.
3. S1 L2: Star Concept: So how many times have you
taken a course online? And three 4 min into a lesson, you'll find out that you
already know the concept. So since this course is
for all Excel users, I have defined the star
or the asterix concepts. In front of every lesson, you will see in parenthesis
the number of stars. One star means that it's
more for beginners. Five-stars means that it's
more for advanced users. Obviously, my definition of Excel level might be
different than yours, but at least it's
a starting point. So if you are
intermediate or advanced, you can pick and
choose your lessons. If you are a beginner, I advise you to go through
adolescence one-by-one.
4. S2 L1: Intro (material in Project section AllToDo, AllCompleted): Welcome to the formulas
one-on-one part of this course. So I hope that you are excited to start your learning journey. This section is mostly
geared towards beginners. But if you add an advanced user, there are some tips and tricks
that you can benefit from. So look for the lessons
with 34.5 asterix. Now, in this part of the course, we're going to learn the
basics about formula. And this is very important
because once you know this, you'll be able to
learn formulas way faster and it will improve
your productivity. So we will start with
the syntax of a formula. So what are the elements of a formula so you can
recognize them fast. Then we will look at
cell referencing. So how to use the dollar sign? So when you drag a formula, you don't have any problem. But three is about errors. So the common types of
errors and how to fix them. But four is about
calculation or the, this is important to understand what gets
calculated first, especially if you have a big formula and you
want to troubleshoot it. Number five is to identify
sets containing formulas. If you get the workbook
from a colleague, you'll be able to spot those formulas fast
and understand them. Then we will look at shortcuts. Obviously this will be
huge for productivity. Number seven will
be basic formulas. So sum, average,
count F and so on. And we will also
look at percentages, so you can apply those formulas directly at work the next day. Number eight is data validation. So here you want to create drop-down menus and
you want to put restrictions on sets so you can get correct inputs
from the users. And finally, we will learn
how to transpose data, because a lot of time you get data that is not
in a good shape. And you'll want to turn it in a tabular format so you
can do your analysis. So I hope that you
are excited to start. Let's go.
5. S2 L2: Formula Syntax (**): It is very important
as a beginner to be able to understand the
structure of formulas. Because this way, if
you see a new formula, you'll be able to dissect it
and understand it easily. Now when I think about formulas, I think about cooking. How so? Let's look at an
example together. So here I have a sum, a formula. We don't care what some f does. We're going to see
throughout this course, what I care about
is the structure. So first of all, we start with the function name. And this function
name could be in capital letter or small letter. It is not case-sensitive,
doesn't matter. Your function name is
actually your recipe, e.g. it could be penny Arab IATA. Now not one thing. If you are doing mass
using arithmetics, you might not need a
function name, e.g. if you're doing one plus
21 times two, and so on. Now a recipe needs ingredients. If you can see in blue, those are the
required ingredients, are required parameter. You have to specify them. Otherwise the formula
will not work. And some formulas, they do
not need any ingredients. So you just open parenthesis, close parenthesis,
and you are done. E.g. you have the null function
and the today function. Again, we're going to
see them in this course. In orange, you have optional ingredients are
optional parameters. You can see them. They are between those
rectangular brackets. And if you need them,
you specify them. If you don't need
them, you omit them. It could be e.g. like pepper. You don't need pepper,
you don't put pepper. Then you need to
note a few things. The first one is that the
formula will always start with an equal sign and the parameters will be
between parenthesis. Then if you see here, the parameters are
separated by commas, but that depends on your region. In some region, it will
be so many columns. Check what you have. And if it doesn't work the
way I have it in this course, just check the semi-colons
and you will see if it works. Now there are more than
500 formulas in Excel. In this course,
we're going to focus on hundred plus
formulas because we want to be practical
and efficient. We want to focus on something
that you're going to use on a day-to-day basis. So let's go to Excel and check out how they work in practice. In this Excel sheet, you can see I have
some employee data and I want to get the year of birth first from
the date of birth. So how to do this? The first methodology is
to go under Formulas. And then you can check out
the most common formulas. Here. Here is under data and time. So I can search for
something that has here. Here you go. When you
hover the mouse on it, you can see the definition
of this formula. So now that I have the
formula or the recipe, I can click on it. And Excel will automatically show me what ingredients
are required. What I could do is just
select the date of birth. You can see 1980s three. Otherwise what I could do
is click on this arrow, select the date of birth, then click back and you
get the same result. Now notice that you
have a few things here. Here it tells you what
serial number is. Here it tells you
the definition of the function or the recipe. And if you want more help, you can click here. It will take you to the
Internet and you can see more details
about this function. Let's go back to Excel. Here we go, press. Okay, and here you get
the date of birth. Now another way to
do this is just to click on this fx in
the formula bar. And here you can search for
what you're looking for. So e.g. if I type
here and I click, I can see the year
function here. Again, you have the
help on the function. You have the definition. If I click, Okay, I will get the ingredients. Same thing. This is the
second date of birth, 1975. You press okay, you
get the result. The only drawback about this technique is that
if I try it again, I click here, I put births
here. Instead of here. I do go, I don't find anything. And this is the
limitation of the system. It's not that intelligent, but at least it can guide
you if you put a keyword. Now a third way to do this, and this is what I'm going to
do throughout this course, is just to type the
formula in the cell. So equal year, open parenthesis. Go select your date of birth, close parenthesis. You get it. Then finally, what you could do is go to the Formula bar and type here and select your date of birth,
close parenthesis. And you'll get it also. Now, obviously I'm
not going to write the formula for every cell. What I could do is drag
my current formula. So I can go here. I can click on this corner. You can see that now
the mouse is across. You just drag down and
you get all the results. And notice how you have B5
now it's B6, B7, etcetera. So Excel is intelligent
to understand. I want the year of every
cell in the data of birth. Now, in one of the
lessons in this course, we're going to learn how to
do the referencing correctly. So don't worry about
this right now. The other way to
drag this formula, let me just remove the data
is just go on this corner, double-click and it will
drag the formula down. Now the next one I want to
do is the area code. Here. Before using a formula, I want to show you
a trick because you shouldn't always try to do
the most difficult thing. Sometimes they are
simple solution that will save your time. So here the area code is 057. If I type 057, it's not good
because I'm going to lose the zero in front
of the five-seven. What I could do is put an
apostrophe and put 057. And then if I start typing the second one was
the apostrophe, Excel automatically recognizes
the pattern and tells me, do you want to do the
same for all of them? If I wanted, I just press
Enter and it's done. So now let me show you how
to do this with a formula, because this course is about formulas at the end of the day. So I can use a
formula called left. Again, we will see
it in this course. You can see here, the cool thing about formulas in Excel is that this
is the recipe. Once you type it and
you open parenthesis, you will get the ingredients. So here I have texts and
number of characters. If I write it in the formula bar equal left open parenthesis, this will appear here. So I need my texts. This is my text comma
number of characters here. This is an optional argument, but I need three characters. So I'm gonna put three
close parenthesis, press Enter, you'll get it. You just drag and get the rest. And finally, I want
to show you that sometimes to get an ingredients, you might need a recipe, e.g. if you're cooking pin Arab IATA, you might go by the pasta from the supermarket so it's done, or you might buy
other ingredients and make your own pasta. So let's try it here
where I'm going to extract the username
from the e-mail. So if I use my left
formula again, left text here I have eight characters
for additional fee and I close parenthesis. I get adenopathy, that's great. But if I double-click,
I have a problem. Why? Because every person has a different number of
characters in their name. So for this, what
I can do is change this ingredient with another
recipe called Search. So here if you do search, we want to find the add
sign in double quotation. Don't worry about
the details about the formula and
how I'm doing it. It's okay. We're going
to learn step-by-step each formula and how to use it. But I just wanted to show
you how you can have a formula within a formula
within text is here. And the start number,
I don't need it. So let's close
parenthesis, press Enter. Here you get an at sign. So what I want to
do is do a minus one here in the
number of character. So this, all this is
number of character. It's my recipe. You double-click and
you get the result. So this is what we're going to see throughout this course.
6. S2 L3 Referencing other workbooks / worksheets (*): So far when we wrote formulas, we only reference cells
that are in the same sheet. But what if I want to
reference sets that are in another worksheet or even
another workbook altogether. So this is what we're gonna
do right now in this lesson. We have here a list of
employee names, the bonuses. And what I want to do is calculate the bonus
in US dollars. Obviously, what is
missing is the salary. The salaries are
in 2.11 to 2.15. So here you see the employee
names and the salaries. And it is important to
note that the names are in the same order as you have
them in the other sheet. If they were not, it would be a problem when you
drag the formula. And we're going to see
in part five, e.g. when we use lookup formulas, how to deal with these problems. So now let's go back to our sheet and let's
try something. If I do equals and
I select this cell, obviously I get the
name of the person. Now if you click on
it and you press F2, you can see that you
get the same name. Now, if I do something else, if I add a sheet here
and I put five in A1. Now let's go here and reference
this five. Press Enter. And here you get the five. That's great. Let's go here. Press F2. You can see that you get
the sheet name followed by an exclamation mark and
then the cell reference. Now, if I press Enter
and go back here, double-click to change
the sheet name and do a, B, C, D, E, F. Press Enter, you go back. Let's go back to the formula. You can see that now the name
has automatically changed. And I can see two apostrophes. One apostrophe before a, B, C, and one apostrophe
after the f, y. It is because I have now a space in the
name of the sheet. So any special
character like this, it will put apostrophes
before and after. But the good news
is that you don't have to worry about any of this because Excel
takes care of it all. Now let's do our exercise. So I can delete those two and go to the first one to equal. Now I can select
these five per cent by clicking on the mouse. Or I can use the
keyboard arrows. I'm going to use the
keyboard this time. Left arrow, I select
this one times. Let's go to this Excel sheet. Select the first salary, press Enter, and here
you get your answer. So let's double-click or you
can just drag it like this. Same result, you will
get all the bonuses. And notice how here
I have B2 and J2. If I go down, I have
b3 and J3, and so on. Excel recognizes the pattern we're going to see
in another lesson, how to fix this to make
it work all the time. Now, let's try an example where we have the data in
another Excel workbook. So I can go here, right-click, move or copy, new
book, create a copy. So if I press Okay, now I have a new Excel workbook. You can see book one and you can see the
name of the sheet. Let's save this one. Save as I can select e.g. empty, I can call it test. And now I have my test workbook. So let's go back
to the other one. Go here and try the formula
equal five per cent times. Let's go here. This
is our test workbook. Select the salary, press Enter, and if I go back to the
formula, Let's press F2. You can see you get first
the name of the workbook, then the name of the sheet, and then you get
the cell reference. So this is how it works. Now, let me show
you something. Now. If I double-click to drag, I have different numbers here. Why? If you see here we have J2, J2, J2, and so on. Instead of getting
J3 for this one, J4 for this one, J5 and so on. Why? It is because you have
those dollar signs here. And when you reference
and other workbook, this is how it comes first. So we're going to
remove them for now. And as I said, they will be a
lesson on cell referencing. So now we double-click and
we get the same answers. So now everything is flexible. If I put ten per
cent, these changes, if I go here, change the
salary to hundreds, go back. You can see that it will change. This one doesn't
change because it refers to another workbook. So I have to go to
the other workbook here and change
it e.g. to 1,000. I go back and I get the results.
7. S2 L4 Order of Preference in Calculations (**): As you get more
advanced in Excel, us are dealing with more
complicated formulas. And you will need to understand the order of preference in calculations to be able to
troubleshoot your formula. So let me ask you a question. Among this. What is number one in order of preference in calculations? I'll give you a couple of
seconds to think about it. When it is the parenthesis
and the reference operators. So e.g. five plus two times 45 plus two equals
seven times 428. Similarly, you have
a sum formula, B2 to be four comma C2 to C5. So first you some
B2, B3, and B4, then you sum C2 to C5 and
sum everything together. What is number two? It is the negative side, minus four times two. First the minus four, you multiply times
two minus eight. Number three, the percentage, 10% times 51st, you do the 10%. So 0.1 times 58 is five. What is number four? It is the exponential. So three to the
power two times two, that's three times three, that's nine times 218. Number five, multiplication
and divisions. So five times two plus one. You do five times
two is ten plus 111. Number six, addition,
subtraction. So five plus two minus
15 plus two is seven, minus one is six. And here I have to tell
you something if you have signs from equal power. So e.g. this five plus
two minus one start from left to right. So you do five plus 27, and then you subtract the one. And finally, we have
the comparison. So one plus one
equal one plus two. The result is false. First to do one plus one, because addition is more
important than comparison. So that's 21 plus two, that's three to
equal three false. So I prepared a few
examples for you in Excel. Here you have a lot of examples. I want you to take some
time, pause this video, and try to get the answer
for each one of them. Notice something. When we say some C3, C4, it's cell C3 and C4. So I'll give you a
couple of seconds. Pause it. Here we go. Those are the answers. So I'm gonna go
through them slowly. You can find the answer in the same workbook
underscore completed, or you can look at them here. What I want to mention is
something important here. If I do force plus true, what do you think
would be the answer? Let me press Enter. You'll get one. Why? Because in Excel, force is equal to zero and true
is equal to one. And that would be a
very important concept in some of the formulas,
like some products. Where are we going
to use it to filter data and then do some
multiplications and so on. So here using the same concept, falls plus one is equal to
zero plus one equal one. False times one is zero because
zero times one is zero. Plus one is one plus
one equal to and through times one is one
times one equal one. Final thing I want to show you. Here, you have a number behind
it, you have a formula. Instead of copying
the formula control C escape coming here, putting an apostrophe
and then control V. What you can do is use a
formula called Formula text. You can see it here. It only has one parameter which is reference,
which is the third. In this case, press Enter. You'll get the formula directly. And sometimes you want to copy paste formulas to
check them out. So you can use this formula. It can come in handy.
8. S2 L5 Cell referencing (**): Let's talk about the
dollar sign in Excel. And before you get excited and you start thinking about
money and finance, it's an Excel course. So the dollar sign
means something else. Let me explain to
you the situation. Let's assume that here you have three numbers and you
want to sum them. I can just do sum. And then close parenthesis, press Enter, I get
six. That's fine. If I want to sum the
second row, again, I can do some and then select
the numbers, press Enter. The problem is, if I have
hundred draws like this, I cannot write each
time the formula. I need to take this formula, drag it like this. And Excel needs to
understand that. Now I want to sum
those three numbers. And this is why the concept of cell referencing is very
important in Excel. So here we're going to look
at relative referencing, absolute referencing
and mixed referencing. So let's start
with the easy one, which is relative
referencing. Here. If I do equal my first number, that's A1, that's fine. Now what if I drag the
formula to the right? What do you think will
happen while you get 2.3? Because I move one
column to the right, Excel will move the formula
one column to the right. So you can see here I
have B1 and here C1. The same thing will
happen if I move rows. So here e.g. I. Had a one, it becomes A2. Because I moved one row down. Here, it will become a three because I moved two rows down. Now let's do the exact
opposite, absolute referencing. So I'm gonna do the same thing, equal A1 with one difference. I will come to this formula
and I will select A1. Press F4 one time. If you can see you get
$1 sign in front of, $1 sign in front of y. So now if I drag to the right, what do you think will happen? We get the same number. Why? Because there is $1 sign
in front of column a. It means I don't want
to change the column. No matter what I do. Here when I move column
a stays the same. Let's just drag down now. The same thing will happen because I have $1
sign in front of one. I'm telling Excel, if I move
the formula, I copy it. I don't want to change the row. Now let's do something
in the middle. Here, equal A1. Press Enter. What I'm gonna do, come to A1 and
press F4 two times. So as you can see, if you
continue pressing F4, you gotta get to A1. So here I want $1.01. Now press enter. What will happen if
I go to the right? Do you think it will change? Well, yes. Why? Because there is no dollar
sign in front of column a. Which means that if I move
a column to the right, the formula will move with me. So this is why you
get B1 and C1. Now let's try to drag
down what happens. You get the same numbers
because there is $1 sign in front of
one, you move down. It will not move down. Here. A1 stays A1. Here, V1 will stay B1, and C1 will stay C1. Let's do the other way. Equal A1, press F4 one time, two times, three times. So now the dollar sign is in front of a I drag to the right, I get still one because I
don't want to change column a. But if I drag down, it will change because I'm allowing Excel to
change the row. So now let's go to an example. If you see here, I have the
prices of three houses, hundred thousand dollars each. But the growth
rate is different. And my assignment is to calculate
the price of the house, of each house every
year for five years. So when you have a
table like this, it is better to
have a formula you can drag because in one go, you can make all
the calculations. Now, if you see in year one, I have a house for 100,003
per cent growth rate. It means is gonna be 103,000. So let's write the formula. Don't worry too much about the formula because later
on in this section, we're going to understand percentages and growth
rates, et cetera. So for now, the
formula is equal to my house price times one
plus the growth rate. If you see it will be
100,000 times 1.0, 303,000. The only thing I want
to add is to the power, the number of years. So here I have 103,000. Now, if I drag the
formula this way, you can see that
something is wrong. I'm getting a huge number here, an error, et cetera. Why? Let's go to this
one. Click on it. And that's a cool
feature of Excel because you can see
each cell that you have selected in a color that's easy to be able to
troubleshoot the formula. And you can see that my
price boat has shifted, my growth rate has
shifted, and so on. So I need to fix them. So to fix them, Let's go
back here. Let's use F4. So we click on B3, do F4, and here C3, F4. And then what about d1? Well, I want it to move
if I move to the right, because here I have two years, three years and so on. So let's keep it like this. Press Enter, drag it, you get the right results. Now what if I drag down
to the second house? You can see I'm
getting a value error. Why? If you go to the formula, you can see that this
one has shifted down. So that's not good for me. I need to fix it.
So we go up again. What I want is to move
columns, but not rows. So here I can add $1
sign in front of one, or just keep pressing F4 until
you get this combination. Press and drag it. Now like this, It's the same, like this. I'm getting values. But there is a problem
because here it's five per cent growth
and not three per cent. So I should have gotten
hundred and 5,000. So now, if I click here
on the formula and check, you can see that those two
cells did not go down with me because I have $1 sign
in front of the row three. So let's press Escape. Go here, remove the
dollar sign in front of row three here
also, press Enter. And now, if I drag
the formula down, you can see that I'm
getting the right results. So this is why cell
referencing is very important. To be able to write the
formula one time and drag it.
9. S2 L6 Hack - How to Copy Formulas and reference original range (*****): It's time to teach
you a trick in copying formulas without
having any problem. So now the situation
is the following. I have some data here, and I have some formulas here. And I want to copy
those formulas down while still referencing
the same range. Now some of you might think
about using the dollar sign, but it's not going to work
because you need to just drag the formula to the
right and to the bottom. Now, if I try to copy paste
the formula normally here, you get a division error
because if you click, you can see that now we are
referencing other sets. So let me press Enter
and delete this, and let's get to
know those formulas. So here if I click, I have b3 minus D3 over D3. So it's actually over
stretch targets. Press Enter. Let's see this one. This is for year two. Again, actual versus
stretch targets. What does it mean? It means that I can
drag the formula. So if I drag it
like this and down, I'm getting the right results. The problem comes if I try to derive the
formula like this, you can see that the
number changed. Why? Because now we have
actual versus base. Now if we go to year two, also we have actual versus base. So here also I can drag
it and no problem. Now, if you think
about this strategy about copying this
formula, control C escape. I come here, I do Control
V, and then Enter. That's cool. And
you can drag it. But if you didn't know
what's happening here, what could happen to you is this and you have wrong results. So what is the best way to
copy paste your formulas? Let me show you. First of all, we select
our formulas and we do Control H or Control
H is for replacing. What I want to replace is this equal sign
with my initials. So you can use your initiatives, you can use other things. It's fine. Your name, as long as it's not something that
Excel will recognize. I'm just going to use
a dual replace all, press Okay and Close. And you can see I have my
initials before the formula. Now let's copy
paste the formulas. Put them here. And now let's select
all the columns. Control H, and let's
do the reverse. So RA and you do equal, replace all, press OK, close. You can see that your
formulas or copy pasted exactly as
they should be. And this is the trick that
you can use in situations like this to avoid any surprise. Whereas the formula has
changed and you didn't know.
10. S2 L7 Common error types (**): Even if you are
advanced in Excel, you will face enters. There is no way around it. The good news though is
that in this lesson, I'm going to show you
the most common types of errors and how to
deal with them. And the way we're going
to do it is first start with the arrows so you
can visualize them. And then we will recap
everything at the end. The first error that you
see here is the hash error. What does it mean? Basically, if I
click on this cell, you can see that
there is a number. But the problem is that the cell is too small for the number. So this is why you
see it with hashes. The solution is simple. Either double-click here so
you see all the numbers, or you can manually adjust it so you don't get
this error anymore. The second one is d value error. So if you see here I
have a value error. Let's check out the formula. What's happening is that
we are subtracting NA, which is a text from a number. Here, Excel doesn't
know what to do. So it gives you an error. To fix it. You can just come here, put any number,
and it will work. The third one is
the spilled error. This one you will only see
in newer versions of Excel. Why? Because if you see here, I have a formula. Formula is sought
all these employees. So sorting will return a
list of employees sorted. And you can see here
this blue rectangle. This is where the
results will be. Unfortunately, I have a cell
here blocking the way. Here. There should be a value
from this formula, and this cell is not
letting it happen. An Excel cannot override
the content of this set. This is why you get
the spelling error. If you move this like this, the error will be gone. And that also could happen
when you have more cells. The fourth one is a name error. So basically here
I have a formula called substract E4, E5. Unfortunately, in Excel, you don't have a
subtract formula. What can you do? Just do this minus
this, and it will work. The second way this can happen is if you have
a match formula, don't worry too
much about match. Basically what I'm doing is looking for
difference which is here within those cells and returning the
position of difference. The problem though, is that difference should be in double quotation
because it's a text. And then without
double quotation, it was taking it as a variable. So this is why you
had a problem. Here. Error is fixed. No more issue. Number five. Here you have some data. If I delete this column,
let's do like this. Right-click. Delete Shifts Cells left. You can see that you
have an error because this formula was referencing
the cells that got deleted. Now Excel doesn't
know what to do. So the way to fix it is just
to refer to something else. Or let's do escape. If we do control
that and bring back this column Number 6/0 error, this is a simple one
because basically if you divide a number
by zero like here, you will get an error. If you do it by a blank cell. Again an error. And also if you do it
by false because we saw in a previous lesson
that false is equal to zero. If we do this, we get
a divided by zero. The last one is an N A error. And you will face this
one mostly in lookups. So let me explain to you
quickly what happens. Here. We have a VLookup. If I click on it, we are looking for three
now in this red rectangle. So in this dataset,
Trina is here. And we want to return
the salary of three now, which is the second column here. So threonine is there and
we are getting the salary. No problem. But what if I'm looking
for Johnstone's? And Johnstone's is
not in this dataset. So I'm getting an N
A error to fix it. Either add Johnson
to your dataset. You can use a formula
called f error. So if error, open parenthesis, the first argument is a value. So this is the value, It's my lookup value, comma. If it's not an error, it will return whatever
you have here. In this case it's a VLookup. If it's an error, let's
return at texts e.g. not found in double quotation, close parenthesis, press Enter. You can see the error is gone. So let's go and recap the types of errors
that we have seen. The first error we saw
was the hash error because there was a number in the cell and the cell
width was too small. So in this case, just increase the weights
and you're done. The second one is a value error. This was the one where
we were trying to subtract a from a number. And this doesn't work. What you need to do is
check each argument to see if it's the right
value so that it will work. Number three, the square error, which is for dynamic
array formulas, which happens in Excel
2021 and Office 365. So here you have no space to spill the
result of a formula. So in this case, just clear
the space where you have this blue rectangle and it will work and ensure that you
don't have any more sense. Number for the name error. Easily you have the name
of the formula wrong, or you have an argument in the
formula that doesn't work. So check their names. Sometimes you will forget
to type one letter and check each argument and
then you can fix it. Number five, the ref error, which is one you had a
formula referencing is said, and you delete the whole set, then it doesn't know what to do. So in this case, just
use Control Z to undo your action or just fix
the formula number 6/0. As its name suggests. You just make sure
that you don't divide any number by zero
and you're done. And the last one, which is the hash
and a one you don't find the lookup data
in your lookup array. You just add it or use an IF error formula
and you can fix it.
11. S2 L8 Formula Auditing Part 1 (***): So far, I told you about the common types of errors
that you might face in Excel, but I did not give you the tools to diagnose
and fix them. This is as if you have a Dr. who knows about
the diseases, but you cannot run test to
identify them and cure them. So this is why this lesson and the next one would
be very important. If you look under formulas, you will see that you have
a formula auditing tab, which has interesting
options and features. In this lesson, we're
going to look at a few. The first one is
Trace Precedents. Basically you will select a cell and you will
be able to see all the cells that are influencing the
value of your cell. What you will see arrows going from those
sense to your cell. The second one is
Trace Dependence. And here it's going
to be the opposite. You will select the center. And from this, you will have arrows going to
other cells where the value of those
other cells will depend on the selected cell. And finally, we will
look at show formulas. This one will show you all the formulas that
are in your Excel sheet. If you get the Excel sheet
from a colleague, e.g. you'll be able to quickly
identify where they are formulas and what's
happening in your Excel sheet. So let's go and let me
show you this in practice. Here we have a
Lamborghini example. I chose this example
because I liked the car and I want to make
Excel a little bit less dry. So what we're gonna
do first is try to identify which cells
have formulas. For this, we go under
formulas, Show Formulas. And you can see that the
Lamborghini got distorted. But don't worry,
don't fix the format. You will see why in a bit. If I go to the right, I can see all my
formulas in texts. You can see some here, here, here, and here. So that's great. If a colleague gives
us this Excel sheet, at least now we can know what
are the calculated values. Now if I click on
Show Formulas back, you can see that
everything is fine. The Lamborghini is fine, the format adjusted
automatically. Now, another way to find the
formula is to do control Z. With control G, You can click on special formulas, dressed, Okay? And now the formulas are
highlighted in gray. So that's another
way to see them. You can also go here e.g. and color them in gray. And you can see those
are my formulas. Let's do Control Z. And now let's try formulas
and Trace Precedents. I'm going to select the payment required and click
on Trace Precedents. And you can see the arrows. There are three sets that are influencing the
value of this cell. If I click here, I can see those three sets. Now, let's press Escape
and let's remove arrows. To remove those arrows, we click here, it's fine. Let's try now. Trace Dependence. If I click here, I get an error. Why? Because there is no sun, which value is influenced
by the value of the cell. So don't worry about this error. It can happen. It's not a problem. Now, let's click on loan
amount and do trace dependent. You can see that this
influences the loan. If I go and click on
Trace Dependence, again, you can see that long
influences monthly expenses. And this is a cool
feature of Excel because a lot of times you
will have complicated models. One set with
influence and other, and then the other will
influence and other. Here you can trace
the whole path and troubleshoot errors. So let's remove the arrows. And now we're going to
try a small exercise. What I'm going to
change something here. And we're going to try to
troubleshoot the error. Here. As you can see, I have
problems in my model. In order to troubleshoot this, we just select one of
the sensors value error. And we can do Trace Precedents. And here you can see I have three cells influencing
the value of the cell. The first one is
this to $50,000. Now here, it looks fine to me. I can even rewrite it to check. There is no problem because
I still get the value error. The four per cent also
seems fine to me. So that's okay. Now let's go to the 30 per cent. And here if you notice, instead of a 30, I have three and the letter 0. So that's where I
have a problem. So if I replace
this always a zero, and that couldn't
happen in real life because somebody might
type something wrong. Press Enter, then
your model is fine. We can remove arrows. This is how you can use those tools to
troubleshoot your model.
12. S2 L9 Evaluate Formula & Error Checking (*): So far, we looked
at a few options. In the Formula Auditing toolbar. We looked at Trace Precedence, Trace Dependence,
and Show Formulas. And also we learn how to remove the arrows by using the
Remove arrow function. Now we have two options left. The first one is error checking and the second one
is evaluate formula. Now, Evaluate Formula
is one of my favorites because it will show
you how the formula is getting calculated
step-by-step. Wherever there is a problem, you will be able to spot it. The second one, which
is error checking, it will give you access
to all the other options. On top of that, you'll be able to
go to the internet and get more information
about the error. So let's go to Excel and
let's check them out. We are back to our
Lamborghini example. And here you can see we have interest rate at eight per cent. So assume that somebody
comes and doesn't know how the model works and the person doesn't know
the interest rate. So the person can put an, a, press Enter and you'll
get a value error. So before we
troubleshoot this and evaluate the formula,
do error checking. I just want to show
you another shortcut. If you come here to
our first value error and do Control square brackets, you can see the cells that are influencing the
value of this error. So instead of doing
Trace Precedents, you can use the shortcut. The other way around is that if you have
this four per cent, you do Control square brackets. You can see that four per
cent influences loan amount. If you press on it again, you can see that it
influences the loan. And then another time you
get to the monthly expenses. So now enough about shortcuts. Let's try to evaluate
the formula. Here. Let's go to the loan amount
due evaluate formula. And if I put it here, you can see that the
first formula that will be evaluated is G8, which is the interest rate. So if I do evaluate, I get an a divided by 12. You see it's underlined. We click on evaluate, we get a value error. Now if I click on evaluate, I can evaluate the whole
thing step-by-step. Until I get the value error, I can restart and do it again. There is no problem. And so on. If you want to check it again. Now let's close this. And now that we know
what is the error, obviously we can fix it. But before that, let's
do error checking. So if I click here first, I can trace the error. So you can see that
those three cells are influencing the
value of the loan. Let's remove the arrows. And then if I do error checking, I have a few options. The first one is
help on this arrow. If I click on it, it will go to the internet. It will show me a page where I can check details
about this error. So you can check it. Try to find solutions.
Let's go back. And what we can do is resume. Then if we do show
calculation steps, this is Evaluate
Formula, same thing. Let's close it. You can choose to
ignore this error or you can edit it in
the formula bar here. If you click on this, you can look at
next and previous. And you have options. And here you have some options about error checking rules. I honestly never change this, but I just wanted
to show it to you. Now let's close this. And obviously to fix it, you just put eight per cent and everything goes
back to normal.
13. S2 L10 Go to Special Feature (*****): One useful feature that you
have in Excel and that a lot of pros do not know about is
the goal special feature. Now, I alluded to this
in a previous lesson, but I wanted to dedicate
a couple of minutes on this feature to show you when
it could be useful for you. So here I have my
Lamborghini example again. And what I can do
is Control G. And I can do special and check
out what I want to select. I can select the formulas, e.g. as we saw before, and those are my formulas. If I go back to it
and I go to special, I can select my
constants and press. Okay, so those are
all my constants. Now, as a pro tip, whenever you are
building a model, it is good practice to
highlight the inputs that the user has to enter
in a different color. So it's easy for
the user to enter them and to see the
result of the model. You see here, we have
selected everything. We don't want this. So we can try again Control
G special constant. And here we remove the texts, the texts I don't want
Let's press Okay. Now you have the numbers, but I also don't
want to change this. So what I could do
is select those. Control G, do the same thing. Do constants, remove
the texts, press. Okay? And now we can just go
color this e.g. in gray. And now the user
inputs are very clear. So whenever they change
one of the inputs, they can see the
impact on the payment required and the MSA expenses.
14. S2 L11 Useful Shortcuts (**): If you really want to make progress in
productivity in Excel, I really advise you to
learn the shortcuts. Now obviously, excel
has a lot of shortcuts. But over the next few lessons, I'm going to teach you
the most relevant ones. And at the end, even if it's
not your birthday as a gift, I'm gonna give you a PDF
that comes from excel jet. You'll be able to download it and you'll see a
lot more shortcuts. You'll see them for non
Mac, for Mac computers. So in those lessons, I'm going to show you
the non Mac version. But if you have a Mac, you can follow by
looking at this PDF. Now one recommendation I have, if you are learning Excel, I advise you to learn it
on a non Mac computer because this is what is used in most companies. So let's start. If I'm going too fast, please feel free to pause the video and practice
those shortcuts. First of all, I'm going to teach you something very basic, which is how to do copy paste. What we do here is
we go to cell A2, we do Control C, Control Copy. And then we go to A3. We do control V This time. And then you can
paste your data. You can also select multiple
cells and do Control V. And you paste the data
in multiple cells. Now to undo my action, I can do Control Z. I did it one time, so I did Undo for this. If I want to also remove
what I've done here, I do it another time, and then we are back to normal. If I want to redo my step, I can do Control Y and then
it will redo the step. Next. We're gonna do something
more interesting. If I want to select
my whole data, I can do Control a, and then it will
select my whole data. But here you have to be
careful on something. So I go back here and what
I'm gonna do is add a row. So I'm going to do
right-click Insert. And then if I put my cursor anywhere in the
dataset on the top, I can do Control a, you can see it will
only select this. Why? Because for Excel,
this is my dataset, so it will not see the rest. So be careful when
you do control a. Now we're going to do Control
Z to remove this row. The next thing we gotta
do is navigation. To navigate, I'm
gonna do Control, press the right arrow. I go to the maximum right and
then control bottom arrow. I go to the maximum down, Control Left Arrow maximum left, then control up
arrow maximum up. Here also be careful. Here you don't have any
data and you go to A1, you do control down, it will stop at eight. So be careful when you are navigating or
selecting your data. Because those are common
problems, you might go down. I think that you are at
the end of your data, but in fact, you are not
to continue selecting. You just do Control arrow down and then you
are at the bottom. You can just keep
on pressing it. Same for right, left, or up. Now let's do Control Z again, and let's move to
selecting data. So to select data, I go to A1, e.g. I can go anywhere obviously. And then I will do
now control shifts instead of control and
then use the arrows. So Control Shift
arrow to the right, I select the data, arrow down, I select
the data down, and you can do it
anywhere. So e.g. if I go here, I can do Control Shift arrow up
and select the data from this cell to
the first blank or to the top of
the Excel sheet. Next, we're going to
save the worksheet. To save the worksheet is
Control S like control safe. So that's easy. If I want to toggle
between the first cell where I have data and the
last cell what I have data, I can do Control Home. I go to A1 in this
case, and control, and I go to the bottom
right corner of my data. But for control, and again, I will show you
something so you're aware of it. So let's go here. Let's do Control arrow up. We go to a one. Let's write something here. Then let's go with control arrow to A1 and do Control Enter. As you can see, I got 2.312. Why? Because this is the
bottom of my data. But because I have
something in a, It's going to this cell. Now, even if I delete this
number and I go back there and then I press Control and it will still
go to this cell. In order to fix this problem, you just need to close your
workbook and open it again. Because this is going into memory and this
temporary memory has to be cleared for Excel to
give you the right results. Now let's do something else. Let's create a new workbook. I will do Control N for new. Now I have a new workbook. And if I want to toggle
between my workbooks, I can do Control tab. So then I go back to
my original workbook. If I want to go back
to the other one, another time Control
Tab, and so on. For those who are a bit lost or bit stressed
about this lesson, just pause the video practice. And I promised there are only
a few left for those who want to toggle between sheets. What you could do is
controlled page down. You can see I'm moving
here to the right. And then control page up. You can move to the left. So this is how it works. Let's go back here and
let's do a couple more. If I want to select a column, I can do control space. If I want to select a row, I can do Shift Space. And to add a row or a column, you can do Control
Shift Plus I added, I can add as many as I want. If I want to remove something, I can just do Control minus. And it's going to remove. Now with Control minus, if you do it on a cell, Excel doesn't know whether you want to shift cells this way. You want to shift a
row or something else. So you can select
from this menu, e.g. shifts left. And
you can see that all my cells have
shifted to the left. Let's do Control Z. And let's move to
the next lesson, which is about shortcuts
related to formulas.
15. S2 L12 Formula Shortcuts (*): For those of you who are still overwhelmed by the
previous lesson, I have some good news
and some bad news. The bad news is
that we're going to look at more shortcuts. Those ones are
related to formulas. But the good news is
that we only have four of them and
it's way simpler. So the first one is a f1. When you press F1, it's like
to access the Help menu. Here. I can get e.g. formulas and
functions, and I can e.g. select, use Excel
as your calculator. I can see some details
and I can even see some videos on how
to do certain things. The other way I can
use a font, e.g. if I select this column and I went and I did data
text to columns, I don t know what
texts to column is. I do F1. It will open a webpage where I can see more
details about this. So if I select e.g. this one, again, I have
videos and explanations. Let me close this. And let's do cancer because we don't need to do Text
to Columns right now. We need to move to
the second one. So here I have a formula. You can see it in
the formula bar. If I want to go
inside the formula, obviously I can go and
click on the formula bar, but the other way
is to press F2. So now you can see
the formula here. You can use the arrow keys on your keyboard to
navigate the formula. Now let's press Enter and
let's go to the next one. There is no F3, there is a four. So four F4. Again, we go to the formula. If we click on a J2, if I press F4, you
can see that I can start getting dollar
signs in front of AGN. And then if I do
it multiple times, I get multiple combinations. If you don't know what
dollar signs are, you can refer to one of my
lessons in the same sections. It is very important. It is for cell referencing. So let's press Enter and let me show you the
other use of F4. I nearly never use it like this, but you need to know this one. I think it's cool. If here I come and I
color this in yellow, I can come here and press F4. It will redo the same
action I've done. If I do it like this
with multiple cells. Again, a four day
become in yellow. So let's do escape,
escape, escape. And let's look at the
last one, which is F9. So F9 to first use of it is to recalculate what you have
in your Excel sheets. So in order to see this, I'm just going to put
a formula called now, we're going to study it
later on in the course. Basically it shows you the
current date and time. I'm just going to
change the format. So I click here under
home, you have number. We can go to custom. Here. I'm going to do column S, S 4 s. You can see I'm
adding the seconds. If I do F9 repeatedly, you can see that the
seconds are updating. So it's three,
calculating everything. If you go to Formulas, you have Calculation Options. Now it's automatic. If you have manual on, then you need to press F9
to recalculate the sheet. But the most
important use of F9, which is what we're gonna
do a lot in this course, is to calculate what
we have in a formula. So e.g. here I have a formula. I have a J2 bigger than three. I want to see the results. I can do F9. You can see that I
get false because obviously one is not
bigger than three. I can even select
a bigger piece of the formula and do F9
and I get the result. Now, don't press Enter. Otherwise your formula is gone. Press Escape always
when you do this. Now I showed you a
quick and easy example. But once you have a very
complicated formula, this F9 can come in very handy.
16. S2 L13 Menu Shortcuts (***): These are the last set
of shortcuts, I promise. What I want to show you is how to access the menu
that you have on top. So for this, you press Alt and you can see
the letters on top. So F is four phi H for home
and for insert, and so on. Now e.g. if I press
H on the keyboard, I get another set of letters. And I can go into more details and select
something that I need. Now, obviously, we're
not gonna go into every combination because
there are so many. But what I want to show you is three shortcuts that will
be very useful for you. So let's press Escape
to times to go back. And the first one is
how to insert a filter. So first of all, you can either select one of your title columns
or select the row. And you do a and D, and you get the filter. So if I click here, I can filter my data. Now to remove it, I have to do the same thing, a and D, and the filter is calm. The second thing I want to show you is how to copy
paste the formula. So here I have a formula, as you can see in
the formula bar. If I do Control C and I
come here and do Control V, I have a couple of problems. The first one is that the
reference has changed. And the second one is that I cannot use the value like this. So what I could do to copy paste the formula is Control C. Then I can go anywhere, even on top of the same formula. And dou E, S, and V. You can see that I have
the value selected in my pay special menu
because the V is underlined. So when I pressed on it, it selects to devalue. Let's press Okay. And the formula is gone. The last one I want to show
you is Evaluate Formula. This one is Alt V. And you get the
Evaluate Formula. So you can start
evaluating your formula. So that's it for shortcuts. In the next lesson, you will get a PDF where you
can see so many shortcuts. And you will also
see the Mac version. Because whatever I
shown is for PC.
18. S2 L15 Increase the size of the Text in the Formula Bar (*****): I am not sure if you can
relate to this situation. But this happened to me so many times in my corporate life. So I go to a meeting and somebody is presenting
something in Excel, and then they start
changing formulas. But I'm sitting at the back
of the room and I cannot see anything because the
formula bar is too small. So this is what I'm going
to teach you right now. So if you see here, I have in this cell a formula
in the formula bar. The problem is that
it's hard to read, especially if you are
standing far from the screen. So if you go and you try
to change the font e.g. to 20, the problem is that
it only changes here, but not in the formula bar. So let me put this back. What do you do then? You go to Phi, more options. I don't know if you
see the options in the same place as I have it. But depending on
your Excel version, you can find it.
Let's do options. If you see here you
have font size. I'm going to put it to 20. Okay? You'll get an alert. Press. Okay. Now you have to restart
Excel to get the new font. So I'm gonna do this right now and come back. There you go. I am back. You can see that
the font size of the formula bar has
increased dramatically, while my font here
remains the same. So now you can go
to your meeting. You can talk about your
formulas and fix them. But don't forget once
you finish the meeting to put back the font
to 11 or what it was. Because if you open
any other exam, it will be with this font
for the formula bar.
19. S2 L16 Basic Excel Formulas you need to know (*): So far, we only
looked at some of the fundamentals to improve
your productivity in Excel, but we did not deep
dive into formulas. So some of you
might be frustrated by this because you
want more action. But trust me, trust the process. You will be able in the long run to be more
efficient in Excel. You won't have to
memorize formulas. You will be able to understand them and use them correctly. Now, in order to
remedy the situation, what I want to do
here is show you some of the most juice
formulas in Excel. You can take them and use
them in office tomorrow. So let's start. First of all, we're
going to look at some mathematical
operations quickly. You have seen some of them. I'm just going to recap it. For addition, you just do equal, select your first number
plus your second number. If you don't like one of them, you can just click
on the edge and then you drag and you can
select another one. Now, I'll press Enter. You'll get the
answer or substract. There is no subtract
formula in Excel. What we do is we select the first number minus
the second number. And of course, if I want
to add another number, I can just do gloves
and select it. Then you have divide
by four divide. We take the first number, divided by the second number. Press Enter, you'll
get your answer. And then multiply. I select my first number
times my second number. Now, if I want to
use parenthesis e.g. and I can do like this. Let's say plus one
close parenthesis and you get your result. Now let's move to more
interesting formulas. First one is the sun. If I want to sum
all those salaries, if I do equal, first salary loss, second salary plus
third salary and so on. This is very tedious. Obviously I won't do this. But what I'm going to do
equals sum, open parenthesis. You select your range, close parenthesis, press Enter, and you get the sum. Now another way to
put some in Excel, I'm just going to delete this. You go to Home and
then you click here, you have the most
common formulas. So here is some. You just click on it
and you get to some, you can see that except selects the data for you,
which is great. If the range is wrong, you can just come
here on this edge. You can see how the
cursor is changing. Just keep it clicked. And then you just move up and
you can select other sets. You can also move to the right, to the left, whatever. And if you want, you
can just come here and change the range in
the formula bar. So let's put C, e.g. and here you can see by click that we
selected this range. If we press enter, we get the same result. Let's remove it also. And let's go to Formulas. And under formulas you have
autosome, same principle. We click on the sum, we press enter, we
get the result. Now, this AutoSum can
work also the other way. If I have here one and I go
AutoSum and I click on some, it will take e2 and F2 for me, I can press Enter and
I get the result. There is also a
shortcut for some. For this shortcut,
Let's remove this. We will do Alt and equal, and you get the same thing. Now, enough of some, let's go to average or average. I'm just going to go to
AutoSum select average. And here it took
the wrong Grange. I can come to this other edge. I will do this. Press
Enter, and we are done. The other thing that I
want to show you with average is assumed that
your data is here. And here. It's not in the same place. If you go here you can see
that I have this helper. I have averaged number
one, number two, etc. If I press comma here
I have number two. So I can select another
range of numbers. I can also select one
number, doesn't matter. I can do like this. Comma another number,
comma another number, or just select them like this. If you have a non-continuous
range, you can do this. It works for all the formulas. Next one is count numbers. And I want to count
those numbers equal count, open parenthesis. We select our numbers, close parenthesis, press Enter. Here I have six. If I delete this, I have five. We will do Control Z. Now, let's apply the same
to the employee names. You think it's going to work. We can try equal cow,
open parenthesis. We select this and then we close
parenthesis, press Enter. Here we get zero. Why did we get zero? It is because count
counts only numbers. To count numbers and text, you have a formula called count. So I go here, I add an a, press Enter and you get six. Now, if I change
this to a number, you still get six. If I have a blank, you get five. Now let's do Control Z two
times to get by a name. And let's continue. You have two formulas that I
like, minimum and maximum. I don't have to
explain them to you. I'll domain and I select my data to get the
minimum salary. It is 50,825, which is this one. And for max, open parenthesis, select the salaries and I
get the maximum salary, which is 104 K. The last one I want to
show you a discount if because a lot
of times you will need to count things
and you want to exclude you have some
condition were to do this. We're gonna do equal count. If you can see here that I have a definition
of the formula, this will be very useful
for all formulas, especially if you don't
know exactly what it does. Open parenthesis. You can see here we have
a range and a criteria. This is my range
comma four criteria. Let's say I want to do
bigger than 100,000. So I have to put it
in double quotation, bigger than hundred thousand. And then we close the
double quotation, close parenthesis, press Enter. You'll get one. Because there is only
one salary above 100 K. If I want 60 K, I can just come and change it here and I get for salaries. Now the other way to write
this is the following. You can take this out. And then after this you
have an ad and you write 60 K. Whereas enter same result. Another way to do
this is to take the 60 K and then refer to this cell and
put the 60 K here. That also works. Now, the last way to do this, and this also applies
for all formulas. So this is an important
concept that you are seeing. I can remove all this. Keep the cell reference, press Enter, I get zero now, because when you
don't put a sign, it means that you
have equals 60 K. This is what Excel
takes as a default. But to make it bigger than 60 K, I can put the
bigger sign here in the cell and you
get your four back.
20. S2 L17 Calculate Percentages correctly (***): In the business world, no matter where you work, whether it is in finance, HR, or sales, you will have
to deal with percentages. And a lot of times in order to calculate your
percentages for your reports or for your PowerPoint slides
and presentations. You will use Excel. I want to dedicate this
lesson to show you the most common types of situations where you gotta
deal with percentages, how to compute them correctly. So the first one is
actual versus budget, or whenever you're comparing
number a versus number b. So here the formula is equal
to actual minus budget. All of this is over budget. Now, if we try to
simplify this equation, we can have actual divided by budget minus budget
divided by budget. Budget divided by
budget is equal to one. Then you have actually
over-budget minus one. So let's go to
Excel and let's try a practical example
using this metric. So here in this example, you have actual numbers, budgeted numbers, or
some business divisions. And what we want to do is calculate the actual
versus budget. But let's do it here. Equal actual divided
by budget minus one. And then we press Enter. Here you have 50%
less than budget. Double-click and you
get all the numbers. The next one is
percentage change. You have a number, you want to increase it or
decrease it by a percentage. With the metric is
equal to the number plus the percentage
times the number. Now this percentage could
be negative or positive, doesn't matter. Same concept. What you can do is
factor this number. When you use factor, you will have number times
one plus percentage. All this will be in parentheses. Let's try it out in our exact, given the same numbers, I want to take the
actual and increase them or decrease them by this percentage that
you can see here. No problem. We're gonna
do the number times one plus and the
percentage here it's 7%. For the first one, we
close the parenthesis, press Enter, and
we double-click. And if you noticed here, when I have a decreased by 4%, the number is 8,113. You go to 7,788. It works. And if you remember, in one of the lessons, we looked at house prices and how they increase over time. And we use a formula that
is similar to this one. The last one is the
most complicated. It is about giga is basically equal to
the average growth rate. If I read the definition, compound annual growth rate is a business and investing
specific term or the geometric
progression ratio that provides a constant rate of
return over the time period. It sounds very complicated. If you try to understand
this definition, you got to have a headache. So in simple terms, as I said, it is to try to calculate the average growth rate that
you have over a time period, including the
compounded interests. I'm going to show you an
example to understand this. And this can apply to anything. It could be some sales numbers, financials, budgets,
etc, anything. So here we take an
investment case. We have hundred dollars
in 2020, we invest them. At the end of the year. We get $110 or ten
per cent return. Temple, second year, we take those hundred
$10 that we got. We invest them at ten
per cent, we get $121. Now we got ten per
cent the first year, and then we got ten per
cent the second year. What does it mean? My
keyguard is ten per cent. Now notice how I
reached under 2,120, and this is what I meant
by compounded interests, which is interest on interest. So here I got $10 on the
first year as in return. And I got interests of $1
on this ten dogs right? Now, if we look at
it simplistically and you say I had $100, I got 121 at the
end of two years, I got $21 over 100, which means 10.5 per cent. This is too simplistic and
this is not the right way in the real world to calculate the growth rate
of your business. Now, I'm gonna go to some
mathematical formulas. I know some of you
will not like it. But if you follow
it step-by-step, you're going to see that it's
very easy. In this case. I got 121 by investing hundreds at one plus k
times one plus giga, because I got that per cent. Who times right for two years. Now, if we simplify
this one plus K, We can do it to
the power of two. And then we have
the same formula. I want to do is take the
hundred to the other side. So one plus K goes to the power two is equal one-twenty 1/100. Then I need to get rid
of d to the power to the one plus k is equal to
12100 to the power half, because in the other side
it was to the power of two. You move it, it becomes
the power half. And then I can get
rid of the one. That means that I'll have one-twenty 1/100 to the power
half and then minus one. If I look at the
formula now of Kaguya, it will be the end amount
over the starting amount. All this to the power one
divided by number of years. Here I have only two years. This is why I had half
and then minus one. Let's go to Excel
and let's practice. So here I have a case where I started at hundred 50 terms of sales and I ended up at
178 after five years. So my keyguard, if I use
my equation, is equal to, let's open parenthesis
178/150, close parenthesis. I'm using here parenthesis, or the order of preference
in calculations. But we do to dope our
open parentheses. One divided by the
number of years, close parenthesis,
then minus one. So here I get 3.48 per cent. How to make sure that
this is correct? Well, we can do the opposite. Equal 150 times one plus 3.48, close parenthesis to
the power five years. And then we press Enter, you get your 178. Now, I just want to show
you one thing about percentage just before
we finish this lesson. Now, 30 per cent
could be written 0.3, or you can just
type 30 per cent. But that works. You can see here,
if I go to Home, this automatically
becomes a percentage. If you have the 0.3, you
click here, you get 30%. But if you type
30, here, you go. And you press on the
percentage sign, you will get 3,000. But this will not work. You'll have to type 30 again. When you look at percentages, it is better to just format the cell or just write
30% from the beginning.
21. S2 L18 Circular Reference (*): Circular reference, or what I call the
chicken or egg problem. This will happen
mostly when you have complicated formulas
or Excel models. And usually what you
will see when you open your Excel sheet is an error
message like this one, which says there are one or more circular references where a formula refers
to its own cell, either directly or indirectly. This might cause them to
calculate incorrectly. Try removing or changing this references or moving the formulas two different sets. To understand what this means. Let's look at an example. Here. I have three sets, A1, A2, and A3. A1 is equal to one,
no problem there. A2 is equal to A1 plus A3, which means that its value
depends on A1 and A3. Now, a three is equal to A2, which means that its value
depends on the value of A2. Now the problem
is the following. A2, its value, it depends on
A1 and a 3.3 depends on A2. Now, it's like a
chicken or egg problem. And extend doesn't
know what to do. So it will give you a
circular reference. So let's go to Excel, check this out and fix it. If you see here in
the Excel sheet, we have two arrows. One is pointing to this cell, the other one is
pointing to this cell, which means I have a
circular reference. Now, assume that you
are here and you don't know if you have a
circular reference or not. What you can do is
go to Formulas, then you have error checking
under the formula, auditing. And if you remember this one, when we click on it, we have circular references. We can see them here. If we click, we can go directly to the
circular reference. Now, if you see this
one, if I click on it, we have equal V2 times
one plus before, which is the interest rate. I will press Escape,
go to this one. This one depends on the
value of V3 and V2. So now we have the same problem. This one depends on this one, and this one depends
on this one. So what I can do is just put eight per cent here
as an interest rate, and then the arrows are gone. I don't have any model
circular reference. And if I click here, you can see that circular
references is grayed out, which means that those
circular references are gone.
22. S2 L19 Data Validation Basics (*): The quality of the data
that you collect will be crucial for your analysis in
Excel or even your model. And a lot of times you want to avoid this problem
of garbage in, garbage out, which
means that you have bad data inputs and
unreliable model results. So in order to do this, you might want to restrict what the user can input or even give him or her options as a drop-down menu
to select from. All this is called
Data Validation. So there are different
types of data validation. Number one is number. It could be a whole number
versus a decimal number. Number two is restricting the
value that you can input. The value can be smaller than, bigger than equal, etc. Number three is providing
a drop-down menu. List of items. Number four is
restricting the date and time would be between some
numbers bigger or equal. Center, then you
have text lands. This is useful in cases
like e.g. a. Phone number. You want to make sure that you have the right number of digits. And then you have custom where you can do
something custom, e.g. put a formula. Now, if you're an advanced
user in drop-down menus, you want more examples
and information. You can check out my
channel on YouTube, Excel wizard in minutes. It will have a playlist
where you're going to learn how to do dependent
drop-down menus. Which means drop-down
menus that will have options based on what the user selects in the
first drop-down menu. If you want to learn
more about the exam, no matter what your level is, you can also check my channel. The last thing I
want to show you is that or data validation. You can put message,
input message. And you can also define an error message in
case the user makes an error to understand what is the error and what is
required from the user. So now let's go to
Excel and practice. We are back to the
Lamborghini example, which is my favorite. Here. If you see, I have
lands in years, so I have five years. But what if I put 100 here? Nothing happens, the data
updates, and that's it. But usually this is unrealistic and this is defined by
the policies of a bank. If I want to restrict what
the user can put here, I can use data validation. But what I'm gonna do
is type 5.15 here. And I want to make it
as a drop-down menu. Well, I can go to Data. Under data, you have
this data validation. I can click on it. And then you select list. Either here, you can
type the numbers five, comma, then comma 15, so separated by commas. But that's not a
recommended approach because they are hard-coded. What I recommend you to
do is click here and select them from an Excel
sheet or type of formula. So here we are. Okay,
we press, Okay, we come here, we have
510.15, which is great. Now, if I change 15 to 20 and you go back
to the drop-down menu, it is automatically updated. The other thing I
want to tell you is that this is a protein. Don't write your values here because somebody can
come and delete that. It's not best-practice. What you could do is two things. The one that I prefer is
to type the values in another Excel sheet that will have the values for
your drop-down menus. Or what you could do
is just press Control. Arrow to the right. You go at the end of the sheet
and then you can do 51015, and then you come back. You can refer them by updating
your data validation. Let's click, let's do
Control arrow to the right. Select those three values, and then we press Okay. And the same thing
will be there. Well now if I delete those,
there is no problem. Now let's look at this. 30%. 30% is the down
payment percentage. I don't want the user to come
and put -50 per cent, e.g. again, doesn't make sense. To restrict this, what I could
do is use data validation. Same thing, we click here. But this time we're
going to do estimate. And we have between
what we want, let's say 10% and 50 per cent. Not right then per cent, right? 0.1 and here 0.5. Press Okay. Then if the user types
something wrong, e.g. 166 per cent, you will get or she will
get an error message. Now how to customize this? Let's put cancer. Let's go back and let's go first to input message.
So that's e.g. input. We can say
data validation, whatever you want to help
the user. For error. We can have error
here as the title, and here we can say value
between 10% and 50 per cent. And we press, Okay. You can see that whenever I
select this cell, I get this. Well, if I go out and disappear, now I go here. I put something wrong, 78%, and I get the
message that I've put. Let's put 30 per
cent and try it. You don't get an error message. Now let's do something
more complicated. And let's try to have a formula
in the data validation. So we're going to
use any formula. Don't worry too much about the formula because we're going to see it in
the next section. But it's just to
illustrate the concept. So here I'm going to put 15.10. Now, assume that we want this tenure number of
years or two doors, and we want this
tenure for for dogs. So here I'm just going to
type two doors and I'm gonna go here and do
a data validation. Well, we get this. Let's go
to settings and change this. And let's do equal IF formula, again, don't worry
about the formula. There's just select
the right cell. So we go here. The cell is the door
is equal to two comma. Then we want to try this data. If the first one is that
if it's equal to two, the second one, if
it's not equal to two, Let's select this. And then we say, okay, now we have two doors. What do you have? 1510. And if you have four doors
now, what would you have? 510.20.
23. S2 L20 Unstack your data with this trick (*****): Even if you wait for
Christmas and as Santa Claus for some
nice and clean data, it's not going to happen. A lot of times when you
download data from a system, it's going to come in
a very messy way and you have to fix it before
you start your analysis. Now, in this course, you will have a lot of
formulas to do this. But what I want to show you in the next three lessons is how to have the data in
the right cells. So in this lesson, we're going to look
at data on stacking. And in the other two, we're going to look at
transposing your data. Here. This is the situation. I have a division
sales in year one, says In year to
another division, sales in year one, sales in year two, and so on. What I want to do is have
them in a tabular format. What I'm going to
have the division, the sales in year one and
the sales in year two. The problem is, if you want to start copy pasting
one after the other, it's going to be a nightmare. So you have to do it in
a smart and quick way. Now there are many solutions out there on the
Internet to do this. But what I want to show you is the solution that I
think is the fastest, the laziest, and
the most efficient. So I don't want to go
into Power Query and this kind of things
that you're going to find in the internet, even some Add-ins you have. Here. It is simple. What I'm gonna do is come here and do equal
the first division. Press Enter. Now, if you drag this
formula like this, it's not going to work. Because here we have A2, it will become B2, and then it will become C2. So what I'm gonna do is just get those two numbers with my
equals sign and press Enter. Again. If I drag this down, it's not going to work
because the formula will go down and the
data is not in this way. So for Excel to
understand my pattern, I'm just going to do also
the second division. So equal. Here we do another equal
and then Alaska equal. Now that I have this, the trick is very simple. I'm going to replace the equals
sign with my initiatives. You can do your initials, you can do a word as long as Excel doesn't recognize
it as a formula later on, or it creates some problems. So let's do Control H. And what we're gonna
do is here equal. And I'm going to put RA replace or we did
six replacement. Great. Now we can drag this down. You can see now
what is happening. Here. I have eight after my initials, which is Foods A9, a ten. Then here you have a 11, which is my division
beverage and so on. So it seems that XN is recognizing the pattern
with Flash Fill. Now let's do the
opposite. Control. H, my initials with an
equal sign. Replace all. Press OK, close. And you get everything
in the right place. As you can see, if I
come and add a division, I put here one and here too. You can see it comes automatically because
of my formulas. Now what I want to teach you is how to
remove those zeros. We can use custom
formatting for this. Custom formatting is not
part of this course, but I just want to go through
it very quickly here. If you don't understand
it, It's okay. You can just come and
delete the zeros like this. Now let's do Control Z, and let's select this. What we're gonna
do is click here. So I go to Number and then I can select
custom formatting. And the way it works
to explain it to you. We will have four parameters
separated by a semicolon. The first one is the format
for positive numbers. The second one is the format
for negative numbers. The third one is the
format for zeros. And then the fourth one
is the format for text. So what I'm gonna do
for positive numbers, I'm going to select this
one, then semicolon. Then I'm going to
select this one, Control C, Control V
for negative numbers. Because they are negative. I'm going to put a
negative sign here. Then semicolon. What I'm gonna do is stop here. I'm not going to do
a format for zeros. And the last one, I'm not going to
consider, press Enter. And as you can see, the zeros have disappeared. Now e.g. if I add
another one here, a, b, c, 1.2, you can see that they will come
if there is nothing. You don't see anything. What I've done basically, you can see the formula
is still there. I have hidden the
zeros with a blank. And that's why I use
costume formatting.
24. S2 L21 Transpose to Horizontal (****): So here is the situation. I have here a bunch of
projects, their costs. And what I want to do is move the data from this
way to this way. Now, I'm gonna show you a few
methodologies to do this. The first one is the following. It doesn't involve any formula. You just select the data. You do control C for copy. You can go here
and you do Alt E, S. And then here if you see in this menu,
you have transpose. The E is underline. So if you press on the E, it will select Transpose. Press Okay, you get
the projects this way. Great. The only problem is that if you can change this to project 11, you don't have it updated
because it's not affordable. Let's do Control Z. Now, if you have Excel
Office 365 or Excel 2021, you are lucky because you can use a formula called transpose. So in this case, what I can do is transpose
open parenthesis. It has only one parameter, which is the array. You just select the whole data, close parenthesis, press Enter, and you'll get your
projects like this. If I change, my project
is going to change here. Now, if you have older
versions of Excel, you can do something. It's not ideal, but
let me show it to you. So what you do is
that you select the space where your
data will come. So you have to know how
many sales to select, otherwise, it won't work. Then here in the first cell, which is in this case
the seven I can do, equals transpose,
open parenthesis, select the same thing. So, so far, same thing. The only difference is that I selected the cells where
the results will come. And now, instead
of pressing Enter, I'm gonna do Control Shift
Enter, and I get them. If you see the formula, you will get some curly brackets before and after the formula. Now there is a lesson
in this course about Control Shift Enter. So you'll learn more about this. Now what you need to know is, again, I changed the project. It updates here. Let's do Control Z. Now, if you have older
versions of Excel, instead of going into this
Control Shift, Enter business. I have another solution for you. So here I'm gonna
do equal project. Here, equal cost, and then equal the first
project and its cost. Now that I have this, I'm going to select
them and I'm going to replace the equal
with my initials. So Control H. Here you go. You put equal, you replace it with
your initials. It could be a word, anything. Replace. All we say, okay, close. Now that we have it, we just drag it like this. And as you can see, here, we have A3, which is project to a four, which is project
three, and so on. And here you have B2, B3, B4. So those are the costs. So now what to do? Control H again, let's
do the opposite. So here, equal. So my initials, we
replace them with equal. Replace all. Press OK, close and you get
everything transposed. If you change this to a one, you get a change automatically. So those are a few methodologies to be able to
transpose your data.
25. S2 L22 Transpose to Vertical (*****): In a previous lesson, we learned how to transpose data from tabular format to this way. Now, to do this, we use a trick with initiatives where we replace the
equal with my initials, drag it down, and
then do the opposite. Here, I want to see if I
have the data in this way. Can I transpose it in a tabular format
using the same trick? And if not, what can I do? So let's start basically
here we will have the employee the employee ID. And what we did there is
equal to first employee, equal the second employee. And here we took the first
IG and here the second id. Then we just selected
them, Control H. With it equal, they replace
it with my initials. Replace All. And then we do close. Then we can drag it down
and see what happens. The problem is, I still get B1, B1, B1, C1, and C2, C2, B2, C2. So it doesn't work. So what to do in this
case? Let me show you. First of all, what we'll
do is delete this. Let's go to File more options. So find the options in
your Excel version. And then you have formulas. Under formula you have
R1, C1, reference style. So let's select this
one and press Okay. Now if you notice there
is a big change in Excel. I have instead of a bc12 3456. And here also I have 123456. So now if I want to
refer to this employee, I can do equal are for Row. This employee is in which row? Row one, row one, then C for column which column? Column two. This was B before. Now it's column two. You can see it's selected. Press Enter. Let's get the second employee. Now, it's which row, row one and then which column? Column three. So press Enter. Let's get the IDs. Did is our row two for this
one column to press Enter, and this one is row two. And then column three. Press Enter, you'll get them. Let's use our trig Control H. We replace the equal sign with my initials and embrace all. Press Okay, press Close. And now let's just drag this
and we can do the opposite. If you see here e.g. you are getting R1, C4, which is row one,
the fourth one, which is this one,
then C5, C6, etc. It's working. And here
it's R2, C4, C5, C6. It looks like it's working. Control H, Let's
do, let's do equal. Replace all. Press OK, close. And as you can see, we have transpose our data. Now that we have done this, let's go back more options and go to Formula
and remove this. Press. Okay, we are good.
26. S3 L1 Intro (material in Project section AllToDo, AllCompleted): Welcome to the if statements and logical operators
part of this course. In this section, we
will learn how to test logical conditions and look at formulas that are
related to this topic. We will start with the
famous IF statement. Understand the structure. And then once we
know how it works, we will look at nested IF, which is one f within another. If number three will be the logical operators such
as AND OR and NOT formulas. Number four will be about a newer formula in
Excel, which is if, as we will learn the
difference between f and f es, when it is better to use EFS. Number five will be
dealing with errors. So formulas such as if
error or if plus is error, will be very happy. Then we will look
at a statement. So it's blank, is text, is all this evil and et cetera. And some of those formulas might not make sense to you
at the beginning. But I will show you
practical examples on how to use them efficiently
in a real-life situation. And finally, we will
learn how to use if with a partial match
and not an exact match. Last thing I need
from you is a bit of help and I promise that's the
last time I asked about it. If you haven't
traded this course, please do so because this will help me disseminate
the information. And obviously if the rating is good and you
like this course, that would make me even happier. So I hope that you are
ready for this section. Let's go.
27. S3 L2 If Statement (*): If statement is one of the
most juice formulas in Excel, let's deep dive into it. If I look at the syntax
of this formula, we have three parameters. One is mandatory and
two are optional. The mandatory one
is logical test. Basically, logical
test is any condition that will be tested and
we return true or false. It could be something as
simple as B2 equal five, or a more complicated formula, or a set of formulas, then if the value if true, we can return something. So that's the second parameter. We could e.g. write something in the formula like pass
in double quotation, or refer to a cell like B6. All right, Another formula. And based on the result
of this formula, you get your answer. Value if false is
exactly the same thing, the only difference
is that it is for the false case and those two
parameters are optional. So e.g. if I don't
write value, if false, I will get false in the cell if the test condition
returns false. So let's go to Excel and
let's try this if statement. So here we are in our
Excel sheet, 0.02 to 3.06. You can download it at the
beginning of this section. And if you see we have some exam results
or some students. And what I want
to do is to write a simple if statement
on the masquerade. I want to check if the
mass grade is above 70, then it's a pass. Otherwise, it's a fail. So let's write it together. Equal IF open parentheses. I select the mask Great. Bigger than, let's
type 70 comma. In double quotation, we do pass those double quotation
and close parenthesis. If you see, I'm just going to
click back on the formula. You have value if true
and value if false, or value if false. I'm not gonna write
anything just to show you. I press Enter. I go here on the
edge of the cell, double-click and I can just
drag the formula down. If you see, I did
not use F4 to put $1 sign in front of
this F or F five, et cetera, because I am
dragging the formula down. And wherever I
have a false case, because I did not
specify anything, I am getting false. Now, let's just add to
this one the failed case, 0 comma paid in double quotation than
another double quotation. Press Enter. Let's
drag it. Double-click. And now you see I have failed. Instead of pass. The other thing I want to do, instead of this 70, I want to refer to a cell. I'm just going to select the 70. Click on this, and now I need a four because I want
to drag the formula down and I want to keep the same 70 or all the cells or press Enter, come
here, double-click. And then you can see
if I'm just going down that the i2 stays the same. The f is changing and
I'm getting my results. So now let's go
one step further. So instead of this path, I want to have pass here in i1. I'm just going to
type pass here. You can see you don't need double quotation when you are
typing the value in a cell. And here, instead of this bus, I can just refer to a cell F4. Press Enter, double-click,
and it's the same result. Now, I can have anything in
this cell, it will come here. So if I press F5, you can see that I get
five for the task cases. Now, let's do, again
more difficult. Instead of this,
let's use an average. So now I want to check the
average of those three grades. No problem. We go here,
we write average. And then we select those three grades and
close parenthesis. And as you can see, I can have a formula within a formula as one
of the parameters. I can make it as complex
as I want. Here. I press Enter. If I double-click, you will see that some of the
results would change. E.g. this student,
she got 69 in mass, so she was a fade. But once you get the average, it becomes a pass. And if I want to
check the butter, this is because now I have
a lot of parenthesis here. I want to check where
they start and end. I can just click in
the formula bar, use the arrow keys. And as you can see, whenever I'm using
the arrow keys, it is highlighting the start parenthesis
and add parenthesis. Let me do it again here you can see those red parenthesis. They are getting highlighted. The last thing I want to show
you is Evaluate Formula. This is what we have
learned before. Here we have Formulas, Evaluate Formula, and you
can check your formula. The average of those
three grades is 74.6. If you click, it's better
than 70, then it's true. And here it will return, pass.
28. S3 L3 Nested IF Statement (**): After understanding
the if statement, it is time for
something more complex. So here we're going to look
at nested if statement. And to understand this, we're going to look
at an analogy. I don't know if you know those
Russian dolls, Matryoshka. But basically you have a
big door, you open it, there will be a smaller doll, you open it, there'll be
a smaller doll and so on. This is the same with
nested if statement. You will have an if within
an F wasn't enough. So the definition is
nested IF means you can have another if statement
as a value for a parameter. So if we look at the
structure of the IF function, you can see that it has value, if true, value if false. Now what I could do, instead of returning past like we did in the
previous lesson. For value if true, I can put another if statement. And if the first one is true, it will execute
this if statement. Now within the second
if statement, e.g. for value if false, I can put another if
statement, and so on. So this is how it works. Let's go to Excel
and try it out. If you remember the simple. If we looked at the
grades, the mass great. If it was above
70, it was passed. Otherwise Fe, here what I want to do is above
or equal to 90, it's a top students. 70-90. This is a pass, and below 70, it's a fail. So let's try the
formula together. Equal IF open parenthesis here, this is the mask rate
bigger or equal. I select the 90. Let's press F4 to drag it. Come. Now, value if true, I want top student. So let me write top students in double quotation
comma value if false, this is where you can nest. Another if, because now I
have two more conditions. I'm gonna do open parenthesis. My logical test is the mass grades bigger
or equal than 70 comma. If the value is true,
what would happen? I want to put a pass. Otherwise I want a fake. So let's do double quotation,
close parenthesis. I need another
parenthesis because the last parenthesis
is always in black. Press Enter and you get
pass, double-click, you get here a cop student, because the person got 92. Now you will ask me, I didn't put 70-90. How does Excel know that? Well, if you think about it, the first condition is
equal or above 90, right? So if it's true, you
get off student. If not, it means automatically
the value is less than 90, so I don't need to specify it in the second F because this will get executed if
this value is below 90. So here I only specify
bigger or equal than 70. Now let's try it
out with formulas. Evaluate formulas. Let's move this here
and let's check it out. So we have F for
evaluate which is 81, bigger than 98 is not. So that's false. So automatically this
f will get executed. Evaluate 81, bigger than 70. Yes, that's true. You get pass. And since the first
one is false, this one will return path. And this is how you get pass.
29. S3 L4 And / Or Conditions (***): In order to understand
the value of and and or mixed with
an if statement, we need to look at the scenario. So here e.g. I want to have if the mass grade is bigger
or equal than 70, I want to have a pass. Or if the reading grade is bigger or equal to
70, I want to pass. If you want to write this
with a nested if statement, you will have
something like this. If mass bigger or equal than 70, then it's a pass. If not, you will have
another if statement. If reading bigger or equal
than 70, it's a pass. Otherwise it's a fail. So the problem is, if I add two or three more
conditions like this, then you will have
a gigantic formula that even Einstein
cannot understand. So the way we can
write it with AND or, OR is the following. If open parentheses, our
condition will be a node. So you have to put the end or at the beginning and you'll get
used to it at the beginning. It's a bit weird, but
that's how it is. You will have mass bigger
or equal than 70 comma reading bigger or equal than 70 comma writing bigger
or equal than 70. You close the parenthesis, then you have paths
and otherwise fail. So that's much
easier to read and understand and your formula
is much more compact. So let's go to Excel
and let's try it out. We are back to our Excel
sheet about grades. And the first thing I want to do is try and add condition. What I want all three grades to be above or equal
than 70 for a pass. Otherwise, if one of them
is less, It's a fade. So let's write it together. Equal IF open parentheses. As I told you in the PowerPoint, you put the end first,
open parenthesis. You start with the mask, Great. Bigger or equal than 70. Let's use F4 comma. The reading grade,
bigger or equal than 70. Let's use F4 comma. The writing grades
bigger or equal than 70, you use F4, close parenthesis. This is our logical
test, comma value. If true, then we write pass in double quotation
comma value if false, then we write fail
in double quotation, close parenthesis, press Enter. Now I can just double-click
to drag the formula. And if you see those two students have
all grades above 70. So this is why it's a pass. And if you look e.g. this student got one grade
below 70 and it's a failure. Now, let's do the same, but with an order
condition here. Equal if open parenthesis or open parenthesis
masquerade bigger or equal than 74, comma. Reading grade, bigger
or equal than 70. F4 comma writing grade bigger or equal than 74,
close parenthesis. That's my logical test. Gamma. It's a bass comma value. If false, it's a fail. All in double quotation, close parenthesis, press Enter. You double-click and
you get the results. So e.g. this student
got one grade above 70. This is why it's a pass. If you have all three
grades below 70, you will get a fade. So this is how to use and then, or with if conditions.
30. S3 L05 Not <> with IF (*): So far, we looked at the ad and, or formulas combined
with an if statement. And now it's time to
look at the negation, which is represented by the formula or the
different than sign. For the different than sign. If you see the title
of this lesson, you have to use the smaller than sign combined with
a bigger than sine. So now, why use negation? You use negation in scenarios
where you want to test a condition and this condition
is different than a value. So e.g. if I take a
practical example, if you remember from our
Excel sheet with great, we had ethnicity as
one of the columns. What I want to do here is ethnicity different
than group C, then it's a test group. Otherwise, it is a control
group with the negation sign. It is very easy. You can see it here. It is ethnicity
different than group C. However, it is much less
intuitive with the not formula. So here you will have to
have not open parenthesis. Ethnicity equals group C because not an
equal is not equal. So this is how you have to
deal with this scenario. Now let's go to Excel and let's practice in
our Excel sheets. I want now to do column m and n. So I'm just going to hide
those so you can see better. And we're going to
start by different than because this is the one
I use the most frequently. I rarely use this one
because as I said for me, it's not that intuitive. So what I want to do here is the same thing we have
seen in the PowerPoint. If the ethnicity is
different than group C, I want, that's the group. Otherwise control group. So let's go here and do equal if ethnicity
different than. And then we can select Group C, use F4 because we're going
to drag the formula comma, then I want my value if true. So I'm just going
to put the group. Then double quotation comma, again between double quotation, we have the other one which
is the value if false, which is Control Group,
close parenthesis. It is as easy as this. Press Enter. And then you just drag
the formula like this. And you can see wherever
I have Group C, it is control group. Let's do the same with
the North formula. So I'll go here, go to
the Formula bar equal. If here I have to
start with not. I have my logical test,
which is ethnicity. Don't forget, it's
not different than, it is equal to group C than F4. We close this one. Comma value if true is test the group comma value if false is controlled group all
in double quotation. And then you close
parenthesis, press Enter. You double-click.
Let's make it bigger. You should get the same results.
31. S3 L6 IFS statement & Emojis trick (***): If you have Excel
2019 and above, you are lucky because you
can use Dave as formula. So in this lesson, I'm going to show you the
difference between f and if S. And also I will show you what it is better to use
dave S formula. In addition, I have
a bonus tip for you. I will show you how
to add emojis to your report in a very easy way. So let's start. If I have a formula with
multiple conditions, I would have
something like this. If x less than hundred comma, if x less than 90 comma, if x less than 80, and so on. So you can see the number of parenthesis and the
risk for error. If you use the if S formula, the same formula will
become way easier to read. You will have if x
less than a t value, if true, x less than 90
value if true, and so on. So let's look at the
syntax of first of all, you will have logical test one, which is a condition that
returns true or false. B2 equal five. Now it could be a formula
that returns true or false. Doesn't matter. Now, if it's true, you will get value if true one. And this value could
be our reference. It could be directed
written in this formula, or it could be another formula. Now, if it's false, you have logical test2, then value if true, and so on. Notice that there is
no value if false. And now we're gonna go to Excel. I will show you how to
deal with value if false. We are back to the same extent. However, the only
difference is that I have hidden the columns in the
middle so we can see better. And here, I'm just gonna do
a simple scenario so you can understand the power of S
if you had more conditions. So what I will do is
look at the mask rate. If it's above 78, surpass. If it's below 60, it's a fail. And in-between, it's
a second chance. So if I want to write this with the traditional
IF statement, we're going to try it together. Equal IF open parentheses. Logical test is mass bigger
than 70 comma value. If true, I will put pass comma, then value if false. Here we have another
if an asteroid f, if the mask rate is
below 60 comma value, if true, it is failed. Comma. Second chance, close
parenthesis, and press Enter. So now that's a simple case. You can see we have a nested IF, imagine that I had three or four more conditions,
what would have happened? Let's write it now
with the if S formula. So I will delete this. I will do equal if
S open parenthesis, my first logical
test is the same. I'll have my mass great. I will do bigger than
my 70 comma value. If true, it's past karma. Logical test to do mass grade smaller
than 60 comma value. If true, it's a fail. Then I will just close
parenthesis here. We have to do more, but I just want to
show you a few things. Now before I drag it down. I just want to fix
it because I want to drag it to the
right also and down. So we look at F4,
the mask rates. Basically I can change
roles but not columns. So this is $1 sign
here and here. For O2, which is the
70, it's the opposite. I can change columns,
but now through. So we'll do this. And for the 68 is the same, we will do this. If you're not familiar
with what I'm doing, you can go back to one
of my lessons on cell referencing and you will be
able to understand it better. Now, let's press Enter
and double-click. You can see that all the
cases 60-70 will have an a. Now we're going to add
the third condition. But first, I'm going
to do it inefficient. And then I'm going to show you the efficient way,
the best practice. So if you see here above
70, pass below 60. So then 60-70, It will
be a second chance. So how to do this? You have two conditions. We put an end and we
put the mass great. We will say bigger or
equal than 60 comma. The masquerade. Smaller or equal than 70. Close parenthesis, comma,
we put second chance. And then double quotation. I need to put the dollar signs. I'm gonna do the same. These are my dollar
signs. Press Enter. We double-click. This is second
chance now. Great. But this is inefficient. Why? Because if you see
here this is above 70. If it's a fail, it's going to move
to the second one and then the third one. So if it's not above 70, why would I put a condition
here saying below 70? Because it's anyways below 70. What I could do to make it more efficient is put
only one condition. So let's remove the ends. And let's remove this condition
and keep one of them. I put above 60, that's fine. Press Enter, double-click,
you get the same result. It is an easier to read formula, but it is still not efficient. I'm going to fix it. And explain to you how. Here we're gonna put through. Instead, press
Enter, double-click. Same result. Even easier to read. So what I've done here, I have f for bigger than 70. If it's false, it means
it's less than 70. I have F for less than 60. If it's false,
then it means that by default FOR is 60-70. So instead of
putting a condition, I directly put a true. So that will take care of all my other cases and I
will get second chance. And this is best practice. So you don't get an
error with NFS formula. All the other cases, put a true at the end and
put a default answer, e.g. an a or something like this. So you always get the
result from this formula. And this is how it's
working for me. If I try it, let's go e.g. to 69 and let's do
evaluate formula. I'm just going to
move it like this. You can see I have F7, which is 69 bigger
than 70, false. If it's false, it moves
to the second 169, smaller than 60 fourths. When the two are false, it will go to the third one. The third one is true. You will get a second chance. Let's close this. And now let me teach you
the pro trick for emojis. So we can drag the
formula like this. Double-click and go here. Instead of this pass fail. And second chance,
we will do this and we'll do windows dot
on your keyboard. You have some emojis. If you click on this one, you get even more. I'm going to select this
one, the Smiley face. You can see that it comes here. Don't forget the
double quotations. Let's do the same here. Windows dot, we select this one, and let's do it a third time. Windows dot. We select this one. Click here, press
enter, double-click. You get your emojis. So once you have your emojis, you can color them. You can use conditional
formatting, whatever you want,
but it will give a bit of flavor to your report. This is one way to get emojis. It is a quick one. There are other ways
we're going to see in the course to get more icons, to color your report.
32. S3 L7 IFerror (**): A good way to deal with
errors coming from formulas in Excel is to use
the IF error formula. So basically, the syntax of this
formula is the following. You will have IF error, then the first
parameter is value. Basically it is the function or the value that you want to test to see if
there is an error. If the answer is not an error, then the formula we return this value or the result
of your function. If not, then it will display
the second parameter, which is value IF error. Value IF error could be directly
written in the formula, it could be the
contents of a cell, or it could be another formula. So let's go to Excel
and fix a few errors. Here. If you see I have a formula. It's a simple formula. If the mass grade is
above 70, it's a pass. Otherwise it's a fe. And I drive my formula down, but I got some problems. Why? Because the data
quality I have is not good. So in this case, since my formula is okay, I can use IF error to
deal with such scenario. Here, what I'm gonna do, I'm gonna put IF error,
an open parenthesis. One good practice is to write your formula and then you
can wrap it with IF error. If you see that
you have problems. So value IF error, Let's put not found e.g. in double quotation, close parenthesis, press
Enter, double-click. And now you see we got
rid of the errors. Now instead of not found, I could have done anything. I could have put e.g. five times two or even another function. So here e.g. you get ten
because there is an error. So this is how to use
IF error in Excel.
33. S3 L8 Isxxx statements + Row coloring trick (***): I hope that you are ready
for this lesson because I'm going to come at you
with a lot of formulas. And some of them you think
that they are useless. But wait until we go to Excel. And I show you real examples. Now, all these formulas
we'll start with is test for a condition and
return true or false. And most of the
time you will use those formulas in combination
with other formulas, such as if the first
one is, is blank. Basically, it will test if the value that you
give it is blank. The second one is number. As its name suggests. It will check if the
value is numerical, then you have a stacks
which is the opposite. It will check if the value
is text and not one thing, if you have texts and
numbers for Excel, it's counted as text, then you have error. It will check if
whatever you are feeding it is an error or not. Now note that this is
very similar to if error. If you do, if is error, the only difference
between this one and if error is that if
it's not an error, you can define
whatever you want to return with the other
one, the error. If it's not an error, it will just return the
value that you fed it. So this one becomes
a bit more flexible. Then we have is
even and m is odd. Basically is to check if
the number is even or odd. And those two might seem to you as if they are
not very useful, but you'll see what we're
gonna do with those two. Let's go to Excel
and let me show you. Here we go. We have the same masquerades
with a few modifications. What we're going to try to do
first is check for blacks. You can see here some
of them are blank. Whenever it's blank, I want the average of the
other two grades. So here I can do. If it's blank, open parenthesis, I select my reading, great. Close parenthesis comma. If it's a blank, I want the average of the mask rate comma,
the writing, great. And then close
parenthesis comma. If it's not blank, then I just want the
grades close parenthesis. Press Enter, and
then double-click. You can see that here e.g. I. Fixed the problem of having missing data with
the best I can. This is one use of is blank. Then you have is a number. So I want to check if my
writing grade is a number. So here I'm going to
do equal is number, open parenthesis, select
by writing great. Close parenthesis, press enter. We get through for the first
one because it's a number. Double-click, you can see that
we get a couple of fours. We're going to come
to this in a second. Let's do the opposite. Which is text equal is
text open parenthesis. And let's select the
same close parenthesis. You can see that you
get the opposite. Now, I can use this
to fix my data. Here. If I select my false, because the grades
have to be numbers, I can see that I
have two of them. Here. It looks like I have 30, but it's three.
And the letter 0. So I can come and fix my data. You can see it becomes a true. And this is a way to check
my data with this formula. Then you have is error. So let's look at
this arrow here. We're going to do equal. If is error, open parenthesis. We select the mask rate,
close parenthesis, comma, it becomes a normal
IF statement, value if true. If it's an error,
Let's put not found. Let's do comma. And then if it's not an error, I just want the mass great. Let's close parenthesis. Press Enter and double-click. Now, if you see the
difference between this formula and this
type of formula, you can see that here we have IF error and we have
an if statement here. So what happens is that if the if statement
is not an error, you will get the value
from this formula. Otherwise, you get
the not found. Here. In this case, you can return whatever you
want if it's not an error. So that's where the
flexibility comes in. The other one, you are saving
maybe a formula sometimes. Here you have one more formula. Because you have, if
you have the arrow, press Enter, then we have
is even and n is odd. The practical example I
want to show you is that imagine you want to color
every two rows in gray. So obviously you
don't want to do this and then go and color it. Then you go here and you
go and color it and so on. It will take ages. What I can do,
let's do Control Z. Control Z is used, is even or odd. So equal is even. Open parenthesis. Here I need a number. For the number, I'm going to use another formula called row. We're going to see
this formula in details later on in the course. But what it will do when
I write it like this, without any parameter
in-between, it will return the
row of the cell. In this case, this is
row two, then 34.5. So let's close parenthesis here. We have is even of rho. Rho is to, obviously
two is even. If I do like this, three here is not
even, and so on. So let's double-click
and let's do is out. It's the same concept. So we do row, open,
close parenthesis, close parenthesis, press Enter, and then you double-click, you get the exact opposite. So now what I can
do is filter by true and go Control Shift
arrow, right arrow down. Let's color them. We go back up and we un-filter. And as you can see, I have colored every
two roles in gray.
34. S3 L9 IF with partial match - Pro trick (*****): I'm going to teach you
a trick that a lot of advanced user of
Excel do not know. So here's the situation. You come in the morning
to the office and your boss has thousands
of ancient ideas. And what he wants you to do is flagged the ones
that contain th, and he will give you
the whole day for this. So if you use the
normal if statement, if we try it here, equal, if the agent ID is equal
to T H comma, then flag. Otherwise comma,
double quotation, double quotation,
close parenthesis. It doesn't work. Because so far in this course, we looked at cases where
we are looking at a value that is equal to another
value, smaller or bigger. So what to do? And you want to do
a partial match. Let me show you
how to solve this. First of all, you can use
a formula called Search. So this formula, if
you open parenthesis, it says Fine text. So let's put a four for the
text because we're going to drag it comma within text here. And then you have
comma start number. It means from which character
do you want to start? If you don't put anything, it will start from the
beginning of the texts. If not, you can specify e.g. 456. It will start
looking from the fourths, fifths, or six character. Now here I don't want anything. So I'm just going to
close parenthesis. Press Enter. And here you get five. Let's double-click and
see what is happening. So five means that G, H starts at the fifth
character in this text. So 1234. And that's the fifth character. Here. You have it at the six
character, and so on. Now here I don't have
th, what is happening. I'm getting a value error. Now note that this search
is not case sensitive. So if I put the H
in small letters, it will also work. If you want it to
be case sensitive. You can use a function called
find. You can see this. It doesn't work. Now if I put th in capital
letters, it will work. But now let's go back to search, and let's use this search. Now. This is the information. If I find th, I'm gonna get the number. If I don't find th, I'm gonna get an error. So what can I do here? I can use an error formula. So if I do is error, open parenthesis, close
parenthesis here. If I double-click, you get
all force except one true. Now, let's combine this
with an if statement. I'm just going to take this one, control C Escape, go
here, paste it here. I'm gonna go for
an if statement. So if is error the search, so if it's an error, it means I did not
find anything. So comma, double quotation or double quotation comma
if it's not an error. So we're getting a number. We can put flag, close parenthesis
and press Enter. So now let's double-click. You can see that all of them are flagged except this
one, which is great. Now let's do more complicated. I want a B or T H, which means that this one
also needs to be flagged. What to do in this case? Well, I can use an n statement. So here what I have, if I just copy this
formula and just fix this one, press Enter. I have one is error. If it's an error, it means I have nothing. Otherwise flag. What I could do is
try to is arrows. So here I put an ad. If I come here, you can see if I use the arrows
on the keyboard. I can see here where this
is error starts and stops. So let's put a comma
and close parenthesis. You can see that it is
with the n statement here. Now what I need to do is
put another is error. So let's copy this. Put it here, and let's
move first TH2, this th, the second th to AB, press Enter, double-click and you get all of them flagged. So what happened here? Let's look at this
one with formula, evaluate formula, and
understand the situation. So first of all, we're looking for C3, right? So evaluate that
CH in this text. Evaluate, it's not there. I get an error. So here I get true because
its error is true. Now the second one, I'm searching for AB,
within this text. It's there. I get the number one because it starts at the first character. Is it an error? No. So now we have true and false. What does it mean? I need to have two
trues to get through. But if there is one false, then this will give me false. When it's false,
it will flag it, which means that I find it. So here you can see that
in my end condition, if any of them gives me false, which means it's not an arrow, which means I found it. It will flag the record. And this is how you can do this. Now, the most important
thing is that don't tell your boss
and take the day off.
35. S4 L1 Intro (material in Project section AllToDo, AllCompleted): Welcome to part four of this
course, all about stats. We have a lot to cover here. And we're going to start with basic statistical functions. So beyond sum and count, we will look at things
like median mode, how to deal with percent versus percentile and ratios in Excel. Then we will move to ranking. In ranking, we will look at the formulas that are
used for ranking. And we will go to an advanced
concept where we will rank numbers based on formulas that you don't even know that
can be used for ranking, then you have random numbers. So if you want to test your
model or mask your data, what are the different ways
to generate random numbers? Number four is some product. One of the most important
formulas in Excel. Very few people know the
potential of this formula. We will look at how to
use it in different ways. Then we will have some
fs count IFS average, if they have a counterpart
without the S, we will look how to
use them to sum, count and average based
on some conditions. And even with partial matches. Number six will be
Control Shift Enter, which is one of the most
important concepts in Excel. If you don't have newer
versions of Excel, which means that you don't
have dynamic array formulas. So we will look at how
to use this shortcut. After that, we will have
dashboard examples. So based on your knowledge, how to build quick, interactive and
dynamic dashboards to relate your results visually. Because this will make you look much better in front
of management. And finally, we will
look at max if S, Min, if as an aggregate, which will be used to do max and Min based on some criterias. So are you ready
for this section? Let's go.
36. S4 L2 Round (Normal, Up or Down) (*): Let's attack this section with rounding up and
rounding down numbers. And if you see here, I have a bunch of numbers. That format is gender. If I try to decrease the
number of decimal points here, by clicking on this, you can see that I get to three. But have I really rounded
down the number or up? Well, if you do here, equal three times three, you should get nine, right? Press Enter. You'll
get 7.71. Why? Because if you go back to the number and look
at the formula bar, you can see that
it's still 2.57, which is a problem, right? So now let's just get
back the numbers to where they were by using
general removing this. And let's try to use
formulas to round numbers. Here I'm going to use a formula called round open parenthesis. You have two parameters. The first one is the number. So that's easy. That's my number. Comma,
the number of digits. Now to round to integer, the number of digits is zero. You put zero, close parenthesis, press Enter, you'll get three. Let's double-click. You get your numbers, and let's verify that
it's really three. So here what I can
do is control C. I will come here. E is V, will paste
the number as values. Press. Okay. And now you can see in the formula bar that
it's really a three. So let's delete
this one and let's understand how the
rounding works. Basically, everything five and
above will get rounded up. Below five. It gets rounded down. So 57.50 get rounded to three. And fours is three, gets rounded to two. Let's try now to round
to one decimal place. Equal round. Open parenthesis. My number is the same
number of digits. I want one decimal
place means one. So let's close the
parenthesis. Press Enter. You'll get 2.6. Let's drag it down. Then you get your numbers. Again. If we look at it now, to 0.50, 77 is above
or equal to five. So it gets rounded up. This one, there is
a zero after it, so it's 2.53 is less than five. It gets rounded down, and so on. So if you need two
decimal places, you will put to three
decimal places, three, and so on. Now, what if I want to round
to the multiple of ten? So that's a bit
more complicated. Let's do equal round
open parenthesis. Select our number comma. Now what do you think I should
put for number of dishes? Well, if you think about it, one decimal places, 12
decimal places is too. If I'm going reverse, I should go for minus two, the multiple of ten, it is minus one. Let's close parenthesis
plus Enter, and you get zero. Let's double-click and
you get your numbers. Why did we get zero? Because 2.57 is less than five. So it rounds down the
same for those two. Here we have a big number. We have 53 point something. Three is less than five, so it rounds down. And same thing here. Let's do to the
multiple of hundred. So here, equal round, you're used to it now, let's get the number comma, what should be the
number of digits? Well, the trick is always to
count the number of zeros. So we have two zeros. So minus two. Let's close parenthesis, double-click and you
get your numbers. Here, 5,900, something
becomes 6,000. It rounds up to 23 because 23 is less than
50, it rounds down. Now we have left rounding up or down to Excel
based on the number. What if I only want to
round up no matter what? So you might guess it, the formula is equal, round up. Same thing here you
have the number, the number of digits. Here it's integer. So comma zero for integer, for number of digits. We press enter, we
double-click get the numbers. If you notice this one, when we rounded to integer, it went down to two
because it's 2.423. Here it goes up to three. Now let's do the same
to one decimal place. So Equal round up,
open parenthesis. The number is here. One decimal means one. Let's close parenthesis,
press and double-click. You can see that 2.423 also
got round to 2.5 versus 2.4. Here. We have done round up. So now we need to round down. So what is the formula? As simple as this? It's round down. So Equal round. Now, be careful there is
to this open parenthesis. The number is there. Comma, number of digits is zero because we want
to round down to integer, close parenthesis, press
Enter, double-click. You can see that this number
was rounded up to three. Now it goes down to two. And last one we're
going to do for fun. We will round to
one decimal place. I want to round down, round down open parenthesis. This is the number comma one. Decimal means one. Let's close the parenthesis. We get 2.5, and
let's drag it down.
37. S4 L3 Popular Stat functions (*): Let's look at the most common statistical functions out there. So I hope that you
like the NBA because I selected a database of NBA
players and their salaries. And we want to derive
some statistical numbers. We won't do everything here. We will keep some of what
you'll see for the next lesson. But the first thing I want to do is calculate the
number of players. To do this, I can use my count function,
open parenthesis. And then I can select
column C for the salaries. And I can close parentheses. I get 496 players. Now, obviously, instead of
selecting the whole column, you can come here, select the first
one and do Control, Shift arrow down, and
then you press Enter. So that's the same thing. As long as you don't have
more data below this table. Because when you
select column C, If you have more data
below this table, it might count more and
give you a wrong answer. The other way to do it, let's assume that
I click here and I move my data to this column. If I press Enter, I get zero. Why? It is because count
only count numbers. You want to count
numbers or text. You need to use count a. If I just remove this and
I select the whole column, and I put a here, so count a column a, I get 497. But hang on. In the other one we got for 96. Why? It is because name is a text. If I select the whole column, count, a will count it. Whereas here count will not come salary because
it's not a number. So what you could do to fix this is to either minus one here. So you get the number
or just delete this, remove this column,
select the Data, Control Shift arrow
down and press Enter. The problem with this approach is that if I go down
and add somebody, so triple X e.g. I. Still get 496 because I'm
only referring to this range. How can I do to
fix this problem? Well, you can use
an Excel table. We're going to see this concept
later on in more details. But basically you
just click inside your data, insert table. And here it will
select your data. So if it's correct, it's fine. My table has headers. Okay. Here you have table for, I can call it e.g. NBA players. Press Enter, and now
you have a table. So if I come here,
I delete this, and now I go to Steph Curry, Control Shift arrow down. You can see that now you have the table name and then
the name of the column. If I press Enter
for 96, same thing. Now the difference is I
add a player, player one. If I go up automatically, I have 497, because the table, we'll take this player
within its range. So now let's undo what we did. I do Control Z, remove this
player to remove the table. You can just click inside the table design
Convert to Range. You will say, okay, then the table is gone. If you go up, you're going to see that we get now arrange. You can just remove it. Then click on Stefan
Curry Control Shift arrow down to get back what we had. Now let's get the average
salary equals average. Open parenthesis,
select column C. Don't worry about the
salary because the salary is just a text so it won't
get taken into the formula. Close parenthesis, press Enter. The average salary is $8
million, nearly nine. This is crazy. Now the median
salary, what does it mean? Well, let's assume I have
three numbers. 14.5. If you want to take the average, one plus four plus five
equals 10/3, it's 3.33. But the median is actually
the middle number. So here I have three numbers. The second one is
the middle number. It is four, so the
median will be four. So what is my median salary? Equal median, open parenthesis. Select your salaries. Close parenthesis. Press Enter. The median salary is
actually $4 million. What about the mode? The mode is the
value that you have the most repeated
in your dataset. So here I can do mod
open parenthesis, select my column, close
parenthesis, press enter. 1.8 million is the one
that is the most repeated. Then you have max-min. That's easy. The max you can see it actually it's 48 million, but I'm just going to select
it close parenthesis. This is your max value. Your main value is at the
bottom because I sorted them. You can just select
it close parenthesis. And then you get
5,000 in my database. Then we're gonna do two more, standard deviation and variance. Basically standard
deviation and variance, the measure of the
dispersion around the mean. Mean means average. Standard deviation is the
square root of variance. So that's simple. Now,
what is this variance? This variance when
you calculate it, basically, you get the average. You look at every observation and you subtract the
average from it. Then this difference,
you square it. Then you will just solve this
square and average it out. I'm not gonna go too
much into statistics. If you are not using this
formula, that's fine. If you are into statistics, I'm just going to show you
how to use it in Excel. So you have equals STDEV. If you notice there are three
of them, stdev, STDEV P, and STDEV S. Now, STDEV, if you see it is available
for older versions of Excel. So if you have an old
version of Excel, you will have this one. Then you have some new ones. Stdev P, which is based
on the entire population, and S is for sample. I'm going to use the P version. Select my salaries,
then close parenthesis. You can see that the
standard deviation, so the dispersion
is $10 million. Let's do the variance now. Equal Var, not variance. You have three of them. Var, var p and var. Var again, is for older
versions of Excel. P is for population, S is for sample. So let's use P here. Select our data,
close parenthesis, and you get a crazy number
that doesn't make sense. But it's okay. It's actually the
square of this number. If you see, it is really long. So that's your variance.
38. S4 L4 Ranking Basics (**): This is the second part of our lessons on the most
common statistical formulas. And we want to look
at four of them, which are rank, percentage, rank large, and small. Let's start with small. Basically small, we return the k smallest value
within a dataset. So array is actually your dataset and k is
your k smallest value, large is exactly the same thing, but it will do the opposite. So you have a dataset and you want the case largest value, then you have rank. There are some newer formulas
in Excel about rank. We will see them once
we go to the Zen. But this one will work because it's therefore
compatibility purpose. What it will do, it will return the rank of
a number within a dataset. So is it the highest value, the second highest value, the third highest
value, and so on. And you can do it
the reverse order. Is it the top smallest value, the second smallest
value, and so on. Here. You will have the number
that you want to rag, then the href,
it's your dataset. And older, it could be
ascending or descending, depending on what you want. It's an optional parameter. You also have percentage rank. So percentage rank
works like rank. The only difference is that it will give you
this in percentage. So here you have your array, which is the href in
the rank formula. You're going to
see that x and Ray are reversed compared
to the rank formula. X is your number and significance is the number
of digits you want. So do you want 75.3
or do you want 75.75? Let's go to Excel and practice. We are back to our Excel on
salaries of NBA players. And here what I want to do is get the tense,
highest salary. No problem. I have my
new large formula, equal large, open parenthesis. Your array is your dataset. So here I can select this
control shift arrow down comma. And then if I go up, I want the tenth highest salary. So I'm just going
to take ten for my second parameter,
press Enter. It's 40,600,000, which is here. It is Klay Thompson. He's the tents on the list. Let's do the same for the
hundreds, lowest salary. So from the bottom to up, what I'm gonna do is go
here, Control C, escape. Here, we're going to
paste it Control V. Press Enter. And let's make some changes. So instead of large, now I want small because I want the hundreds lower salary. And here instead of
ten, I want 100. So now you get $1,836,000. Now let's go to rank. So I want to rank those values. Obviously they are in order, so that will be easier
for you to see. But if I do equal rank, you can see that I
have three formulas. Rank, which is therefore
compatibility purpose, and it will work ranking
Q and drank average. How does it work? Let's assume that you have two people with the same value. Let's say there
are number 11.12, but they have the same value. So rank average
will give you 11.5. Rank. Aq will give you
both people at 11, and the next one will be 13. So now I'm just going to
use rank to show you. And then we can check the rest. Here is drag or double-click. The number. Is this one, comma, the reference
is this whole range. So I'm just going to
click on the first one. Control Shift arrow down. I'm going to use F4 to fix my reference because I want
to derive the formula down. Cava, this is the order
descending is by default. Otherwise, you put
one for ascending. I'm just going to keep it
so I don't want anything. Let's press Enter. This is the first one. Let's double-click. You can see that those
people have the same salary. So they are number six. And then you have ten
for the next one. If you use now instead
of this one dot, you use the average one. And then you press
Enter, you double-click. You can see that now you get the average for those people. So instead of six, you get 7.5 because there are four people on rank
six, so there's 678.9. The average of those
numbers is 7.5. And if you use rank EQ, you're gonna get
all of them at six. Now let's do percentage, right? So equal percentage rank. You can see that here I
have several of them. You have percentage rank, EXE, percentage rank, ink,
and percentage rack. I'm going to use this
one. In the next lesson. We're going to see a little
bit more about those two. Now this one is fine. And then what we're gonna
do is first the array. So here you start with the salaries Control
Shift arrow down. You will do F4 comma, the number is this one. And then significance, I'm
not going to touch it. I'm just going to
close parenthesis and then double-click. You can see 100% 99.7. And it goes down as the
rank is increasing here.
39. S4 L5 Percentile (***): What is the difference between
percentile and percent? If you had a math exam
and you got 60 per cent, is it good or is it bad? What about if you are
in the 60th percentile? What do you think? Well, let's understand
the difference together. I'm going to start with percent. Percent is a mathematical
value out of hundred. If I take the same example and you've got 60% on
your math exam. It means that you got six
out of ten questions, right? And per cent is measured
with the percent sign. Now percentile is a
different ball game. It is you're ranking
versus others. So if you are in the
60th percentile, it means that 60 per cent of the people who
got less than you, and 40% of the people
got more than you. And it is measured in th, so 60 years, 50
years, et cetera. So it is possible to get 35
per cent on your math exam, be in the 60 years percentile. Let's go to Excel and less
practice those concepts. Here you have a list of people with names and their scores. And if you notice,
I've ranked them from the smallest
to the biggest. But you don't have to do this. It is just to
verify our results. It will be easier. What I want to do is calculate
the 25th percentile, 50th percentile,
75th percentile. And to make it easy, I just wrote the numbers here. So we're gonna go here
and do equal percentile. And as you can see, there are three formulas
for percentile. The first one, There's an old formula that is in
older versions of Excel. It is still ear for
compatibility purposes. Then you have the ink version, which means inclusive, and the x version, which
means exclusive. The one that people
use the most, is the inked version. So I'm going to start with
this one and then we're going to see the difference
between ink and x. We double-click,
we need our array. Let's select the numbers. Do F4, because we're going
to drag the formula comma. We need k, which
is the percentile. We select 025, closed
parenthesis, press Enter. Now you can double-click and
you'll get there results. Let's check them out. 343 is Sergio is great. So you can see that
there are three people, or 25% of the people
that got less than him. And nine people, or 75 per cent of the people
that got more than him. Let's check the second
1503 is Latisha is great. You can see that half
of the people got less than her and have got more. And finally, 748 is,
Beatrice is great. Three people or 25 per cent
of the people got more, and nine people, or 75%
of the people got less. Now, let's try the opposite. I have 600. I want to
know my percentile. So we're going to use a formula that we used in the
previous lesson, which is percent rank. And as you can see,
there are three of them. In the previous lesson, we use this one, which is
the old one from Excel. And you have the inked
version and the x version. Because I use the
inversion here, I'm going to use the ink there. Let's double-click. We need an array. These are my numbers. Come on. The X is the
number significance. I don't want to touch. So I close parenthesis, press Enter and you
get 62.7 per cent. If you see here, I wrote a formula to make it
nicer to display. So you have a text
function and an end. We're going to see this in more details in the text
section of the course. But just to tell you, basically these texts
function takes a value which is 62.7 and
assign the format. The format is a percentage
without any decimal. This is why you have zero per
cent in double quotation. So now we press enter and
you get this display. Let's try our numbers. So three for three, press Enter. You'll get 25th percentile, 503, 50 years percentile, and
748, 75th percentile. Let's go back to the
600s and let's try now the exclusive function,
equal percentile x. Then let's do the array, which is this one, F4 comma. You need the 25th percentile,
close parenthesis. Press Enter, double-click
and you get the numbers. You can notice that
you get the same here. Here a little bit less and
hear a little bit more. Why? It is because the exclusive version takes out the lowest value
and the highest value. Here, BBA score is out
and Laura score is out. And if you see, if
I put zero here, here I get 170,
which is VBA score. Here I get an error because
this value is gone. Here. If I put 1400 per cent, I get another error, and here I get narrow score. This is just to show you
how this formula works. Let's do control Z or two times. Let's try this one. If I do equal percent rank x, I select my array comma, then I select my 600 and I
don't want the significance. Press Enter, you will get 61%. So there is a slight difference
for the same reason. Now, if I put those
numbers, so 317, you get 25th percentile, 503, 50 years, and 757, you get 75th percentile. If I put those numbers, you're gonna get something
as three for three, e.g. you get 29th percentile
using this methodology. Which one is better? It depends on your situation,
your requirements. I usually use the ink
version for my analysis.
40. S4 L6 Dealing with Randomness (***): Usually you will need to produce random numbers in
Excel in two cases. First one is when
you have a model and you want to test your
model with random data. And second one, when you
want to share a file with somebody and you want
to mask the numbers. In this lesson, I'm going
to teach you how to generate random numbers
using different formulas. From formulas that will
work for all versions of Excel to Office 365 formulas. And as a bonus, I'm
gonna show you how to generate unique random
numbers. So let's start. The first formula I have is a formula that will work
for all versions of Excel. It is called Brand equals rand, open parenthesis,
close parenthesis. As simple as this, press Enter, you'll
get a number. Let's just drag it
to see more of them. And if you see all
the numbers are between 0% and 100 per
cent, which means 0-1. Here you see them in percentage, because I have
percentage as a format. Now, if I want to have
integers or bigger numbers, I can use RANDBETWEEN equal rand between open parenthesis. You just need to specify
a bottom number, which is the minimum
I want, e.g. one comma, and the top number which is the maximum e.g. 100. Close parenthesis. Press Enter. Now if you double-click, you get your numbers. What if you want to
generate a number? But with decimals,
what you could do is use the rand function in
combination with randbetween. So e.g. I. Could do plus rand, open parenthesis, close
parenthesis, press Enter. You double-click, you
get your numbers. Now, if you notice, every time I do
something in Excel, the numbers are changing. So e.g. if I type six
here, the number changed. I can also do F9, which recalculates Excel
formulas and exchanging also, if you don't want
them to change, what you could do is
just select them, do Control C, and then
Alt E as V4 values. And you press Okay. Now the formulas are
paste it as values. You can see here, there is no more formula. It won't change. If I type five, the formulas will stay the same. So let's remove this and move two formulas that office 365. Now we're going to see those in more details later
on in this course. But I want to give you a flavor, a preview, since we are
talking about random numbers. So there you can check everything you can do
for random numbers. There is a formula
called rand array. Let's try it out. Equal rand array. If you don't see it, it means your version of Excel
is older than Office 365. But it's okay. You can understand
what's happening and you can decide later on if you
want to get Office 365. So the first thing you need to do is get the number of rows. I need ten numbers here. So ten rows comma,
how many columns? I only need one column of data. Column C, one comma. What is my minimum number? One comma, my maximum, let's say 100 comma. Here you decide whether you
want a decimal or an integer. I'm going to select
integer for now. So true, close
parenthesis, press Enter. As you can see, you get
all your numbers at once. You don't need to
derive the formula, you don't need nothing. Now, how to generate random
numbers that are unique? Let me introduce the function
that is called sequence. Again, Office 365 function. So how does this work? Sequence? If you
see I'm typing it, it has the number of rows. I want to select ten
rows, same as before. How many columns? One. Then the start number is one. And then I want step, which is by how much do I want
to increment each number? I will put two. Here. I'm generating a
sequence of numbers. If you press Enter,
you get 1357. As you can see, it
starts with one, increased by two
for every number. Now, if I go back to my
random array, I put 1-100. But if I do 1-20, press Enter. You can see that it's hard
to get unique numbers. You have e.g. two-sevenths here. What can I do? I can combine the concept of
random array and sequence. In my sequence, if you see
my numbers are unique, and I can use this random array to
randomly sort these numbers. So then there will
be random, right? Because they are not. In order to do this, we can use a function
that is called sorbet. It's an Office 365 function. So equals sort by
open parenthesis. What is my array? My array now is my
sequence array, right? Because we are sorting my
sequence numbers randomly, so it becomes a random
array of numbers. Let's type sequence, open
parenthesis, then rows, one, column, comma, the start
is one, the step is two. Same as the sequence we have
in column D comma by array. I want to sort it
by a random array. So random array,
we need ten rows. So same number of rows
I have in my sequence. Same number of columns, one column, minimum,
one, maximum. Let's do 100, doesn't matter. And then let's put e.g. decimal this time. You can do integer Same,
close parenthesis. Now the next one
is sorted order. So I can do descending
or ascending, but it doesn't matter. I just need a random
array of numbers. And then I can sort
by this random array. So let's close this parenthesis, press Enter, and you can see
that the numbers are unique. This is this array basically
that is sorted randomly. Now we're going to
see those formulas in more details and
understand their syntax. But if you need it for random
numbers, this is the way. Now you will tell
me what if I don't have Office 365 there? I'm going to show you a
different methodology. Here. You can generate your numbers. Whether you type them, whether you use rand, rand between whatever,
doesn't matter. I'm just going to type
some random numbers. Those are unique numbers. What I'm gonna do is solve
them by random numbers. So to do this, we can just use the rand function and
just drag it down. And now I select my two columns. I go to data sort. What I want to do, let me just move this
here so you can see solved this by e.g. smallest to largest. If I solve this, automatically, these numbers will be
sorted based on this, and it will be random. So here we have our columns
sorting cell values. Largest to smallest or smallest to largest,
doesn't matter. You can select
whatever you want. Press Okay. You can see that now
your numbers are sorted. So this is another way. If you don't have Office
3652 randomly sort your generated numbers and you make sure that
they are unique.
41. S4 L7 Ratios in Excel (***): Let's deal with ratios in Excel. So here I have two
managers and 17 members. So I can come and
write two to seven. And this is my ratio. Another way to do this is
to write two columns seven. Now, if you do this and you
don't put an apostrophe, I'll press Enter to show you. If we go back to the formula. It is 02:07 A.M. Excel
thinks that it's a time. Now what I have to do is apostrophe to column
and then seven. And that's great. If we want to convert
this to a formula, we can do equal. This is my two and
double quotation column. Double quotation and
my seven. Press Enter. You'll get two to seven. But what if I have two to eight? Now I get two to eight,
which is correct. But normally you should
get one to four. So how to fix that? This is where I
want to introduce the formula called GCD,
greatest common denominator. So here we're going to try to
find the number by which I can divide those two numbers
to get my final ratio. So I can do equal GCD,
open parenthesis. You have number one
and number two. I can just select
them like this. Same close parenthesis. Press Enter and you get to. So now I can divide
two-by-two and eight by two. So I go here divided by my GCD and here
divided by my GCD. Press Enter. You
get one to four. This is amazing. What if I want to get
now the managers from here and the team members
from here, what can I do? I can use a count, a formula equals count
IF open parentheses. What is my range? My range is this one comma, what is my criteria? Let's put it in
double quotation. Manager, close
parenthesis, press Enter. Here I get two. Let's copy paste this formula. Unless change manager and put team member the
same way it's written. Press Enter, you'll get 7227. Now, what if you want
to have everything in one formula that will become more difficult
and challenging, let me show you
how to do it here. What do you have?
You have E1 and E2. So let's replace E1 and
E2 by their formulas. E1 is the count of managers. So I can just copy
this Control C escape. Then I'll go here. I will do Control V. That's 1, s one. The team member Control
C, escape, come here. Instead of E2. We do Control V, and we get it. Now the problem
comes from this GCD, because e4 is the GCD
of those two numbers. So what can I do? Let's fix one of them. Here. We're going to do GCD,
open parenthesis. Let's put one here, close parenthesis
and press Enter. Now, what I need
to do is replace this one that you can see
here by those two numbers. First number is the
count of manager. So let's copy this one
and paste it here. Comma, I need the
count of team members. I'm just gonna do
the same control C, and then I'll paste it here. Now the formula is
getting bigger. But if you see this is the
GCD of my first count, F, which is the
count of managers. My second count, IF, which is the count
of team members. And what I can do is control C. Here I have another E4, which is my GCD. You can see it here. Paste it. The formula is even bigger. But now you're not depending
on any of the other cells. You can see it's
doing all the count. Ifs. Press Enter, you
have two to seven. Let's add a team member here. Triple X, you get two
to eight, so 124. So this is how you
can deal with ratios in Excel by using
this GCD formula.
42. S4 L8 Sumproduct - Basic Use (**): Some product is one
of the most powerful, but under use formulas in Excel. If we look at what it does, basically it has two users. The first one,
which is what we're going to focus on
in this lesson, which is two multiply
several values in Excel and then sum the results. The second one, which is something that very
few people use, is to filter data and
perform calculation. So yes, the sum product formula. To filter data. Let's understand the first
use and see how it works. So first of all, I have the syntax, which is some product. Then I have an array of numbers. I have a second array, a third one, et cetera. And obviously the
first one you have to put it after that, it depends on the number
of arrays that you have. If we have 123 as
one set of numbers, and then we have 233 as
another set of numbers. If we are using some product, the first one is array one. The second set is array to what it will do is at every row, it will multiply the numbers. So one times two equal
to two times three equals 6.3 times
three equals nine. Then it will sound the results. So it will do two plus
six plus nine equals 17. Let's go to Excel and let's understand how it
works and how it's going to save you a lot of calculation steps that you don't need to have
in your Excel sheet. You can directly go
and get your results. So here in 4.084, 0.09, we have a lot of things. We're only going to
focus on this table. And what I have is some items,
brands, quantity, price. I want to get the total revenue. So if I didn't
have some product, I will do the following. Equal quantity times
price for every item. And then I just have to drag it. So I'm going to get
it at every row. And then I have to sum these
to get the total revenue. You get three for one. With some product. You can avoid all this
calculation steps. You just do equals sum product. Then you have a
ray one quantity, comma array two, price, close parenthesis,
and then press Enter, and you'll get the
same result in only one calculation step.
43. S4 L9 Master Sumproduct (*****): If you want to master the sum product formula than
this lesson is for you. If you remember the
previous lesson, we looked at the basic use of some product where
we had two arrays. And then we multiply
the numbers row by row, and then we sum the results. In this lesson, I'm going to show you how you will be able to use some product to filter
data and perform calculations. Here, as an example, we have a type which
is chicken or meat, and we have quantities. And what I want to do is calculate the
quantity of chicken. So here I have 23.3. I don't want the three in the
middle because it's meat. So I want two plus
three equals five. How to do this? If you remember the basic
formula of some products, you had some products. Array one comma array two, comma array three, and so on. What you have to do first
is forget about the comma. You have to use the
multiplication sign. Second of all, for array one, what you could do is a condition between
parenthesis, e.g. A1 to A3 is equal to chicken, as you can see here. Then you do times and you
multiply by the quantity array. What will happen in this case? Basically, for every type, you will have a true or false. Chicken is true, meat is false. Chicken is true. And
if you remember one of our previous lessons about
true and false in Excel, true equal one,
false equals zero. So you'll have 101 times 233. Then you have one times
two equal to zero times three equals 01
times three equals three. And then you're just going to
sum them and you get five. Now, we use the
multiplication sign. Whenever we have
an end condition, if you have an oral condition, you will use a plus sign. Now you'll tell me what does mathematical science have
to do with conditions. I'm going to show
you how it works in detail in the Excel sheet. We are back to my Excel sheet that I call the
chicken or meat exam. And what I want to do calculate
the quantity of chicken. So here you have the items, the brands, quantity,
price, and taught. To do this, we're going
to start by just counting the number of records
that have chicken. So e.g. you have one here. That's the second one. And that's the third one. Let's use our new formula, sum product equals sum product. You have array 12.3. Forget about this. Let's learn our new
strategy, which is, I select my data equal chicken. Chicken is H1, so I can just select one close parenthesis. Do you think it's going to work? Let's try it together. We get zero. Why? It is because you have to
multiply this by something. So what I could do is
this and do times one. Once I do times one, it would work and you
get three records. Now that we have
the three records, we can just get the
quantities which is one here, one here, and two here. So four. So we can replace this
one by the quantity. So we multiply by the quantity, press Enter, and you'll get
four. So what happened here? Basically, I just select
this piece and I press F9, I get a bunch of true and false. What does it mean? Basically, whenever
I have chicken, e.g. the first one is chicken, true? The second one is soup. It's volts. The third one is chicken. So it's true. And so on. And in Excel, if you remember, true equal one,
false equal zero. So now I'm multiplying
a bunch of ones and zeros
times the quantity. And then I'm summing it up. So I'm getting my four. Let's press Escape. Don't press Enter, press Escape. And you get back your formula. Now that I want the total, it is very easy. I can just take this
formula, control C Escape, go here, paste it here, and then I already
have the items. The quantity. I can just multiply
by the price array. Now, the same thing will happen
wherever I have chicken. It's true, so it's a one times the quantity
times the price. And then we sum them up. So press enter, you
get 11, which is 18. And two, now, if I go down just to check
what is happening, whatever I have chicken. So I'm just going to put a yes. You can see that the
numbers will appear. So my quantity is four
and my total is 11. Now let's go back and let's do something
more complicated. I want chicken or Pepsi, and they have to be brand a. We have orange. And together, how to do this? First, we're going to start
with count. For count. What we're gonna do
is equal sum product. We have our array 123 that
we're going to ignore. We're going to start by
the easy piece, brand a. So let's open parenthesis,
close parenthesis. Inside. I'm going to select the
brands equal brand a. Since I might have to
drag this formula, Let's use a for this time. So we keep the brand a, and let's do times one,
close parenthesis. So now you have the number of records that have
brand a, which is 123. After that, we need to
get chicken or Pepsi. So to do this, if you remember what I told you in
the PowerPoint, you have to do a plus sign here. Instead of this one. Let's open and
close parenthesis. And within this, Let's start
with our first condition, which is item equals chicken. So another open parenthesis,
close parenthesis. In the middle. I'm going to select
all the items and I'm going to do equal. This is my chicken. Let's use F4 for chicken. And let's press Enter. So now I have all
the brand a chicken. So if I look at this,
this is brand B. So this is out. I have those two, right? Two records, 1.2. Next, we need to do
the OR condition, which means it has to be
either chicken or Pepsi. So here I'm going to do a plus, open parenthesis,
close parenthesis. I will go here. I will select my items equal. And then I'm going to
select Pepsi and do F4. Press enter, you get three. Why? Because you have
Pepsi brand a here. So if I do a yes, you can see that now
we have three records. How does it work? Let's
look at it step-by-step. This step, you know,
it if I do F9, whatever I have
brands a, it's true. If I don't have
brand a is false. So e.g. here you have
true for the first one, false for the second one
through four, the third one. Let's press Escape. So this is one part
of the formula. Then you have this part of the
formula, which is chicken. So let's do F9. Same thing will happen. True for chicken,
false for soup, true for chicken, etc. Let's press Escape. Next you have the Pepsi. Same thing will happen. We do F9, some false and true. You can see that you have some truth here where
you have Pepsi. Now, if we think about it, brand a will be ones and zeros. Chicken will give
me ones and zeros. And then Pepsi will
give me ones and zeros. Now what I'm doing first
is doing chicken or Pepsi. So I'm doing a plus here. So e.g. the first one
is chicken, right? So this formula,
what will it give? It will give me one here and zero for Pepsi. So
that's the one. Is it brand a? It's a one. So one times one plus
zero is equal to one. This is one record. Let's look at the
second 1 s one is not brand a nut
chicken, not Pepsi. So it will be zero times zero
plus zero. This is zero. Let's go to Pepsi, e.g. and brand a. Brand a is correct. So that's the one. And then you will have chicken incorrect. That's zero plus Pepsi, correct. That's the one. You're gonna get one
times zero plus one. This is another record and this is how
it's going to work. Now, if I want to do to
quantity, it is simple. Just add a 4-year
to fix my ranges. Now, drag the formula. You have still three as count. You want the quantity. So you can multiply all
this by the quantity array. This is my quantity array. I did it at the beginning
to make it easier for you. And let's just do F4
here and press Enter. So now you get 12. If you check it, this is 12. So what we have done in the second case is keep
the same logic here, but just multiply
it by quantity. Now let's do the total. We can just drag this. What do you need? You need the price, right? So let's take the price. Let's do F4 and then
multiply the price by the quantity by our
filtering criteria. Press Enter, you'll get 99. Those are your 99. So this is how you can use
some product to filter items and do some calculations.
44. S4 L10 Countifs, Sumifs, Averageifs (***): After the crazy sum
product formula, it is time to relax. We're going to look at count if some if as an average if S. So what do they do? Basically, they will
allow you to count sum and average based on
some filtering criteria. And they have a counterpart, which is count if some, if an average, if all
of them without S. Now what's the difference
between the two? Basically, the ones
without as can only take one filtering criteria
and the ones that have as they can take
multiple filtering criteria. If you have one criteria, you can use both versions. If you have more than one, you have to use the S version. And the S version is
that since Excel 2007. So now I'm just
going to show you the syntax of the S version. But we're going to go to
Excel and practice both. So as you can see, if I start with count, if as first you will
have criteria range one. Criteria one. Basically you will
select a range of cells. Where are you going to
test your criteria? And then based on this criteria, it's kinda count or not. And you can have multiple
of these combinations. You can have criteria range two, and criteria to
criteria range three. Criteria three, and so on. If all criteria are fulfilled, then it will count the record. If we look at some, if it's exactly
the same concept, the only difference
is that you have one more parameter
called sum range, which is the range
you are going to sum if those criteria are fulfilled. Average, if S is the same, instead of some range, you will have average range. So let's go to Excel and let's practice
on those formulas. Here I have a column for agent's country
quantity and says, and what I want to start with is the sum f and
some if as formulas, I want to calculate the sum of sales based on some
filtering conditions. So the first one is Agent one. I only want agent one. So I'm just gonna go here and do equal sum f. Now we
can use some if S, but I just want to show
you the sum a formula. It has a range. The range is the
agent column comma. D criteria is ancient one comma. And then you have the sum range. This is an optional parameter. Now, if your sum range is different than your
criteria range, you can fill it,
which is the case. Now, we're going to select
the Sales, close parenthesis. Press Enter. You'll get 2082, which is the sum of the sales
of this agent. Now, let's try to do something more
complicated. We add usa. Once you have more
than one criteria, you have to use some fs equals
sum, fs, open parenthesis. Your sum range. If you noticed here
in this formula, it is the opposite of the sum. If it will start with
some range there, the sum range is
the last criteria. Why? It is? Because here in this formula, Excel doesn't know how many criteria is
you're going to put. So they start with some range. In the other one. It was designed like this. And if they change it, they are going to have
problems with compatibility. So now the sum
range is this one. Criteria range one is my
agent, karma, agent Warren. Come on. Criteria range to the country. Then USA, close parenthesis, press enter one-sixth to two. So this is this one, this one, this next. We want to add a third parameter bigger than three for quantity. So what I'm gonna do is
just copy this formula. Here you can see I
have the same things. What I want to do
is add a criteria. Here, comma, criteria
range tree is my quantity. Comma bigger than three. Press Enter 966,
which is this one. And this one. Now what if I don't have the
bigger sign in the cell? What can I do? Well, let's just drag this. If you see here, we get 626, which is this record. Because the quantity
is equal to three. If you don't put
the bigger side, it will assume it as three. So what you could do is come here and do double quotation, bigger, double quotation,
and press Enter. Same thing. Or you get rid of
this altogether. And you do bigger than three. And then you do double
quotation, press Enter. So now we know about some EFS. Let's do the same for average. If, if you go here, you will do equal average. If, again we can use
average if S here, but I want to show you
average open parenthesis. You start with your
criteria range. So it's my agent comma criteria. It is Agent two
comma average range. You know, the average range is different than the
criteria range. So we select it
close parenthesis, press Enter for 41, which is the agent to you
have it from here to here, and you have this record. Then we're going to add France. That's easy. Equal, average if S this
time because two parameters, again, they are reverse. So we're going to put
the average range, which is this one, comma. Then the criteria range one, we select age of two. Criteria range two, comma, we select friends, close
parenthesis, you get 379. And then here I have
something more challenging. I have sales. I want to average all
the sales above 400. So let's just copy paste
this one, drag it here. Comma criteria range three
is actually column D. So as you can see
in this formula, column D is my average range and it's a criteria
range at the same time. So that can happen. Comma bigger than 405 29. Why is it 529? Because if we look, this is one record that is
above 400 agent to France. And this is the second one. So the average is 529. Now, let's do count. If this is easy. Now you're going
to get used to it. So equals count IF
open parenthesis, again, we can use
the S version here. What is my range? My range is this one comma, my criteria is aged two, as simple as this
close parenthesis. Now we want to do with France. So let's use count if S equal count if S
open parenthesis. First criteria range, then the criteria comma,
second criteria range. Then the criteria close
parenthesis, press Enter. Last one. We're just going to drag this
and add one more parameter, which is the quantity Gamma. More than three. Press
enter and you get three.
45. S4 L11 Sumifs with Dates + EOMonth formula (***): Let's apply our knowledge of some dates and let's learn
a formula on the way. So here I have some
dates, agents and sales. And I want to calculate
the sum of sales between 14th of Jan
and 19th of June. But before I deep
dive into this, I just want to show you
something about dates. I know we're going to have a
section dedicated to date, but let me show you that. If you click on this, you're going to
see that dates are actually numbers in Excel. So here I get 404575. Why am I getting this? It is because dates starts from one January 19 hundred in Excel. One Jan 1,900. If you go here, you click, you can see it's one. Now, every day is equal to one. And this is how we
can count dates. So now using this knowledge, let's try to do all
these exercises. I'll do control Z a few times just to get back
what I had here, we're going to try to
write the formula. So let's do equals
sum, open parenthesis. My sum range is this one. Now you're used to it. Criteria range one is my
dates comma criteria one. Now, if I click on 14th of Jan, Do you think it's going to work? Well, no. Because it will think that
it is equal to 14 of John. But for me I want
bigger or equal. So if I do this, again, do you think
it's going to work? Press Enter, you'll get
problems because you have to put this into
double quotation. Here. If you don't put the end, you're gonna get the same error. So don't forget to
add the and sign. And then we can close
parenthesis to see what happens. You can see you
get a big number. Why? Because we only specified
bigger than this state, we have to do smaller
than this date. So let's continue and select
the criteria range two, which is the same
date column comma. And here we're just
gonna do it directly. We're gonna do smaller or
equal than 19 South Jen, Let's close parenthesis to 33. Sounds reasonable. Let's filter it to check. Here we open January. We have $0.14, 17 of Jan. And if you sum this, you're gonna get 233. Now let me go back. Now that we have the formula. Since we have selected
columns and we don't have data below this
table, we are safe. We can just drag it. You can see that everything is automatically
coming correctly. Now let's go harder. Here I have a date. Whatever data I put
I wanted to say is between the first of the month
and the end of the month. So how can I extract
this from here? Well, there is a formula that we can see in more
details later on, which is called end of months. Let me teach you this formula. It will be key for dates. If we do equal E or months, open parenthesis, you
have two parameters. You have start, date. So that's easy. We can select this comma
number of monsters. Now, if I put zero and close
parenthesis, press Enter. You'll get the last day of the month for the selected date. That's cool. If I put one, what happens? Then you get the last day of
the month for the next month to get the last day of the
month for two months ahead. Now, if I try to do minus
one now the opposite, you can see that I go one month back and get the last
day of the month. So knowing this and
knowing that dates are numbers and
one equal one day, what I could do
is add a plus one after the formula and then
you get the 1st of January. So now knowing this, I can write a formula similar to this using my end
of months formula. So here I'm going to do
equal sum, open parenthesis. This is my sum range comma
criteria one is this date. Then I need the criteria. So here we want bigger than or equal to the
beginning of the month. So let's put an end. We can use our end
of months formula. This is my start date. Number of months is minus one. Close parenthesis, we add one to it to get the
first day of the month. Then comma criteria range
two is this column again, gamma than, smaller than
or equal to the enzyme. And then we're going to use
again the same formula, the same start date. But here I'm going to put
zero for number of monsters. Close parenthesis,
one time, two times. Press enter. Now
you get H 15549536. Let's select January
and check it out. This is the months of January. You can sum the Saves
and you get 815. Now let's go back. And let's go to
our next example, which is the same thing. But I want to add a person. So I want all the sales
of malaria in January. What to do? Well first let's copy this huge formula so we don't
have to write it again. Control C escape. I go here, Formula Bar, Control V. Press Enter. Now I have the sales of January. If I want to have Maria, why some F can accommodate
more criteria, right? So let's go here. Comma criteria range
three is my agent, karma. Let's select Maria, close
parenthesis, press Enter. You'll get zero. We're going to
check it out. Here. You have some sales for Sergio. If I go to January, you're going to see that I don't have Maria in
the list of names. This is why you get zero. But you can see here that
we get a number for Sergio. So this is how you can
use some F with dates.
46. S4 L12 Build a Dynamic Mini Dashboard with Sumifs, Countifs, AverageIf (***): It is time to have some fun. What we want to do here is
to use our knowledge about some AF count and average if and obviously the S version
of this formulas. And build some interactive
dashboard link to an Excel chart. Here, if you see, I want the user to
select the teams. Then based on this, I want to pull the total salary, number of players
and average salary. And to do this,
we need the data. If you remember, the data
is here in 4.034, 0.04. And what I want to do is
just move this tab here. It's easier for us to select it. So just click on it,
keep it pressed. And then you can move, you
can see with the mouse, and you can move it here, e.g. once you are there,
just released the mouse and you get your tab
next to your 4.12. We go back to 4.12. The first step is to get
a drop-down list for those four cells where the
user can select the team. Now, if you remember, what I need is data validation, I select my four
cells data that I can click on Data Validation
and select my data. Now how do I get the NBA teams? While what I can do
is just go here, select the first
team, do Control, Shift, arrow down, Control C. Then let's go back here. We're just going to click on A1, Control arrow to the right. We go at the end of
the Excel sheet. Let's just go here. Control V, we paste the data. The problem is, this is a
list that has duplicates. So to remove the duplicates, we can just use this option
which is remove duplicates. Click on it. I'd say, okay, and now we
have 30 unique values. Let's go back there. Control arrow to the left. And then here I can
select my sales, go to data validation list. Then we click on this arrow. We do same thing. Control arrow to the right. Let's do Control Shift arrow
down to select the teams. Then we can say, okay, and then use your arrows
on your keyboard. Any arrow will do your back. And you can see that now
I can select my Teams. So I'm going to select the Lakers, anything,
Portland, e.g. Milwaukee, and LA Clippers. Now let's go and write
formulas to pull. First the salaries. The salaries are here. I can do equals sum,
open parenthesis. I need my sum range. Let's go here. My sum range is
my salary column. So this is my column comma, my criteria range one
is my team column. So that's this column. I can select it comma. Then I need my criteria one, we go back here, select the Los Angeles Lakers. Then we close parenthesis, press Enter, and here
you get the salary. Notice that Excel automatically referenced and other sheet. So that's the sheet name. And then the column
for this one, the 4.12, it has referenced it. But since I'm in 4.12, I can just remove
this and keep C3. Press Enter, and you'll
get the salaries. Now since I selected columns, and I don't have anything
below it, I am fine. I can just drag the formula down and get the salaries. Here. The salaries are coming in my graph and the
names of the teams. Now, let's count the
number of players. So what we could do
is use account F. So now equal count if I prefer always the S version
because it's more flexible. So I use it. Then I need my
criteria range one. So we go back here. We're going to select the column which has the team names. And then comma, I
want my criteria one. Let's go back here. Select the Lakers. We can remove this, we don't need this piece. And then here,
close parenthesis, press Enter 17 players. Double-click, you get the
players for all the teams. We have the average salary left. Same methodology equal average
if S, open parenthesis. We go here. We
want the salaries. So this is my
average range comma. We want the team to filter. So that's my team comma, we need criteria
one, Let's go back, select the Lakers and
then remove this thing. You can keep it if you
want, doesn't matter. Close parenthesis, press Enter, and then you double-click, you get the average salary. And this is reflected
by this line. Now, I have a chart here that I have formatted
to get this. Obviously here in this course, the scope is not charts. I'm going to have a course on charts that you can
look at in the future. And you can always refer
to my YouTube channel. But if you see, if you
double-click on the chart, you will get this format. And then you can select
what you want to format and look at the
different options if you want to change something. This is how we can have
an interactive dashboard. You'll see how easy
it is and the power of Excel in this
kind of situations. We can transform
some boring data into something that
people can see visually. And I can change e.g. isolate the Detroit Pistons. You can see they come here. Everything updates. I want e.g. the Golden
State Warriors. They will come here and
everything will auto adjust.
47. S4 L13 Identify and Count Duplicates in 1 step + Range Name (***): Another real-life example. So here I have two lists of ideas and I want to know the
duplicates between them. Now, obviously you can
compare list one to list two or less due to
list1 doesn't matter. In this lesson, I'm
going to do both. Also. I'm going to show you
something more advanced. How to combine this formula with the SUMPRODUCT formula to
get the count of duplicates. Now let's start. And what we want to do is compare the first list
versus the second list. So we can use a
count IF formula, open parenthesis to
select my range. It's in list two. So we click here, Control
Shift arrow down, we select the whole list. Let's use F4 comma. And then what we
want is this 26, so we select it close
parenthesis, press enter. Now you get 11 means that
when T6 exist in this list. So if I go here and
I do Control F, you have 26, Find Next, you can see that 26 is
here. So that's good. Now let's improve on this. If you see here I
selected this range. I want to give it a name. So to give it a name, let's go select this range, do Control Shift arrow down. We go here, we call it list two, and we can do the
same for this one. Control Shift, arrow down, list, one, press Enter. And now instead of this, I can just type list. And you can see my
two lists here. So this is list two, so I can select it. Or what I can do
is select my data. And whenever I select it, it will type list two for me. So I can press Enter,
I can double-click. I can see my duplicates, e.g. you are 56, 18, those
are duplicates. Now let's do the opposite. So equal count. If list one, gamma, we select this one,
close parenthesis. Double-click, we get them. That's great. Now, I want to combine
this formula with the SUMPRODUCT to directly
count the duplicates. First, I'm going to
show you something. So let's assume that
I take this formula. I just drag it here. And instead of C2, I just select B2. I will get the
same result right? Now what I could do is
change this to list two. When I do this, if you have a new version of Excel with dynamic
array formulas, you can get the
result in one go. Otherwise, you might just drag the formula down
and you will get it. So instead of selecting every
cell that we have here, I just have list1, list2, and directly
I have my results. So now I want to combine this with the sum
product formula. So we're going to do
equals sum product. Then we're gonna write count. If open parentheses, list one or list two,
you can do both. It doesn't matter. As long as you
have it like this. Then you close parenthesis, close parenthesis, press Enter, and you'll get six. So directly, instead of
having all these steps, I can count the number of
duplicates in both lists by using only a
combination of formulas, sum, product and count IF
and some named ranges. And this is how you can do it.
48. S4 L14 Sumif with Partial Match (****): So far we looked at
average if as count if S and some fs with
exact matches. But you'll tell me what if I want a partial match. So e.g. here I have th, I want to see all
the agent ideas that have DH and then sum the sales. In the old world, what you would do
is you'll come here equal sum fs, open parenthesis. My sum range is this comma. My criteria range is this comma. And then I have the agent ID, which is th close
parenthesis and press Enter. Problem, you get zero
because Excel is looking for an agent ID
that is exactly th. So what do you do in this case? When the solution is simple? You have to use the star
sign. What does it mean? The star means any
number of characters. So let's go back to our example. Here. The first two are okay. We need to fix our criteria. One, if I want to
have th, anywhere, I can do double quotations,
star, double quotation. And this means any number
of characters before THE. Then F3 is th. And I want to do the
same afterwards. And double quotation
star, double quotation. Any number of
characters after th, press Enter, you'll get 455. Let's check it out. If I just filter, you can just sum this. You get for 55. Now Let's un-filter this. Press Okay, and we can
just drag the formula. It will work also for numbers. Now let's do a bit
more complicated. What if I want to have the
first two characters sth? So let's copy-paste
the formula here, and let's think what we can do. So first two characters, th means I start with
th, this I don't need. So I have my F7, which is th. And then I want any
number of characters. So I have my star in double
quotations. Press Enter. As simple as that, you get your results. Last two characters th, this is exactly the opposite. I'm copy-pasting the formula. And I want any number
of characters th, and then nothing
else afterwards. So let me remove this
star, press Enter. You'll get your results. Now let's do more complex. What about the third and
the fourth character th? So here I cannot use the star because the study is any
number of characters. So first, let's copy
paste this formula. And what we need to use
is the question mark. Question mark means
one character, any random character
but one character. The difference between
question mark and star, star could be many characters. Question mark is one character. So here I want to
random characters. So question mark, question
mark, two random characters, th for the force and
third character, and then any number of
characters afterwards. So we can keep the star. Press Enter. You'll get 69. Now, let's
assume that you have th 66. You want the first
two characters th, the last two characters 66. So here we're going
to use a couple of formulas that we're going
to see in more details. In the text section. You have the left formula. If you open parenthesis,
you have a text. So that's my text. Comma number of characters. It is how many characters
do I want to take from this text starting
from the left? So if I want to e.g. close parenthesis, you get DH. If I want to get the
last two, it is right. Open parenthesis, my text, I want two characters, close parenthesis, you get 66. So now let's use this and
try to get our numbers. We copy-paste the formula again. Here. What we want is
first tool is th. So let's remove all this. Let's start with
the left formula. This is my th 66 comma two. So this means I took th than any number of
characters in the middle. Double quotation, star,
double quotation. And I want my 66. So right. We select the text comma
two, close parenthesis. Press Enter, you'll get one A25. Now we can just drag this and it will do the
same for m n-th. What if I want now
to have the same? But I want only the
best to do this. We're just going to
copy this formula, put it here, and adjusted
because the columns have moved. So we'll just move those
columns like this. And here we want the agent ID. So we just move it like this. What should we do now? Well, if you remember, some fs can take more criteria. So comma, we're going to
select column B, Gamma West. This is the one. Press enter. Now you get 55 out of one A25. We can just drag the formula, do the same for the second one. Using star and question mark is the way to use those formulas
with partial matches.
49. S4 L15 L15 Control Shift Enter (*****): Control Shift, Enter. It is one of the concepts that
I hate the most in Excel. But if you want to be in
advanced Excel user and you don't have dynamic array
formulas, you need to learn it. What do I mean by
dynamic array formulas? It is the change in the
calculation engine of XN. And it's available
in Excel 2021, office 365, Excel for web. And it's also available
for phones, I think. Now what does Control
Shift Enter do? Basically it converts data into an array format consisting of multiple data values in Excel. Sounds complicated. I will explain to you
this with examples. But for now, what
you need to know is that when you do
Control Shift Enter, you will have curly brackets. One curly bracket
before the formula, and one after the formula. So let's look at an example. Here I have three sets, A1, A2, and A3. The values are 123. And I want to multiply by b1, b2, b3, where the
values are 233. Before dynamic arrays, you
will do a formula A1 times V1. You'll get to drag the formula down and then you'll
get your results. Now what if I write
a formula like A1 to A3 times V1 to V3, basically this is where you're going to use Control Shift. Enter. What you will have to do is select the cells where
you have the results. Here. You need to know that
there are three cells. And then you will do
Control Shift Enter. Excel will do the
math automatically. So it will do one times
two equal to two times three equals 6.3 times
three equals nine. If you have dynamic arrays, you just write the formula, press Enter, and it works. So you can try it in your Excel and check out the results, and then you can see whether you have dynamic arrays or not. Another example is using
a formula like launch. It could be a formula like
some average etcetera, where the same
concepts will apply. You want to filter your
data and do some mass. So here I have one
in my last formula, which means I want
the highest number. And what I want to do is
look at A1, A2, A3 filter, the ones that are equal
to read multiplied by b1, b2, b3, and get
the largest value. So how does it work? Basically, read is
true, so it's one, blue is false, it's a zero, and red is a true, It's one. Then you multiply your ones by the other array of numbers. So we'll get one
times two equal to zero times three equals 0.1
times three equals three. And obviously the
largest number is three. In order to execute this
formula before dynamic arrays, you need Control Shift Enter. Now you can draw a parallel
with some products. If you remember, we did something like this
in some products, but some product is one of the few formulas that do not
need Control Shift, Enter. It will process
this automatically. So you can just write
the same formula in some product and press Enter even if you have older
versions of Excel. So now let's go to
Excel and practice. Here you go. If you see in for 15, I have some numbers
and I want to do the same thing I showed
you in PowerPoint. So if you have older
versions of Excel, what you will do is
first you select the cells where you think
the result will come. Then you go and you
do open parenthesis. Let's select A2 A4 times open
parenthesis, B2 to before. You can do without
the parenthesis, it's okay also, but I prefer
it because it's cleaner. And here you do Control Shift. Enter. As you can see, I get curly brackets in
France and after the formula. And here I get the results. Now, if you have dynamic array, it is very simple. I can just do this times this,
press Enter automatically. Excel will understand that this is a dynamic
array calculation. It will give me
the same results. And it will also
highlight this in blue, which means that this formula
is taking those cells. Now there is a section on
dynamic array in this course. We're going to see
it in details. Let's go to some
with conditions. So here I have red,
green, and red. I only want to sum the numbers
that are next to read. So in the previous
version of Excel, I will do equals sum
open parenthesis. I will open another
parenthesis here you need it. I will just select this equal. Let's do red. So we just type right in double quotation, close
parenthesis times. Here, we can select this and
then we close parenthesis. Now you need Control
Shift Enter, and you get six, which is two plus four.
How does it work? Read is a true, green
is a false, a true. And then true is equal to one. So one times two is 20
for false times three is 01 times four is four to
plus four equals six. In dynamic arrays,
it is automatic. So some, we open parenthesis. We do this is equal to red. We do double quotation,
close parenthesis times. Let's open another parenthesis. It doesn't hurt.
Then we close it, close parenthesis, press Enter
automatically you get six. Now what about some products? You remember I told you that some product doesn't require
Control Shift Enter. So let's try the
same formula with some product equals sum product, open parenthesis,
another parenthesis. This is equal to red. And then you do
double quotation, close parenthesis times. Let's select this
close parenthesis. You press enter, you don't
need Control Shift Enter. It is automatic. And other formula
that doesn't require Control Shift Enter
is aggregate. You see I'm typing it here. We're going to use it
in the next lesson. So stay tuned and you will see the power of this function.
50. S4 L16 MinIFs, MaxIfs & Aggregate - How to get min/max with conditions (*****): Let's look at a way to be
able to get the maximum and minimum of the dataset based on some
filtering conditions. So, so far what we have done is equal max, open parenthesis, select my Sales,
close parenthesis, press Enter, and you get
the maximum of sales. But what if I tell you
that the country has to be Japan and then the agent
has to be Asian three. So that means that
the maximum is 28 and the minimum is 13. How to do this? I'm going to show you a
concept for Office 365. So dynamic array formulas and for older versions of Excel. Now the spoiler
alert is that it is much more complicated for
older versions of Excel. But once you understand
the concept, you will see it is
not that complicated. You will be able to use it
in other situations also. So let's start. We're going to start with
the max for Office 365. So dynamic array formulas. And here, the same way we
had some fs average if as Countif as we have max if S. So let me go here
and do equal max if S, it is the same concept. You have your max range. So that's my range
Control Shift arrow now, comma criteria range one is the country Control
Shift arrow down gamma. What is my criteria? Japan, come on. My second range is
the agent range, Control Shift arrow down comma. Then it's Asian three. And then you just close
parenthesis, press Enter. The magic happens,
you get your answer. If I want to get the minimum, what I'm gonna do is just fixed some references with F4
so I can drag it down. So let's do this quickly. Then we can copy the
formula, paste it here. And the only thing we need to change is to go from max to min. Mean if S press Enter, you'll get 13, which is the minimum for
Japan. Agent three. Now how to do it with
older versions of Excel, we need to use the functions that we have seen
in this section, which are large and small. And if you remember, if I do equal large
open parenthesis, I need an array. And then I need my k.
K is one in this case, because I want the largest. However, if you use
large, it can work. But you have to use
Control Shift Enter. And if you remember from
the previous lesson, I don't like this Control
Shift Enter business because somebody might come he or she doesn't know about it, and then it becomes a mess. I want a formula that doesn't
need Control Shift Enter. And for this, we're going to
use the aggregate formula. So let's remove all this. And instead, we're
gonna do aggregate. Aggregate is like some product. It doesn't need
Control Shift Enter. So let's double-click here. Aggregate allows you to select a function as a first argument. I went down and here you
have large number 14. Let's double-click. We get number 14 comma. Then one advantage of aggregates is that it allows
you to ignore things. So now I'm going to use number
four and ignore nothing. But we're going to revisit
this and you're going to see. So let's double-click. We select four comma. Now we have an array. What is our array? It is where we're going
to put our conditions. It is the same concept
as some product. So first of all, Japan. So open parenthesis,
select Japan, Control Shift arrow down, and then do equal, go up. We select Japan, close parentheses times
open parenthesis. Second one is the agent three. So we select our agents. Control Shift, arrow down equal. Let's go up, select agents three, close parenthesis times. And then we select Sales, Control Shift arrow down. We are done with our array. Comma k is our largest value. So we put one and then
we close parenthesis. Press Enter. You'll
get 28. Very good. Let's understand how this works. So I'm just going to copy
this and put it here. I'm going to change
the color and remove this item because
we don't need it. And if I look at the formula, we have kind of three blocks. This is one block. This is the second block, and this is the sort
of block, right? So for the first block,
it's a condition. I'm going to put one in front of every country
that is Japan. So here is one. I can just drag it. Here. I have sorted the data to
make it easier for you. So we can see that here we have Japan and the rest is not Japan. So let's just put zeros and
drag it down to the bottom. We are good. Now let's do the agent. So here we have agent 1.2. So what we're gonna do
is put zeros until here. And then we have Agent 33 times. And since I sorted the data, I can just copy this
and paste it down. And then we have the sales. So Control Shift arrow down, Control C, Control
V, paste the six. Now what is happening? Basically, I am multiplying those three numbers right? Here. We put the result and
we do equal this times, this times this double-click. You can see I get zeros everywhere except
for those three. What I get 1,528.13
and the highest is 28. This is why we get 28. Now let's try to copy, paste the formula and
get the minimum. Here. I'm just going to do F4 again. And let's copy the formula, paste it here. And here. If you see, I need to
change my function. So I have large 14, small 15, double-click and you get zero. Why? It is? Because if
you look at what's happening here, the
same calculation. The only problem is
that now this is the result and the
smaller value in all, this is zero. It is not 13. So how can I fix this? To make it work? I'm going to show you the trick. So what I'm gonna do
is add a column here. And what we're gonna
do in this formula is, instead of having this
part times this part, I'm going to open a parenthesis, do one divided by
open parenthesis. And then we're going to
close parenthesis two times and press Enter. You'll get divided by zero, but don't worry about it. So now what I've
done here is that instead of having
the multiplication, I have one divided by
the multiplication. So let's see what it means. Here. I will have one divided by open parentheses,
three times agent. Let's close parenthesis
and double-click. And you'll see I get
divided by zero error everywhere except when the
two conditions are met. And if you look at the formula, we are multiplying
this times the series. So let's do it again. This times the sales. Then we double-click and we get errors except
for those three. Now how can I fix this formula to ignore those errors and
only look at those three? Well, if you remember, instead of this four, we have other options. E.g. you have option three,
ignored hidden rows, add-on values, nested subtotal
and aggregate functions. You have an error values. So I can select
option three here. Press Enter. You'll get the results
because what happened is that I ignored
all the errors. I'm left with this. My minimum now is 13. So now to be consistent, I want to fix this formula
the same way I have this one. So I can copy this one, paste it here, and here. Instead of this 15, I can select my launch. The rest is the same. Press enter and you get 28. So just to recap, what we do, we do one divided by the
multiplication of my conditions. So if one condition
is not correct, I'm gonna get 1/0. I'm
gonna get an error. Only if there is no error, I'm gonna get a one. Then we multiply
this by the sales, and then we get this result. If we use aggregate
and ignore errors, then we can get the smallest or the largest value
for the mean and max to the power of this concept
is that you can use it for many situations
when you want to sum, when you want to
average, and so on. You can see the formulas here. If I just remove this, you can see all these formulas where you can use this concept.
51. S4 L17 Advanced Ranking - No skip (*****): Sometimes the easy rank
formula that we have in Excel will not serve our
purpose in real life. And let me show you why. Here you have a competition
and you have 15 teams. And we want to rank them equal. Rank. If you see we have
three rank formulas. If you remember from
our previous lessons, rank is for
compatibility purpose. And then you have two new ones, rank average and rank EQ. I'm going to use an Anki queue. And then I need my number, which is my points. Come on. My reference
is this F4 to fix it, comma, then you have
ascending or descending. If you put zero,
it is descending. Also it is the default value. I won't put anything. I'll just let it do
descending on its own. And then I double-click
and I get the results. If you see there is one
team that is first, then two teams that are seconds. And I don't have a number three. The next one is four. But in this example, I want to award winners. I have a podium. I want to put somebody on the third step of the
podium. So what to do here? Well, let's look at something
much more advanced. You are ready for it. Take your note pads
and follow me here. The formula surprisingly has
nothing to do with rank. I'm gonna write the formula. Then I'm going to
explain it to you. So equal sum product, yes, it is some product,
our eternal friends. And here I'm going
to put a formula. First of all, a condition
which is this hundred, smaller or equal to. Let's select this. Press F4, close parenthesis
divided by count. If then I'm going to
select this range, four. Here, four criteria, you're
gonna get surprised. I'm going to select
the range again. If you remember this count, if we have seen it where we have ranges in another lesson. Now let's close parenthesis. Close parenthesis again,
and then press Enter. If you see here, I
have one for this one, I double-click to two. But now this one is third. I achieved my purpose. So now you're going to
think that I'm crazy or something because the
formula looks ridiculous. But wait, we can go step-by-step in this
formula and understand it. First of all, let's understand the formula from the
point of view of Tm1. So here, if I take
this condition first, Control C Escape, Let's go here. I'm gonna select
this range of cells, paste the formula,
put an equal here, and then I'm gonna do
Control Shift Enter. If you have Excel
with dynamic arrays. So newer versions of Excel, you can just copy-paste the formula and it will
give you the same results. Now, if you look
at this formula, it is B2, which is this one, versus this whole range. Now, B2 versus hundreds. Is it smaller or equal? Yes, because it's equal. This is why you get
the true Hundreds. Is it smaller or equal
than 90 to know? And then if you go down, you're going to see that 100 because it's the highest value. First one is true. All of them are false. Now let's get the second
part of the formula. So you can copy,
paste the formulas. So Control C, escape. Same thing. You come here. You select the area, then you go here, paste it, put equal, and then
Control Shift, Enter, and you'll
get some numbers. So now let's look
at those numbers. Basically, I am counting how many times I have
hundreds in this. For the second one, I'm counting how
many times I have 92 in this and you
have two times 92. This is why you get two. Then 3061 time, 9062
times, and so on. Now, if you look
at this formula, We have a division, right? So let's do through divided
by one is equal to one, force is equal to zero. So if I double-click, you can see that everything is zero except the
first one is one. This is why you get
your one ranking. Let's try it from the point
of view of the second t. In this case, this
formula doesn't change, but this formula will change. So let's go get it. Here. You have B30 divided
by all this. So Control C Escape.
Let's go here. Let's just paste it. Control Shift Enter. And now you can see
that the first one is true because 92
is less than 100. So that's fine. Second one now becomes true because 92 is less
or equal than 92. And here also same thing. All the other ones are false because the condition
is not fulfilled. Now, if you see. The 1/1, It's one here
because I have two of them. It will be true divided by two, which is half and half. If you sum them by some
products, you will get two. Same thing will
happen for team for. Now, let's go to Teams 13. So as we said, this
part is the same. We're going to copy this
part Control-C Escape. Let's go here, select our area, based it, and let's do
Control Shift, Enter. Now, let's look
at what happened. You know the drill. Now we are comparing
89, which is this one. First versus 100. It will be true versus 92
through versus 92 true. The only difference is that now 89 is smaller or equal than 89. So I have another through here. Now, this piece, you know it. Now you have an
additional one here. If you submit, you get three. And this is how you
get 123, et cetera. Now, if you don't have
dynamic arrays, it is okay. You can just take the
winners and copy paste them. But if you have,
I'm gonna show you a cool function where we
can just get the winners. So this function is
called texts that joint. Here. We're just going to
go up and put equal texts, the joint open parenthesis, you have a delimiter. So here you want to join texts and then you want to
separate this text. So double quotation. Then you do semi-colon,
double quotation. We want to separate them
by a semi-colon comma, ignore and T cells. Let's put through comma. Then we have our texts. To get our texts, we're going to use a formula. So if open parentheses, this one is equal to here. Wherever I have a one, this is my condition,
Gamma value. If true, I cannot
return only one record. I need to select the
whole array of teams. Now what it will do, it will check every number
wherever there is a one. It will give me the team. And if it's false,
I want some blanks. So close parenthesis, close
parenthesis. Press enter. Now you get T1. Let's just fix some
of this formula. So here we need a four. Here we need a four. But H9, we want it flexible. So double-click now
and you get T1, T2, and T4, and Tim 13. Let's check it out. If I just select this
formula and do F9, you can see that
wherever I have one, I'm getting the team
and the rest is blank. And we're joining all
this ignoring the blanks. So it's Tm1. Press Escape here. Let's check the second
one. Same thing. We check it, F9. You can see that
wherever I have to, I'm gonna get the
team names and then I ignore the blanks
and I joined them. Let's press escape
with a semicolon. This is how you can
be creative with your formulas to be able to
solve real-life challenge.
52. S5 L1 Intro (material in Project section AllToDo, AllCompleted): Welcome to section five of this course that
is about lookups. This is one of the
toughest sections. But once you master it, you'll be able to improve your
analysis capabilities and produce dashboards
and charts that are dynamic and amaze
your management. We're going to start with
named ranges and Excel tables. This will improve
the readability of your formulas and deal with the problem of growing
data in your table. After that, you have the
basics of HLookup and VLookup. And what are the pitfalls? Rows and column formulas will be useful once you combine
them with lookup formulas. It will improve the
efficiency of your formulas. After that, we're going
to see approximate match. This is always a headache. How to get approximate match
using your lookup formulas. Then you will see
index and match. Those are very powerful
when combined. And they will replace VLookup and HLookup in some situations. So we're going to see
an example of that. Then we will see
x lookup formula, which is a new formula
in Excel that comes with newer versions of Excel and
dynamic array formulas. So we want to know what is the difference between X
lookup and the other lookups. And y x lookup is better. Throughout this section,
you will see examples of dashboards and charts and
how to make them dynamic. Before concluding this section, you will have the
choose formula, which is a cool formula that
people don't use that much. But you will see the
power of this formula. Then you have the
offset formula. This formula will
allow you to create dynamic ranges that you
can use in other formulas. To be able to do things
like calculating year-to-date numbers
and rolling averages. So I hope you are ready
for this section. Let's go.
53. S5 L2 Named Ranges & Excel Tables (**): Before we deep
dive into lookups, I want to show you
two concepts that will be useful for
lookup formulas. The first one is named range, and the second one
is Excel table. Let's start with named range. Basically what it is is
that you select some cells. It could be one, it
could be multiple, and you give them a name. Once you do this, you will be able to use
this name in your formulas. When you are writing
your formula. Instead of having a range, it becomes a name. It's easier to write and read later on when you
want to see what you did. Now, if you go to a place
called Name Manager, you can see this new name
that you have created. You can edit it. I'm going to show you
all this in Excel. One of the biggest drawback
that you have with named range is that if you
add data at the bottom, it will not expand. So that means that your formula will not automatically adjust. So either you fix your
formula or you go to the Name Manager and you change the range
corresponding to this name. The second concept
is Excel table. Here, you can transform
range of cells into a table. Or if you want a database. This way, whenever
you are writing a formula and you are referring to the column which
has this dataset. You will have the name of the table and then the name of the column instead
of just arrange. So that also will make your formulas easier
to write and read. And the additional advantage is that if you add
data at the bottom, it will be automatically
taken by your formula. So let's go to XN
and practice here. If you see I have a table. The first thing I want to
do is to write a formula. Where are we going
to sum the revenues equals sum open parenthesis. If I select my data, you can see that
here I get e to 216. So now what I could
do is come here, select E2 to 16 and call it. Press Enter. Now you have a named range. So if I go here and
either I write graph, you can see it here. You can double-click
and have it. Or what you could do folio
formula is select your data. As soon as you select
the whole data, it will be converted to rref. So now if I press Enter, I get the same number. Now let's go to Name Manager. So Formulas, Name Manager. You can see here, if I click and edit, I can e.g. change it. I can also delete it. I can say, okay, create a new one, call it Rev, and then
give it a description. And here if you see those
are the sense that I can refer to and press Okay, Close. And this is what we get. Now, if I add data at
the bottom, so 1,000, you can see that
nothing happens to my formula because my ref
is only from here to here. What I have to do is go to the Name Manager, double-click. And then I have to change it to this in order to have
my formula updates. Now let's delete this and let's go here and
create an Excel table. So I can go to Insert
and then I have table. Or you can use Control T. You can see it here. This is the shortcut. If I click Excel will try to guess what is the range
of cells that I want. So here it has
guessed correctly. My table has headers. Yes, I press Okay. And here I have the
name of the table. Let's call it F
table. Press enter. Now you have a table. Let's write the formula. So e.g. sum of quantity. If you see, whenever I
select the whole quantity, you get ref table and the name of the
column which is quantity. So it becomes like a database. Let's close
parenthesis. And here, if I add 1,000, you can see that the formula
automatically updated. The table automatically
expanded. And this is a great
advantage of tables. Now, if you want to
get rid of this table, what you can do is
click inside it table design Korver to range. And then you say Yes. And now the table is gone. If you go here, you can see that now it has been converted
to a normal range. So now what I can do is just
select this and press enter. So the concept of table will be very important for look-ups. Because sometimes
you want to look up data and then your
database expands. You want it to expand
automatically so you can do the lookup and
it works all the time. We're going to see
this in this section.
54. S5 L3 Vlookup / Hlookup (*): If you ask people about XN, a lot of them will tell
you it's about VLookup. It's time to learn this formula and learn the HLookup
formula also. What is VLookup? Basically,
VLookup or vertical lookup, allows you to look for
a data point and return the corresponding data
points on the right side. What does it mean? Let's take an example. I have a table with
country agent, price, quantity, and revenues. What I want to do is
look for a country, e.g. country, to return the
corresponding quantity associated with country
to which is 31. In this case, I can
use a v lookup. Now you have to be careful about a few things for VLookup. The first one is that you can only look from left to right. So if I get the
revenues and I want to get the
corresponding country, I cannot do this. Also. Always my most left column that I select should
have the lookup value, which is the country
in this case. Finally, you need to select the whole range if you
want to get your results. So e.g. here I want
quantity from country. So I have to select
agent and price with it. Otherwise, I won't get my results even if I
don't need those columns. So now let's look at the syntax. We have four parameters. Three are mandatory,
one is optional. The first one is
the lookup value. So what am I looking for? The second one is
the table array, which is where is my dataset? In this case, if I'm looking
for quantity from country, I need to select country
Asian price and quantity. Then you have the column index, the column index, the column
number where my answer is. So in this case,
countries one agent to price three and
quantity will be four. So I have to specify four. And finally, this is the optional parameter,
the range lookup. So false means that you
want an exact match. And 99% of the cases people
want an exact match. However, if you don't
specify this argument, you will get through by default and that could
cause you problems. So just be careful
on this point. Now let's go to HLookup. H lookup is exactly
the same as VLookup, but it is horizontal
instead of vertical. It can look from top to bottom, from up to down. It cannot look from down to up. And again, you have to
select the whole range. So if I take this example, you can see that the
data is now inverted. What I will do is
look to the right for my country and then return
the corresponding e.g. here revenue by going down. And if you look at the syntax, the syntax is extremely
similar to the other one. The only difference
is that it has row index instead
of column index. So in this case, my
row index for revenue will be five because it is the fifth row that
I want to return. Now let's go to Excel
and check this out. In this Excel sheet, you can see that we have the same data I showed
you in PowerPoint. And what we want to do first is create a drop-down
for countries. And based on this, I want to
get the price and quantity. So let's do it. I
select my country sand. Then I go under data,
data validation. Here I need the list
and then the source. I just select my country's
press on the arrow press. Okay? And now we can
select the country. Let's select count 32, and let's get the price. I will do equal VLookup
open parenthesis. My lookup value is this comma. Then you need your table array. So here I want price. So e.g. the minimum I have to select is from country to price. Even if I don't need agent, I have to select it. So we select our data
comma, the column index. So country is column one, column two, column three. So that's three comma. And then I want an exact match. So it's a false
close parenthesis. Press Enter, you'll get 92. It is correct. Now let's do the quantity equal VLookup, open parenthesis. My lookup value is contrary to. Now my table. I have to go up to
quantity minimum. I can also take revenues. Nothing happens. It's fine. But quantity is the minimum. If you notice, I always
start with country. So e.g. if you do this, I'm just going to show you
it's not going to work. Let's put anything and
false, you'll get an error. So you have to put first
column as country. You cannot put another
column before it. Here we have our right column. And then let's just
do the column index. In this case it is four. And then I will do false. Close parenthesis, press Enter. You'll get 31. Great. Now we can just change it
because it's dynamic. And you get 91.100
for H and five. Now, you don't have to
use VLookup on its own. So e.g. let's assume that you
don't have the price here. And price is equal to
revenue divided by quantity. So let's do it. Let's remove this and do equal. First is revenue. So V lookup, open
parenthesis, column 35. My table array is now my whole table because
I want the revenues. The column index revenue is
the fifth column comma false. And then divided by
another V lookup. So you can see how
you can use it. The lookup value is
country five, table array. In this case, I'm going to select the whole
table, it's fine. And then I need my column,
which is quantity, so it's column
four, comma false. Then press Enter and you see
you get the same results. Let's go to Formulas, Evaluate formulas, and try
to see what's happening. Here. If I start evaluating, I get country five. I need to get the full revenues. So this is 9,100. You can see it here. And then I'll do evaluate
for country five. I need to get my quantity. You can see it here, hundreds. So my other VLookup gets it. And then if you divide this
by this, you will get 91. Now let's go and do the
same thing for HLookup. You can see that the
data is now inverted. First of all, I'm
just going to copy this and put it here
for data validation, so that's easy for us. And then I'm going to
use an HLookup to get the price here equal h lookup. Open parenthesis minus
Ka value is this. Now my table array. I will select the
whole thing for this. So here I will do
Control Shift arrow to the right, arrow down comma. Then my row index is
what country is one. Agent is to price is three. So three, Gamma, false,
close parenthesis. Press Enter. That's your 91, which is here. And then we can do the
same thing for quantity. So the same rules apply. You have to start with your
first row, which is country. And you have to include
all the columns until the quantity e.g. here. Here I'm going to do equal
h lookup, open parenthesis. My lookup value is
my country comma. Then I want my table array. Let's select it. We can select it
all if we want to. And then quantity
is row number four. And then false. Press Enter, you'll
get your hundred. And this is how you will
use HLookup and VLookup.
55. S5 L4 Row, Rows, Column, Columns practical application (****): For formulas that
we're going to see now are rarely
used on their own. But if you combine them with other formulas such as VLookup, they can be very powerful. So in this lesson, I'm first going to
start by the theory. I know it's a bit boring, but you need to know the
theory and then I'll show you how to use those
formulas in practice. So the first formula that
we're going to see is rho. The definition is very simple. It returns the row
corresponding to the input, as simple as that. However, there are many
ways to write this formula. You can do rho A1. It will give you one because
it's the role of cell A1. Then you can do row two. It will give you two,
which is the second row. If you don't put any parameter, it will give you the row of the current cell what you
have written the formula. So if you wrote
the formula in S3, it will give you a three. And then you can
select multiple rows. So rho A1 to A3, if you don't have
dynamic arrays. So you have an older
version of Excel. You need to select three cells and then write the formula, do Control Shift, Enter. And you'll get one
in the first cell, two in the second set, and three in the third session. If you have Excel
2021, office 365. So you have dynamic arrays. If you just tried to formula press Enter, you'll get 12.3. Now, another way to write
the formula is row 123. Like you can see on the screen. Again, you'll get
the same result. Now, let's go to rows. Rows with S returns the count of rows
corresponding to the input. So the first one, it
gives you the row, this one gives you
the count of rows. So e.g. rose, A1 gives you one because there is only one row in what
you have selected. Rows, B12, B5 will
give you five, because they are five rows. Then row three is three,
gives you one row. Rows, 125 gives you five rows. Now let's go to
columns and column. We're going to
start with column. It is the same concept as rho. Basically it will return the column number corresponding
to the input you give it. So column A1 is one because
column a is the first column. Column B, B is two, B is the second column. If you don't specify
a parameter, it will give you the
column of the current set. So if you have C2, it will be three because C
is the third column. And the same way we
have seen with rho. If you select multiple
columns, column A12, C3. If you don't have
dynamic arrays, you will select three says. And then you'll do Control
Shift Enter to get 123. If you have dynamic arrays, you will get 123 just by putting the formula and pressing Enter. And you can omit the row. So you can do column a to C, and then you will
get 123 columns, will return the count of columns corresponding
to the input. So columns A1 is one
because that's one column. Columns B12, C5 is to columns, and columns a to C
is three columns. Now let's go to Excel. Here in Excel, you
can see that I have some prices for some items. And I'm going to start using my formulas to be able to
get the top three prices. So we're going to see
different methodologies. The first methodology
is by using rho A1. So first of all,
before I do that, let me show you the traditional
way of getting this, the top three numbers. If you remember, we can
use our large formula. So large has an array. So I can select e.g. this, and then comma, I need my top number, so I'm going to put
one than what I have to do is
copy-paste the formula. Here I have to put two, press Enter, and here I have to put three
and press Enter. This is very cumbersome. So here I can use my ROE
formula to get my results. So I'm going to
delete this, go here. And I'm going to put rho A1 in parenthesis and press Enter. Now rho A1 is one, so it will give me one here. And then the largest
value is 99. Now if I drag it down, you can see that I get the result because
this will become A2, which means to the second-largest And here
the third largest. So that's one way to automate your formula so
you don't have to come and change it manually. Let's do it with a
different way. Now. I'm gonna do large open
parenthesis, select my price. And this time I'm going
to use roles with S. Here. I'm going to do dollar
sign one, then column, and one, close parenthesis, close parenthesis, press Enter. Let's drag it and
explain it to you. So here you have one with
$1 sign and then one, it will return
one, it's one row. If you go down, the one stays the same because I have
$1 sign before it. The other one goes to two
because I drag it by one. So that's two rows now. So large D, D2 is
the second largest. Here it's 13, so it's
the third largest. Now, let's select many roles at once using Control Shift Enter. So what I'm gonna do is
select my three sets. And here I'm going to write
equal large open parenthesis. Here we need d. So that's my D comma. And then I need to write
row one, column three. So three rows I'm taking
here close parenthesis, Control Shift, Enter, and
you get your results. Notice here I have
the curly brackets. Then the first row will be one. So you have the largest. Here, you will get two, and here you get three. If you have Office 365 like me, you can just type the
formula very easy. Large, select column D comma, and then you do row 123. So three rows, close
parenthesis, press Enter. You can get the same results. You can see that is this
blue box around it. Because I have a formula that is spilling dynamic array formula. Now let's go to
columns and let's try to do VLookups to get item A1. I want the quantity, the discount, and the price. First methodology, we're
going to use column AB. So here I'm going to write equals VLookup,
open parenthesis. My lookup value is this one. I'm just going to put $1 sign
here because we're going to derive the formula later on. Comma, my lookup table or
my table array is all this. Let's use a four and
then come up here. I'm going to use columns a to B. So columns with
$1 sign a than B. Then you close the parenthesis, and then you have
comma and false. Press enter 760,
which is this one. If we drag it here, you will get the
discount and the price. This one is in percentage, but I'm not going to change
the format right now. Let's just look what happened. Here. I have a to b. So that means two columns because I'm counting
the number of columns. So quantity is in column
number two, right? Because this is 123.4, for the discount is fixed, it doesn't move, but
I moved to the right, so B becomes C. So now
that's three columns. So it gives me three here. And then discount
is column three. Price same thing,
it becomes a to D. Now let's just drag
this formula like this and change this to BB. So now we remove the S From column and we do BB
without any dollar sign. Press Enter, you'll
get your result. Let's drag it. You get
the right results. Why? Because B becomes C. And now the column of C is the
third column in Excel. So that's a three
here, that's a four. Now let's use Control Shift
Enter with column B to D. So I'm selecting several
columns with my column formula. Here. I just select the data and I
do VLookup open parenthesis. My lookup value is this one. I'm just going to
put $1 sign here. Comma, my table is this comma. We're gonna do column B to D, close parenthesis comma false, and then Control Shift Enter. You'll get the
right results Also because here it to column
B for the first one, column C for the second one, and column D for the third one. Now, if I just write
the formula again, we look up and then I
select my lookup value. I can do dollar sign here. This is my table array comma. My column index will
be column B to D, close parenthesis,
and then false. Press Enter. You'll get the
numbers correctly. And here we can just change
the format, and that's it. So this is the power of those four formulas to automate
dragging your formulas.
56. S5 L5 Joining Data with Vlookup (***): Since you are getting
more familiar with HLookup and VLookup formulas. I want to work on a
real-life example with you. And I want to discover the data and do the
analysis together. So here we have an
order database. If we go to the end, I want to add the city, the state, the postal
code for every client. So now here I have
a customer ID, and on the right, I have a database which
has the customer ID, the city, state,
and postal code. So here I can use
my VLookup formula. So let's go back. Let's
start with the city equals V lookup,
open parenthesis. My lookup value is my
customer ID comma. Let's go here. We have to start our table array with
the customer ID, because my lookup value
should always be in the most left column as we
have learned than we do. Control Shift arrow
to the right, arrow down to select the data. Let's do afford to fix it. Next, we need our
column index number. Let's go here and count 12345. So CT is number five. So I'm going to put five km, a false close parenthesis. We press enter,
we get Henderson. Now, let's go and
check our result. It's always a good
practice to check. So Control C, Let's go to our database, and let's go here. Control F. Then we based our customer ID. Fine. Next, we have one in
Henderson, That's good. The first one, Find Next. And here you get a surprise. Another customer, same id,
living somewhere else. So what happened here? Basically, if you didn't know VLookup will only return
the first match it finds, and it will start from
the top to the bottom. If you have a second one
like here, you won't get it. And it's the same for HLookup, but from the left to the right. So the first match from
the left to the right. So you need to know your
business before you apply formulas and you trust the
results of formulas blindly. In this case, to
fix the problem. We have also the name
of the customer. So we're going to create
a key equal customer ID and the name. And here we can
also have the key, so equal customer
ID and the name. Here we're just going
to double-click. So it goes down. And let's do the same here. So now we can fix our formula. If we click first
thing I want to do, the lookup value is not
the customer ID anymore. It is the key. Then you have your table array. I'm going to delete it. Let's go here. We have to start from
the key this time, because this is where I
have my lookup value. So Control Shift
arrow to the right, arrow down. Let's press F4. We're good with this one. Next we have our column index, which is this five. Now, if we count it is 12,345.6. The problem though is that
once I'm going to drag the formula to the right to get the state and
the postal code. I will have to replace the
six by seven and then eight. And that's not very practical. So how can I
automate my formula? Well, if you remember
the previous lesson, we had a formula called columns. If you open parenthesis, this formula will count the number of columns
you will give. So if I do two a, e for this one and
close parenthesis, I'm going to put $1
sign in front of it. I'm gonna get my
six columns here. Whenever I'm going to
move to the right, I'm gonna get z because it
has $1 sign, it's fixed. And instead of a,
it will become a f. Then the number of columns
will increase by one for the state and by two
for the postal code. So I'm going to get
the right answer. Now that I have fixed my
formula, Let's press Enter. And here we get Henderson again. The only thing I
need to fix the drag it to the right is this P2. So here the key, I don't want it to move to the right once I
move to the right. So I'm just going to
put $1 sign in front. You can use F for several
times and you'll get this. Press Enter. Now you can drag it like this. It will give you a
Kentuckian, the postal code. You can see here it's AF AG, so the number of columns countered will
increase by 1.2 here. Then we select all double-click and we get
all our information. Now, in another lesson, I'm going to teach
you how to improve this and change
this table array. But for now what I want
to do is teach you how to check whether a customer
exists in my database. So what we're gonna do
is two methodologies. The first one is with IF error. So if error, open parenthesis, I have value and value IF error, my value will be a VLookup. I'm going to search
for Dave Brooks comma, where here in the customer name. So I'm gonna put one for the index and false to
get an exact match. Now we close parenthesis
comma value if error we can type not found
close parenthesis. Here we get David Brooks
because it exists. And the second one
without S doesn't exist. The other way to do this
is to come here and do IF open parenthesis is
error, open parenthesis. So the other one was if adder. This is if there is
error for value, we will put the same VLookup. We have this one comma, we want it in this
than one and false. And then you just
drop it in is error. So another parenthesis,
comma value if true, if it's an error, it's
not, they're not found. And then if there is no error, we can put foward, close parenthesis, press Enter. And now, if I just
drag this down, you can see that the
second one is not found.
57. S5 L6 Improve your Vlookup with an Excel Table (*): I want to build up on the previous real-life
example that we had, where we had to do the
analysis together. And if you look at the
VLookup formula that we got, it has this table array, which is that two to h4927. Now the problem with this is that if you add
data at the bottom, your formula might
not work correctly. And this is actually what
will happen in real life. You will have an expanding
customer database. What to do in this case? Basically one solution would be just to select the columns, like I'm doing right now. And then if you add something, it's gonna be okay. But the problem with that is that if there is something
below your table, it might consider it and
give you wrong results. So what is another way
to fix this permanently? Well, if you remember one of
the lessons in this section, we looked at Excel tables and this is what we're
gonna do right now. Let me press Escape. Let's go here, and
let's do Control G. You could also go to Insert
here and select Table. It's the same. Now, Excel will try to guess
where are my values? Here they are, correct. My table has headers. Yes. Let's press Okay. And now you have an Excel table. The first thing we gotta
do is change the format. So I'm just going to
do like to remove the format and I can
give it a name, e.g. cost taper. So customer table, press Enter, and now you have a table. What to do in the formula? Let's go back here and let's
replace this with cost. You can see it cost table. Double-click. You have it. Now you can just drag
your formula like this. Double-click. You get the same results. But the difference is that one. It is more readable. If you add data at the bottom, the table will automatically expand and you don't have
to fix your formula.
58. S5 L7 Troubleshoot your Vlookup (**): Whenever you write V lookups, you might get errors and
then scratch your head for some time to find out what
is the cause of the error. So what I want to show you is the most common errors
you're going to face and how to fix them. So let's start the first one. If you write the formula wrong. So here, e.g. you need
a PPI to do VLookup. The second one, if you see it, I'm looking for a 35 and
a certified is here. But I don't have an answer why? It is because if you go here, you have a space after a 35. Here, you have a
space before a 35. So obviously, if you fix it
like this, it's gonna work. But I advise you to fix your data so you
don't have spaces. The second one is the same. You have a 35 without space. And this one has a space. Next, if you see I'm
looking for 100. In this, there is no answer why? It is because 100 is
formatted as text. So here you can
just convert it to number and you get your result. Or let's do Control Z. What you could do is just select this column and
then you do data. Then you will do
Text to Columns. And here you do next. Next, you'd convert
it to gender. So that's the
important one. Finish. And then it becomes a number. Let's do Control Z again,
and let's continue. The next one is
46.1 and it's here. But I'm not getting Ben why? It is because it is
an approximate match. So if you don't put false
for the last parameter, it will look for
approximate match, and sometimes it doesn't work. So if I do false, I will get my results. Then we look at the next 18123. It is here, but no results. Why? It is because you forgot
the double quotations. Here. It is looking at cell B13
and not at number 8123. So let's put it in
double quotation. Press Enter. You'll get your answer. The last one, if you look at it, I'm trying to do a lookup
from right to left. Obviously doesn't work. So we need to do one. If you press Enter
Stan, not fixed. Y 201 is here. Well, if you look here,
it's actually 200.94. So you need to do 200.94
to get the results. And this is how
formatting trick to you. So these are the common problems that you face with VLookup. Now, let me show
you another trick. The later two dates. So those numbers,
they look like dates, right? 010120220201, 2022, etc. However, if you just select them and you go to
change the format, you select short dates. It doesn't work. Why? Because they are
not dates actually. Let's do Control Z. And instead of manually
trying to fix it, Let's just select
this and go to data, text to columns delimited. Here you don't care The same. Here is where you
have to do a change. So you select date and then you have to see
how the data is here. So I have here month and day. So that's year, month and day. Let's press Finish. Now there are dates you
can see if I select e.g. long dates, double-click. You can see my dates.
59. S5 L8 Approximate Match for Vlookup for lookup within boundaries (****): In 99% of the cases, when you use a v lookup, you want an exact match. So you're going to do false
for the last argument. But there are some rare
situations like this one. Where do you need an
approximate match? So let's look at this case
and solve it together. Here I have some exam results
and I want to convert them to create from a to E
based on this table. So e.g. zero to 60 is integrate. Now, if I use a normal VLookup equals VLookup,
open parenthesis. My lookup value is 82
comma my table array. Let's select this and
let's do F4 to fix it. Comma, my column index is two. And then I do false. Close parenthesis. I double-click. I get an a. Why did I get an a? Because a T2 is
not present here. If it's not present, it can find anything. I get an error. Now, what to do in this case? First of all, the
technique is you have to sort your data from the
smallest to the biggest. So this is what I've done here. Otherwise it's not
going to work. And you always select the
smaller of your range. Here's zero to 60, 61 to 70, 61, and so on. Then you can change
this false to either true or just remove it altogether because the
default value is true. Press Enter, and
the magic happens. Let's double-click. We get older grades. We can verify 63
is a D. It works. How does it work? Basically the approximate match. We look at the highest
value in your table that is below or equal to your
lookup value, e.g. 63. What is the highest value here? That is smaller or equal to 63? It is 61. And in this case, it will give you a D. Let's look at this 182. The highest value in this
table that is smaller or equal to AD2 is 81.
So it gives you a b. And this is how you can
use approximate match in those kind of situations
to get your results. Another situation that
is very common for approximate match is one
you want to get discounts. E.g. the more I buy, the higher my discount. You can use a similar approach.
60. S5 L9 Index Match Basics (***): In some cases, your VLookup
formula will not work, especially when you want
to look at data that is on the left of the column
that has your lookup value. So what do you do in this case? When you can use the
index and match formulas? So let me explain to you how
those two formulas work. First, we're going to start
with the match formula. Basically, it will return the position of a value
in a list of values. So e.g. if you look
at the syntax, you have match lookup value, which is what you
are looking for. Then you have your lookup array, which is where
you're looking for this value and match type. It's an optional parameter. It could be exact match, greater than or smaller than. So as you can see,
I have three names. Let's say they are in
cell A1, A2, and A3. And if I write much, Caroline, A123 comma 00 means exact match. You can see that Caroline is
the second name in the list. So I'm going to get a two. So that's the match formula. Now the index formula. It will return the value given a position in
a list of values. Here we have our array, which is our list of values. Then you have the
row number you want, and then you have the column
number that you want. And this is an
optional argument. If I write equal index A123, 2.1 means I have
those three names. I want the second row
and the first column. And in this case it is Caroline. Now the value of
those two formulas is when you combine
them together. So suppose that now
we have a DB and TMC. So from V1 to V3, and they are next to
John Carter line. And mark, if you right, index A1 to A3, match Jim b0, b1, b2, b3, zero. And then one, you
will get Caroline. Why? Because if we look at our match formula to
be exact match in B1, B2, B3 is the second team that we have that
we'll return to. And then you have in
John, cannula and Mark, you have the second row because the match formula return
to the first column, which is John Carolan and Mark. And this is why you're going
to get the second name. Now let's go to Excel and try to use those two
formulas together. Here if you can see I have a
dataset With country price, quantity, revenues and agent. And what I want is
to get the country, which is this one,
corresponding to the Asians that you
select and the revenues. They are both on the left side. This is why a VLookup
will not work. Now I already did the
drop-down with the agents. We can select e.g. Agent two. Now, before I write the formula, Let's start with the match
formula and see how it works. So here I want to do equal
match, open parenthesis. My lookup value is
Agent two comma. Then my lookup array
is my array of agents. So I can just select
it like this and then comma match type
zero for exact match. So now if I press
Enter, I get two. Why? Because my agent to, is that the second position of this array of agents right? Now, if I want to do
index equals, index, open parenthesis, your array, it is where I want
to find my answer. So think about index,
like Google Maps. You need to load your map
first where you wanna go. And then you will
tell Google Maps where you want to go, right? Where do I want to go? I want to go into countries so I can select my country's comma. Then, what role do I need? I need the second country because we are at
agent to, right? I'm going to type
this manually comma. And then I want the first column because I only have one column. So I can do this close
parenthesis and get country to. Now note one thing. You can either omit the column, it will take column one, so you get the right result. You can also do zero for column. It will work. One, we
saw it, it will work. But if you put two, you get an error. Why? Because it is telling Excel
to go to the second column. And here in my map I
only loaded one column. So it gives an error because
I went outside mind-map. Now to fix it, you can
just add the b here. So now you have two columns. Press Enter. You'll get 92, which is the record that you have
in front of country two. Second row for Excel because
we started from country one. So that's how it looks at. It. Now let's combine both of them together to get the country. So here, if I go equal index, open parenthesis, as we said, the array is where
I have my answer. My answer is here. I just selected gamma,
the row number. Now, we're going to embed
the match formula in it. So much open parenthesis. Agent, who is my
lookup value comma, where I am trying to find agent
to in this array of data, comma, match type, exact
match, close parenthesis. Here I have one column. So I'm not going to put
the column, that's fine. And then we close
parenthesis, press Enter. You have contrary to if I
change it to agent three, you'll get country three. Now let's try to do
the same for revenues. So here we can write
the formula directly. Equal index, open parenthesis. What is my answer? My revenues, they
are here, right? So we just select them. Comma, my row number. I need the match formula,
open parenthesis. What is my lookup
value? It's here. Comma, my lookup array is here. And then match type, I want exact match. So zero, close
parenthesis, comma here. I'm going to put one for column. And then we're just going to
close parenthesis and you get the 4,712, which is correct. Now I want to make
it more complicated. Here. I also put the drop-down,
quantity and revenues. I want to toggle between them. So how can I get the quantity
e.g. automatically here? Well, let's just look at it first and fix the
formula manually, and then we'll do
something else. So here I have revenues, right? But quantity is not there. And we learned that
for index, like a map, you need to load everything
where I can find my answer. So now I made it two columns. So my answer is either
here or here now, right? Then you have a match. Next, if you look at quantity, my column is one, in this one. So if I press Enter, it is 76. If I want my revenues, my economists to right? So how can I make this flexible to get 1.2 based on quantity? Well, I can embed
another match formula. Let's do equal match here. Open parenthesis, lookup value now is
quantity versus revenue. Comma lookup array is
those two headers. So now it's either the first one or the second one, comma. And then we have zero for exact
match, close parenthesis. And now you have the second
mesh that will give you one to this one will
give you the row. So press enter 76. You change to revenue. You'll get your revenue.
61. S5 L10 Index Match Advanced (*****): Since you are more familiar with the index and
match formulas, I want to do something
more advanced now. And here I have country agent, then actual revenue,
actual profit, budgeted revenue,
and budgeted profit. And what I want to do, select actual versus budget. This, then revenue
versus profit, which is this one,
and then the agent, and get the corresponding value. Now, the challenge is actual and revenue are each one
in a different cell. So how to fix this? Let's find the
solution together. I'm going to show you
four ways to do it. Let's start with the first one. But before that, I want to
try to write the formula with index and match equal
index, open parenthesis. My array is my map. It is where I have all
my potential answers. So this is my map. Comma row number
depends on the agent. And we learned in
the previous lesson that we can use
the match formula. So here I have my lookup value, which is my agent. This is my lookup array. And then the match type is exact match, close
parenthesis, comma. Now here is where it
becomes more difficult because I need to know which column to
take the data from. So I can try to write another match formula,
open parenthesis. My lookup value here is a
problem because I have two. So I can try to do this one
and this one comma Here. My lookup array is also a problem because I
have now two rows. So logically I could try to take the two rows comma and then
put zero for exact match. Close parenthesis, press Enter. Here, you get an error. Why? Because if you see here, you do F9, it doesn't work. You have actual budget,
revenue, profit. It's not working well. Let's press Escape. And the match formula cannot
do something like this. It needs only one row or one column to try to
give you the index. So now one way we
can solve this, just come here and do this one with an
enzyme and this one. And then here we
can just drag it. And instead of these two rows, I can just select
this. Press Enter. You'll get 15. Actual revenue agent
three, that's your 15. But this is not a very nice
solution aesthetically, you are having more cells, more data for nothing. So let's try another way
with Control Shift Enter. So here what I'm gonna do is copy-paste the formula
control C Escape, go here, then up, we can just paste
it with Control V. And here what we can
do is the following. Instead of this, we can select this one and select this one. Now, if you remember, we have done this in
some occasions, e.g. with large in this course. And what we have done because the match formula
cannot take a race. We have done Control
Shift Enter. You'll get your results 15. So now you have the
curly brackets. And if I take this
and this one, F9, you can see that I
get actual revenue, actual profit, and so on. Let's press Escape. Now, if you have dynamic arrays, so you have the newer versions
of Excel, e.g. Office 365. What you can do is just take
this formula, Control C. Go here. You paste it. You don't need Control Shift, Enter, just press Enter.
You'll get the result. So that's easy. Now, if you have an old
version of Excel without dynamic arrays and you don't want to enter in this Control
Shift, Enter business. There is a way you can write
the formula without it. So let me show you how to do it. We take back this formula. Control C will go here. We paste it, press Enter, and now we're going to fix it. So here, as I told you, the match formula
doesn't like arrays. But what formula can take
a raise the index formula. So the index formula behaves
like to some products, like the aggregate formulas
and they can handle arrays. So now, since this is the case, let's try to convert
this using index. So index, open parenthesis. Here I have an array. My array. I can just do this one. And this one match doesn't
take it index, takes it comma. Here I have a problem. Row number. I actually
want to take everything. And this is a parameter
that you have to put. What do you do in this case? Let me tell you the trick. You just put zero
close parenthesis. We don't want to
touch the column. And now if you press Enter, you get your results. So what I have done, instead of putting this
like this on its own, I have wrapped them in index. An index can take it. So if you take this index
formula, you do F9. You can see that now you
get the right data points. And then when you have a match, you're looking for
actual revenue. You can tell which number it is. And that will feed into the bigger index formula and
you'll get your results. So let's press Escape. And I'll let you think
about it a little bit.
62. S5 L11 Lookup in different sheets with Indirect (*****): In this lesson, I
want to teach you how to write a lookup
formula that takes data from different sheets without having to rewrite
the formula every time. So for this, I have to
introduce you to a new friends, which is called indirect. So first let's understand
what indirect does. And then we can go
to our exercise. So here if I go and I write
indirect open parenthesis, I have two arguments. Let's focus on the RF texts because this is the
mandatory argument. Let's do in double
quotation, C2. Then double quotation here, close parenthesis, press Enter, and you get subscribed. Now you're going
to tell me why do I have to write this formula? I can just do equals s2
and I get my subscribe. But wait, let me show you the example down and then
you'll understand why. Now let's do Control Z. And let's try the formula here. Equal in direct
open parenthesis. This time instead of writing
in double quotation, I'm going to select the cell. Let's close parenthesis
and see what happens. You get to the channel. Now why? It is Because indirect is taking the content
of this cell, which is D3, and then
D3 is another cell. So it gives me to the channel. If I have C3 in
double quotation, I just get D3, which
is the content of C3. Now final one, if I do indirect open parenthesis
and select this one, close parenthesis,
I get high there. Why? Because this is great. Well, if you go to Formulas, Name Manager, you can see
that I have grid here. And if you see grid
refers to the same. So the same thing
is happening like what we saw in desert line. Now, let's do cancer. And let me tell you
what I want to do. What I want to do here is
that I have a drop-down menu. Using data validation. I have the names of sheets. So the sheets, if
you see are here. And I want to select
one of the sheets, select an agent here
again, data validation, write a lookup and get the sales of the agent from
the right Excel sheet. So from this one, from
this one or from this one, each sheet has the agents,
but different days. So now let's go back. And if I try a normal VLookup equals VLookup,
open parenthesis. My lookup value is
Agent two comma. If I want to select e.g. this table array comma two because this is
the second column. And then we do false. We close parenthesis. We get 33, which is this one. Great. But what about this 152? So now I cannot change
this dynamically. How to do this? Well, first thing we're gonna do is fill this table. Here. I have 0511. I want to come here and
pick it up from here. Then escape. We go here, we paste it. Now, if you paste
it and press Enter, notice how my
apostrophe is gone. So in order to get
back my apostrophe, I have to put it again. So I have two apostrophes. Press Enter, and now
I can just drag it. And here I want b, and here I want see. What I've done is
for every sheet, I have defined this range. You see the range
that we have here for my table array, every sheet. Now, if I tried to
look up the sheet name here and get the range,
Let's see what happens. I'm just gonna do
a VLookup here. Inside the VLookup. Select this comma, then
select this, and then comma. We want the second column and then an exact match, so false. And then I press
Enter, I get a value. Why? It is because Excel
gets this value here, but doesn't know
what to do with it. So I get an error. How to fix it. We can use our indirect friends. Now by using the
indirect formula, my VLookup will
tell me what sheet, what range to take
the table from. And then indirect. We'll just tell Excel that
actually this is not a value. This is arranged,
this is a table. So take it, press Enter, you'll get 52, less
change sheet 33. And here you get
63, which is H12. And obviously if I
change the agent, I'll get the right result. So this is how you can use indirect to be able
to specify a range, to look up the value.
63. S5 L12 Reverse Lookup problem (*****): Usually when we deal with
index and match formulas, we get a matrix like this one. We select our source
light source tool. We select our ingredients like ingredient two, and we get a. However, what if I have
the reverse problem? So I know my ingredient, which is ingredient three, and I know the value which is B. So I need to get my first sauce. And you can see that B is here, B is here, and B is here. So it makes it a bit
more complicated. Let's solve this together. I'm gonna tell you
It's like a positive. If you look at it
piece by piece, you're going to understand it. If you want to try to
do everything together, it's gonna be very hard for you. So let's start. First thing we're gonna
do is equal index. As we learned, we need an array. What is my answer? My answer is one of the sources. So I select my six sources. What is my row number? There is only one row, so that's the one comma. Now I need my column. In this case, it is
the first column. So let's put one close
parenthesis. Press enter. We get our source. But this is not dynamic. So what can I do? I can replace this column
one with the match formula. So much. Lookup
value is b comma. Where do I want to find b? Here, here, or here? That's the problem in this case because it's
ingredient three, I'm just going to hard code
this one. So it's here. And then cover my match
type is exact match, so zero, close parenthesis, press enter, I still get so S1. We made the formula a
bit more complicated. Now my issue is that I want
to try to select this one, not have it hard-coded. What to do? Well, if you think about it, we can use another
index formula. So here we put index,
open parenthesis. What is my answer now? It could be the first row, the second row, or the
third row in this case. So we select the
whole thing here. Karma. What is the row number
here in this case, because it is ingredient three, I'm going to hard code three. And then I'm going to put a
comma, close parentheses. Why am I doing this? It means that I want to
take all the columns. So whenever I take
the third row, it means I will
take the third row and all the columns
corresponding to it. So now press Enter. Again, you get source one. But now this one is hard-coded. How to fix it? Think about it in
a positive way. I can put another match formula. I know it gets
complicated because you have index inside it, match, inside it, index
and inside the match. So here, my lookup value
is my ingredients comma. Within my three ingredients, comma match type is zero. Close parenthesis, press Enter. So now you get the
answer that so S1, if I change my ingredient
to ingredient to, it becomes so six. If I change it to a, e.g. it becomes so stew. So now it's working. Let's try to understand
it from the point of view of ingredients
and a, this one. So if I go to the formula, the first thing that will get evaluated is this much, right? So we are trying to find the ingredient within this
array of three ingredients. Let's press F9. What you get, you get to, because my ingredient two is
the second line in my array. Now what are we doing? We are using index to try to find which line do I
want in this array. So here you have this line, this line, and this line. And here we specify two. So I'm taking all the
columns and this row two. If we try it out, we'll do F9. You can see e, a, f, d, CB, which is this one. Now that we have this, what are we doing? We have a match formula that is looking for a within this. And a is the second position. So if we just select
this and do F9, it is in the second position. And now you have a
simple index formula with row one, column two. What does it mean? It means, so Stu, this is how you are getting
the puzzle assembled one-by-one to be able to
solve this business problem. So let's press Escape
and please try this formula and see
how it works for you.
64. S5 L13 Complex Lookup with Index & Sumproduct (*****): This is another complicated
lookup problem. And what I want to show
you is that you don't have always to use match
with the index formula. So here's the situation. I have some clients here, that's how the data is. They come from
different countries and this is the
date I sign them. Now what I want to do
is select a client like this and get the
corresponding country. So how to do this? One? Let's solve this together. Let's see the formula. If we try with an index
formula equals index, open parenthesis,
what is my array? Is it this well-known? Because as we learned, the answer has to
be in the array. So the answer is either
Japan, France, or Columbia. That's my IJ. Now comma, what is my row number? There is only one row, so that's one comma
column number. Here is where it
becomes difficult. So either I have
column 12 or three. In this case, it is three. Now, if I try and match formula, my lookup value is
my client's comma. If I do this, I have a problem because match needs either one
column or one row. And here I have multiple
columns and multiple rows. So if I do comma, exact match, close parenthesis and
close parenthesis, I will get an error. It doesn't work. What is the solution? When we can use our old friend? Some product? Yes, some product with index. Because some product
can calculate. And at the end, for the index, I need 12 or three. Let's write the
formula together. Equals sum product. I will select my clients, equal client three,
close parenthesis. Now, if you press
Enter, you'll get zero. Why? We saw in another
lesson that you need to multiply this condition by one. So that's e.g. like this times one. Or what you could do is
put two minuses in front. So minus, minus means minus one times minus one times this. Minus one times
minus one is one. So it's the same as if
I multiplied by one. So let's press enter. We get the one here. We don't care about it. What we care about is what's
happening behind this. So if I select my
condition and press F9, you'll get a bunch of false. And here you have one true, which is where my client
is, client three. Because here for every
data point that you have, every cent, we are checking is the cell
equal to clients three? If yes, then it's true. If no, then it's a false. So let's press Escape. And if I multiply this by one, so F9, you'll get a
bunch of zeros and ones. Why? Because false is a zero
multiplied by one. It's zero through is the one multiplied by one is one, right? So press Escape. And let's try to understand
what's happening here. When every place I don't have
client tree, it's a zero. So 000. And here you have 00. This is client three, so it's the one and the
rest are all zeros. So I'm just gonna do like this. So you can see it.
Now, this is great. What do I need to do? I need to convert this to
a three. How to do this? If you remember, we have
our column formula here. If I do column and
I open parenthesis, select those three
close parenthesis. You get 234. This is if you have Excel
with dynamic array formulas. If you have older
versions of Excel, we have seen that
this is an array. So what do we have to do
is select the three sets, do Control Shift Enter. You'll get the same result, but with the curly
brackets here. And if you see this, I have 234. What I want for
Columbia is a three. If it's France, I want to
to Japan, I want to one. So what I can do, I can just add minus one, as simple as this Control Shift. If you have an old
version of Excel, otherwise just
enter, you get 123. And now let's multiply this
array of numbers with 123. So this one times my one. Let's fix the row because we
want to drag the formula. So we put the dollar sign here. Let's just drag it like this. And then like this. And you can see that I
have a three here. Now some product
will sum everything, all zeros and three. What's the answer? It is three. So let's try to combine
all these together. What I need is to take this
control C escape, go here. Instead of this one. Let's open parenthesis, paste
this and close parenthesis. So be careful the
minus one is inside. Because of the order of
preference in calculation, I want to do minus one to the
column and then multiply. So that's exactly
what we can see here. Press enter because
some product doesn't need Control Shift
Enter, you'll get three. Now what if I have e.g. client to which is
here, you get two. Great. And let's try client one. You get one. So that's amazing. Now we have this sum
product formula. Let's copy it. Control C escape. We can go here and remove this match formula and paste it. This will give me the
column I have to take. Press Enter, and you'll
get Japan for client one. Client who is friends, etc.
65. S5 L14 Xlookup (***): Let's say goodbye
to the VLookup, index and match
and all the hassle that we have seen in
the previous lessons. Because now we have
the x lookup formula. To get the x local formula, you need to have Excel 2021
and later, e.g. Office 365. It is also available
for web and for mobile. Now, what I want to
do here is show you the benefits of the x
lookup and how it works. And then we can recap everything with the
theoretical part at the end. So here if you see I
have a simple table. I have agent to add. I want to get the sales. So I'm going to do next
lookup, open parenthesis. The lookup value is the
same, it's Asia two. Now here is where you
have a difference. Now you have a lookup array before you had the table array, before you have done
like this. Now no. Now I just need where
I have my agent comma, then the return array. The return array is exactly the column where you
want to get the answer. So you don't have to select the whole range with some columns in-between
that you don't need. And what also you don't have to do is specify exact match. Because by default now
it is an exact match. They have fixed it from
the previous version where the default
was in the VLookup, if you remember, it
was approximate match. So let's close parenthesis. Press Enter. You'll get 28, which is here. Now, if I select agent 11, which doesn't exist here, you get an error before you would have to write if
error to fix it and so on. Now, if you put a comma, you have a parameter
called if not found. And if you put e.g. here, N a in double quotation, press Enter, you get an a. And here, if I go
select an agent, I can get the sales
of the agent. Now we go for left-click up. So before a VLookup would
not do a lookup to the left, only to the right. You have to use index and match. Let's try it with x
lookup, open parenthesis. This is my lookup value. What is my lookup
array? It's here. Cover my return array
now is on the left. No problem. Close
parenthesis, press Enter. You'll get 89. Number three. X lookup also
replaces the HLookup. So here I have agent one. I want to get the seas. No problem. Equal x lookup. My lookup value is ancient one. My lookup array is this comma, my return arrays, this one, close parenthesis, press Enter. You get 89 number
for two-way lookups. So before, if you want
to do two-way lookups, you had to use index and match. Now we can use x lookup. So first we have the agent, let's get the sales, and then we will fix
it to be able to get bonus of sales based
on your selection. So let's do equal x lockup, open parenthesis minus
Ka value is Agent one. You know the drill. This
is the lookup array. Then the return array
for now it's saved. So I'm just going to do like
this close parenthesis. This is my 89. Now, if I want to fix it
to get sales or bonus, what I could do
is the following. This array, I'm going to
replace with another x lookup. So x look up, open parenthesis. My lookup value is this comma, what is my lookup array? It is here, says or bonus. Remember index match, how
we used to look at it. This is the same thing. Then comma my
return arrays this. So now if I close
parenthesis, it will work. But just to explain to
you what will happen here in this x lookup. If it says, then it will return the full
column under sales. Otherwise, if it's bonus, it will return this column. This is the same
concept as much. You press enter,
now you have 89. Let's put the bonus. You get 63. Now let's go down and
let's do last two first. So we saw in one
lesson that VLookup returns the first
instance that matches. What if I want the latest e.g. here I have saved
from 2020, 2022. I want the latest for agent one. So here you have 89, but the latest is actually 27. So let's try to get 27 equal
x lookup, open parenthesis. This is my lookup value. The array is this one. Control Shift arrow down, comma, return array is the sales
Control Shift arrow down comma. If not found, I don't
want it match mode. Here you have exact match
and things like this. I don't want it comma, then you have search mode. You have search last two first. So you can select it,
you get minus one here. Let's close parenthesis. Press Enter. You'll get 27. Then we have approximate match. So here I have my
agents, my sales. And based on the sales, I want to give a bonus. So zero to 19 is
zero per cent bonus. 20 to 49, it's ten
per cent, etc. So now what I'm
gonna do first is to get the same equal x lookup, open parenthesis, lookup, value, lookup, array, return array. We know the drill now, close parenthesis, press Enter. Here you get 28. Just the format is
wrong, which is fine. What you can do is now add another x lookup at the
beginning open parenthesis. My lookup value is all this. So here it's my 28 comma
lookup array is now this one. Comma return arrays, this one. Then if not found, I don't care much mode. Here, you have exact match
or next smaller item. I can choose this one. And then I close
parenthesis, press Enter. And here, 28 is ten per
cent because it's 20-50. If I select e.g. agent one, you get 30%
because 89 is 70-90. So 30 per cent. So
here what happens? Let's take a T9. What we are telling
the extra cup to do is to look for HG19, or the highest value
that is smaller than 89. In this case it is 70. 70 gives you 30%, and so on. Let's go to wildcards. Now I have code, so Stefan Curry and I
want to get his safe. Let's write an x lookup,
open parenthesis. My lookup value is comma. This is my lookup array. Comma, my return array. Then comma, if not found, we're not going to use it. Then match mode. You have wildcard
character match. That's too close parenthesis. Now, if you press Enter, you get an error. Why? Because you did not
specify the aesthetics or the multiplication sign
before and after the word. If you remember one of the
lessons where we did this, you have to put this asterix
in double quotation. And after it, you can do
and double quotation, asterix, double quotation,
press Enter, you get 94. This is a wildcard match. So now let's go and
recap everything. So x lookup has
multiple parameters. Number one is the lookup value. What am I looking for? Lookup array and return array is where to look for the
data and what to return. Then if you don't
find the value, you can specify what to return. Then you have a match mode. So either an exact match
by default or exact match, or next smaller, slash larger, or wildcard, which we have
seen in the examples. Then you have the source mode. You can do first to last, last to first, unsorted. Now, if we look at the
advantages of x locale, it will return a
value if not found. You don't have to put the
formula automatically, it gets the exact match. So you don't have
to specify this. You can get approximate matches and specify larger or smaller. You can put wildcards easily. You can search in
different orders. You can search to the
left and the right. It will replace h lookup. And it also can
replace index and match by doing a two-way lookup.
66. S5 L15 Cool HR Dashboard with XLOOKUP (***): Let's have a bit of fun and
build an employee scorecard in a few minutes using our
knowledge of X lookup. Now, obviously you need an
Excel version that supports X lookup with dynamic arrays
that starts from Excel 2021. Now, if you see this
dashboard or scorecard, if you change the employee, everything will
update automatically. And here you have the employee and the people with salaries slightly above this person and slightly below this person. So now what I'm gonna do
is wipe out everything. And we're going to build
this from scratch. So here we go. This
is the scorecard. The first thing that
we need to do is get a drop-down menu to
select the employee name. To do this, we have to go to the employees in our database. But notice something. If I go here and do
Control arrow to the left, this database is sorted by
employee name and not salary. And if you remember in the other scorecards
that was failed, we need to have the people
that have salad is a little bit above and
a little bit below. So I need to solve this
database first by salary. So let's select column B. I still want the index to stay. So then we do Control
Shift arrow to the right. Under Data you have salt, and then you select salary. You do Largest to Smallest. Now you can see the salaries are from the highest
to the lowest. Next, let's just go back control arrow to the right
and do the drop-down menu. Here we will do list. Then select the list. We click here, Control arrow to the left,
select the firstName, Control Shift arrow down, and then you just press Okay, we go back with the arrow. Now we have our employee list. Let's select somebody
random, e.g. this person. The next thing we want to do is to get the date of births. So let's write the next lookup. I'm gonna write it here, equals x lookup, open parenthesis. My lookup value is
the employee name, comma, the lookup array. Let's go C, Control
arrow to the left. It is column B where you
have the names comma, and then you have
the date of birth column q2, close parenthesis. Press Enter. There you go. You have it. Now notice something here. I want sex and marriage,
your description. And I don't want to write
two more X lookups. So let's go back here. Control arrow to the left. You can see that
date of birth, sex, and marital status are
next to each other, column Q, R, and S. So what I could do instead
of writing another x Luca, I could come to this one
and then change this to S. So you remember when we
did Control Shift Enter in some lessons
where we had arrays. Here is the same concept. But because you have
dynamic arrays and this, we're going to see it more in the section that is
about dynamic arrays. But basically if I press Enter and I have Excel with x lookup, I can directly get everything. I don't need to write
other formulas. And you can see that
you have a rectangular, rounded that is blue. This is what the formula is spilling the rest of the data. Let's do the same for
engagement survey, employee satisfaction, and
special project count. Here equal x lookup. Then my value is this, my lookup array,
if you remember, the names are in column B. So B, column B comma. What is my result? My result, if you see
it is in column F, a, g, and h. So same concept. Instead of selecting one, I select three, close
parenthesis, press Enter. The results will
come in three sets. Next one is the salary. So that's a normal X
lookup equal x lookup, open parenthesis
lookup value is this. Now we gotta do BB Because
that's the column. What do we have the employee
names and then comma, we need the salary. Let's go get it. Control arrow to the left. The salary is column
here, k, I guess. Yes, column K,
close parenthesis. That's it. No need for exact match. As you know, x lookup takes
exact match as a default. So now we've got the salary. Performance is the same. Now, if you don't know
what is the performance, you can just do like this. Control F, we have
here performance. Let's find it. It's column. If you see
it, performance score. So we're going to use column a. Here we go. Same thing
equals x lookup. You select your name comma BB. You can see it in
the formula bar. And then my result
here is column E. So it's this one.
Close parenthesis, press Enter, you'll
get your result. Now, salary band is a bit of a problem because I have a
column with salary band, but it's not filled. And if you see I
have a table 0-68, slow, 6,200 medium, and
hundreds and more high. I need to fix this. It's approximate match. We can use x lookup again. Equal x lockup,
open parenthesis. My lookup value is not
the name this time. It is the salary. The salary was in
column K. I remember. Instead of making you dizzy, I'm just going to type it K2. And then the lookup
array is done. This is the one we do afford
because we're going to drag the formula comma the
return arrays here. Let's use a four. If you remember from
a previous lesson, we always take the smallest
numbers, not this one. Comma, if not found, I don't want to use it. Karma match mode. I'm going to use exact
match or next smaller item. This is why I am
choosing this one. So let's double-click. I get minus one. Close the parenthesis,
press Enter. You'll get high. Double-click, you get
everything you need here. Now we can use an x
lookup, equal x lookup. My lookup value is this. My lookup array is actually B. So the names comma, and then the return
array is this one, the one I just failed. Close parenthesis. This one is on
medium salary bands. Next, we need to get this table. To get this table, I want to get the index
of this employee. So here I'm going
to do an X lookup. This is my lookup value. My lookup array is again B. Now I need the index, so the index is
actually column a. So let's just select column a, close parenthesis, press Enter. So this one is hundred eight on the list in
terms of cellular. Based on this, what I
can try to do is do equal this minus one. So we can just do this and
copy paste the formula, or you can just
drag it like this. And that's fine. But the problem is, what if I select it, e.g. this one, you get minus one, minus two, minus three, and that doesn't work. So we need to fix this formula. So what I could do is
if open parentheses, this equation is
less than one comma. I want the space. Otherwise, I want the equation. So now let's try this one
and see what happens. You can see that this works. But if I drag it back,
it doesn't work. Why? Because here we are now
referring to this set. Blank minus one does
not work in Excel. So what we could do is
add an if error here. So if it's an error, value IF error,
we're going to put a blank close parenthesis. Let's drag it back. And it works. So now I can do the
same going up one because I might go to a
number that I don't want. But how can I know what is the maximum number of employees? Well, let's try it out. Let's do equal this plus one. So that's the basic
one that you have. No problem. However, if I want
to make it better, Let's do if API 16 plus one is bigger than the max
of my column a. So here I'm going to
get the max index. So if it's bigger
than this max index, I want to blank. Otherwise, I want
this formula to come. So we put it here. We can drag it. The problem will come. If I select the last one, e.g. you're going to see
a value problem. Again, same problem. Here. You have a blank plus one. So what we do IF error, open parenthesis,
that's my value. If it's an error, I want the
black close parenthesis. Then we drag it and we
get everything correct. Now let's get the names
of the employees. So here, no problem. I can use an x lookup equal
x lookup, open parenthesis. My lookup value now
is my index comma. Lookup array is my index column, which is column a comma. Then return array is the name and we know the
name is in column B. Now close parenthesis. That's very good. If I drag it like
this, I get a problem. So control Z. The other thing I
want to show you is that instead of
selecting one name, what I could do because
we have dynamic arrays, I can just select the
whole thing, press Enter. You can see that
now I get errors here and everything
gets filled in one go. Same concept. We are taking an array of numbers and doing
the calculation. Now, what do I do when
I have this error? Basically, I can use
the if not found. So comma, you can see I
have if not found here, double quotation, double
quotation, press enter. They are gone.
That's great for me. We can do the same for salaries. So what we could do is just
copy this Control C escape. We paste it here. It's taking the right thing. The only difference is that
it should return the salary. So it's column K. That's column k. You can see the salaries. Let's select somebody
in the middle to check. You can see that everything
comes correctly. So this is how you can
build the scorecard in very few minutes that can show your results in a very
appealing way to management.
67. S5 L16 Choose Formula and its applications (****): The choose function is one of those cool functions if you
know how to use it properly. Unfortunately, very few
people know how to do it. So what I'm gonna do
is explain to you what it does and show you the syntax. And then I prepared for
you three examples in Excel to see how to
use it in practice. So first we start
what is choose. Choose will allow you to select a value or
a cell reference, or a function from a list. So as you can see in the syntax, first I have an index number. If I put one, I'm going
to select value on that. You can see in blue, if I put two, it will
be value2 and so on. Then you have what
is called value. Actually it's not a value. It could be a value. And very importantly,
it could be a reference to a cell
or a cell range, e.g. A1 to A5. Or it could be a function. So let's see this in practice. I'm going to show
you how to refer to a function and
a cell reference. Here. If you see I have a table
with three years of data, sales data, some agents. And what I want to do first, create a data
validation quickly. So we just click, we
know the drill list. Click here, and select those
three years and press, Okay, we're gonna get 2019. And then what I want to
do is the following. Based on the year I select, I want to get the
average of the numbers. So 2019 is these numbers, 2020s this numbers, and
2021 is this range. So now let's try to write
a formula with shoes to be able to achieve
this equals average. Open parenthesis. Here is where I'm
going to put trues. So open parenthesis again, I have my index number. We are in 2019. It is my first column, so I'm just going
to put one now. We're going to fix it later on. Comma value one. As I told you in the PowerPoint, you can refer to cell ranges. So now if I refer to this, this is my value on comma, value two is this range. Value three is this range. Then you close parenthesis
and close parenthesis. The second time, you get 51.3, which is the average
of those numbers. Now this is not
dynamic because I'm choosing always the first
one, the first column. How can I change this one? Make it dynamic? Well, if you remember
our previous lessons, you can use a match formula. Because match, if
I take 2019 comma, I look for it here. So 2019 is column one, so it will give you 12,000.20 is 2.2021 is three comma
I want an exact match, close parenthesis. Press Enter. You'll get 51.3. Let's change it. You get another number. Now let's go one step further. I want to change the calculation also based on what
I select here. I want average,
minimum and maximum. Let's do a drop-down
menu, average, mean, max. We click here, we do a
list, select our data. Okay? And let's select
average for now. What I want to do is
modify this formula. So what I can do is put shoes at the beginning comma,
open parenthesis. Let's put one for now. Comma. This is my average
formula. Great. Copy comma. Let's paste it and let's
put minimum instead. Then at the end comma, let's paste it again
and put maximum. Then we can just close
our parentheses. And if you see, what I've
done is I have a formula. Now. I have a comma, the second formula
for value two, then a third formula
for value three. You can see it here. And here I have my truth. So now I'm choosing the
average function, right? So let's press Enter. This is my average. If I want to make this
dynamic, what should I do? Well, you have your
match formula again. So much open parenthesis. We select average within
those three values. So this is one, this
is two, this is three. Comma zero, close
parenthesis, press Enter. So now if I select the Main, it is three, which is here. The max, it is 90,
which is here. And even if I change to 2021, the max is A25. Now one more use case. Here. What I want to do is do an average depending on
the value that is here. If it's one, it's 202012. It's the last two years. Three is the last three years. So I'm going to start with one. And what we're gonna
do here is write a formula, average
open parenthesis. So we start with the cell
and then we do column. Instead of this E3. Let's delete it
unless you choose. And yes, you can use
tools like this also. Now, choose open parenthesis. Let's put this one and F4 comma. Then if it's one,
what does it mean? I want E3, E3 comma, if it's two, then
I want E3 to D3. And don't worry, even
if it's reversed, Excel, understand that it's
this three to a three. It's not a problem. Comma. Otherwise, I want from here. Now, I can close my parenthesis, close my parentheses,
and press Enter. If you see, because we have one, it is three, so one data points. Let's double-click. You get exactly
the same as here. But now if I put two, you can see that I get 28, which is 53 plus 3/2. And if I put three, you can see that I get here
the average of three numbers. So e.g. if we do the
average of this, this is 99/3, it gives you 33. So this is how you can
use choose to make some nice dashboards
and calculations.
68. S5 L17 Offset with Rolling average example (****): Offset is a very powerful
function in Excel, yet very few people use it. Basically, what it allows
you to do is to create a dynamic range that you
can use in your formulas. And this is very useful in cases where you want to do e.g. rolling averages. So let's look at the definition and the structure
of this formula. The definition is that offset, it can return the value of
a cent or a range of cells. And it has five parameters. Three are mandatory. So the first one
is the reference, which is the starting
cell or range. Then you have rows. Rows is how many rows
do you want to move? Up or down? Columns is the number
of columns you want to move to the
right or to the left. And then you have
height and width. If you want to have a
bigger array of numbers, you can specify height, which is how many rows
you want it to be, and width, which is how many
columns you want it to be. Let's go to Excel, because I think this
is the best way to understand this formula. Here. It's very simple. I have a few sales numbers. And what I want to achieve is get the average of
the last six months. The problem I have is
that every month you have a new data point and you don't want to change
your formula every time. So obviously I have to
use an average formula. But first let's use
offset to try to get the data for this
average formula. So I'm going to do equal
offset, open parenthesis. My reference is my
first set cover. Then, as I explained, rows is the number of rows. You want to move down. Now what I want to
do is to try to move to the last row we
have in the dataset. For this, I can use
a count a formula. So count a, open parenthesis. Let's select column B comma, then number of columns
I want to move. I don't want because I'm
at the right column. So zero. And then heights and weights. We're going to work
on them later on. I don't need them for now. Let's just close the
parentheses and press Enter. Here you get zero. Why? Because if we check this
count a formula, we do F9. You can see that
it's giving me nine. So press Escape and
count 12,345,678.9. That's correct. But we
are starting at cell B11. We are moving nine down. I'm reaching be ten, which is where I have
nothing which is zero. So what I could do is add a minus one here and I get seven. So now I started at this
said with my offset, I went down to this set. Now, what I want to do is
start using height and width. So I need to select
the last six months. So height of my array of
data should be six right? Now, if you put minus six, it means you want to
take six cells up. If you put plus six for height, it's six cells down. Then for weights, if you
have a positive number, you're going to go to the right. Negative number,
you go to the left. So now I press Enter and I
get my last six numbers. As you can see. Now, if you don't see this, it means you have
an older version of Excel without dynamic arrays. So what you could do is
just select your cells, go to the Formula, do Control Shift, Enter. And now you have
the curly brackets and you'll see the numbers. So now that I have the numbers, I can use them in my formula
here, equal average. Let's put one inside
close parenthesis. Then go here, pick
up my formula, control C without the equal. Go here and replace it. For me. I just press Enter. If it doesn't work for you, you just do Control Shift
Enter and it's going to work. Now, if I have
another data point, September 1 thousand,
you can see that now the average is
changing automatically. Let's see the numbers
that we are picking up. You can see it starts
now from 81,000. So the offset formula helped
me do the rolling average. So now imagine the
possibilities that you have with this offset formula, where you can calculate
different things in dashboard based
on user selection.
69. S5 L18 YTD Calculations with Offset & Sumproduct (*****): Some of you have to perform year to date
calculations at work, especially the ones
that are in finance. So let me show you
how typically people do it and the professional
way to do it. Here. If you see I have
quantity and price. I have it for 2020, 2021, and January 2022. So if we start by
year-to-date quantity, what people do is the following. First, they can do
equal this cell. Then if you drag it, you can see that
you have a problem. Because here I need to sum
this cell and this cell here, I need to sum those
three cells and so on. What people do,
they do a sum here. They open parenthesis,
and then they have column B2, close parenthesis. And obviously they
want the B2B fixed, so they'll put $1 sign here. Great. Let's just
drag it a little bit. You can see that the
quantity is increasing. This is fine. Now, if we go to January 2021, you have a problem
because you want the quantity to
start again at 701. What people do? They just come here, change the formula, press
and then you drag it again. You come to 2022. Same issue. You go and
you change your formula. That's very risky. Because number one, if
somebody else takes the sheet, the person might not know what's happening and drag formulas. And you'll have problems. To every January. You spend so much time
fixing all your formulas. Let me show you how to do this. The best way. What I will do is just copy
this Control C escape. Come here, paste it,
and press Enter. And instead of this, I'm just going to use offset. So here is my offset,
open parenthesis. My reference is this
set for January 2020, comma do I want to
move rose up or down? No. Because I'm at 18, I'm happy. So zero. Do I want to move
columns right or left? Also know, I'm at 18, I'm happy. Comma, what is my height? So how many rows or how many
cells do I want to take? Here? I want to take one, set, the cell with 18. And for the width is the same. I don't want to take
any more columns because for January
the number is 18. So I just put one
close parenthesis, press enter and get 18. Now, if I move like
this, here I have c2. And again, I'm not moving cells. So let's go back here. And let's think about it. What if I put zero
here? What happens? I get an error. Why
do I get an error? Because at least my range
should be one cell. So my height has to be one, and my width has to
be one at least. But what if I put minus
one year? What happens? Well, nothing. I still get my 18 if I drag it. Same thing, no problem. Now, here I want one set, the sum of this set. Here, I want the sum of
two sets, three sets. What is the formula that I can use to be able to change
this minus one to minus two, to take two cells here, minus three to take
three cells, et cetera. And then reset every January when there is a
formula called months. So if I change this and
I put months of a date, so there is a serial
number which is the date. This is January 2020. The month is number
one. So it's a one. If we press enter, we get 18. Let's just drag it. You'll see that it
starts working. So now if we just go e.g. on this one, we do
Formulas, Evaluate Formula. Let's check it out. Here we are in March. So that's the month of March. It gives you three minus three. So when you have minus
three, what's happening? You're getting B2 to D2
because here we are at DTU, we are taking a range of three
cells going to the left, because minus goes to the left, you evaluate, you
get the right sum. Now, if I go to January, I am good because this will
become the month of January. So it's number one. And then everything
works perfectly. Now I dragged my formula
and get my result. Now let's go back. Let's try four year
to date price. Now, year-to-date
price is a bit more complicated because
you need to have the aggregate revenues divided by the year-to-date quantity. The year-to-date
quantity is here. That's fine. So now you need the revenues. So here what we
could do is equal this times this,
that's a revenue. Let's get it for all the cells. Here, if I go back, what people will
traditionally do, they will do this
divided by this. Again, if I drag like this, there is a problem. So what they started doing is a sum open parenthesis before, column before, and then
close parenthesis, put $1 sign here. So now, if I just drag, you can see that the
price looks good. But in January, again a problem. So what people will do, they will adjust the formula, press and drag again. Come here, adjust the
formula, and that's it. And that's not very good. Now let's copy paste
this formula, control C. And here we just
come down Control V. I'm just going to move this to this quantity
to make it neat. Press enter. Now here I have a helper cell. I don't like it. So what is the formula that
will allow me to do, e.g. for the second
one, it will do 18 times six plus 446 times nine. And if we go to the third one, it will be for 81
times nine, et cetera. If you think about it, it is some product. So let's change this
to some products. And instead of this, I want to do this. B2 times B3 column
B3, press Enter. You'll get the right price. Problem is obviously when I
drag it, I have an issue. But what you could
do now is change this one with offset and
change this one with offset. The same way we did
it for quantity. Let's do it together. Offset open parenthesis. We are looking at
B2, B2 comma rows. I want zero rows, comma column zero,
columns, height one. And now the weights
is minus months. You open parenthesis,
select the date, close parenthesis,
close parenthesis. I press enter. I still get six. It's okay. Now let's do P3. So how do we do V3 offset? We start with B3. Come on. Rose is zero, column zero, height one, weights minus
months, open parenthesis. Select the date, close
parenthesis, close parenthesis. So here, if I just drag it, you can see that I'm getting the same
numbers I have here. What I've done basically, let's take an example. Here. We take the third month. We have an offset for this B2. So we can do F9. You can see that I'm
getting those three values. Why? Because we have minus
three for the month. So we're taking three values
back from here to here. And then the same thing
happens for this one, F9, we are taking 699. And then some product
will take care of multiplying this number times this number plus 446 times
nine plus 481 times nine. And these 13 is this easy-peasy. It works less press Escape, drag our formula,
and then it will work for every year
and every month. This is one use case where
you can use offset very effectively to save yourself
time and risk of errors.
70. S5 L19 Offset and Charts (****): It is time to use our offset knowledge to
create something cool. If you see here, I have a
simple chart, month's sales. It's plotted here. And what I want to do
is make it dynamic. So when I show it to management, they're going to see
this cool effect. And the cool effect will come
from a scroll and a zero. What does it mean? Basically scroll, e.g. if we start at January, if scroll increases,
it will just start at the different
months, e.g. apron. And then zoom is the number
of monsters I want to chart. So e.g. if Zoom is
four and we start at April and it will
show those four records. So now let's go and
do it together. First of all, we go
to Developer tab. If you don't have it, just go to File,
find the options. Then you have Customize Ribbon. You need to take
this Developer tab and then it will
come automatically. Then I want to do insert. Under foreign control,
you have scroll bar. So you have one like this. And then I can just
copy it control C, control V, and put it like this. Or I can insert it again. Same thing. Now, let's start
changing the properties. So right-click on the
first one, format control. And then here you
have a minimum value. And the maximum value. The minimum value is correct because if I don't want
to change monsters, I want to start at January. So I don't want to move. It's a zero. And the maximum we
got to put six. So I can start six
months after January. And that's it. Next,
we have certain link. So that's my son, Nick. Then press Okay. You are done with the first one. You can see whenever I move, I get here 34, et cetera. So let's go back to zero. Here we have the Zoom
right-click Format Control. Now, I want to show
minimum one months. So that's one and
maximum 12 months. So that's 12. Let's do
the send link also. Click press. Okay, Same thing. If you move, this will change. Now what I want to do is go to Name Manager and
create two variables. So new, the first one we're
going to call it scroll. And we're going to
refer to this cell. And the second one, new Zoom. And we're going to
refer to this cell. Why am I doing this? It is just easier when I'm
going to write my formulas. We have seen this in one
of the lessons before. So now I want to write
an offset formula using scroll and zoom to be able to pick up the
right range of cells. For my chart. Here, I'm gonna do
offset, open parenthesis. Let's do the monsters. We can do the same for sales. So monsters, I started January. How many rows do I
want to go down? This is where my scroll
comes into play. So here I have zero. It means I want to
stay at January, but I can go up
to six and so on. Now we select the scroll. You can see I click on it. I'll get scroll automatically. How many columns
do I want to move? I am a January. I don't want to move columns. So zero comma,
what is my height? My height is determined by Zoom. Zoom will tell me
how many monsters I want to plot in my graph. So let's start writing Zoom. You can see it here. Double-click. Comma at my width will
be one column always. So we put one close
parenthesis, press Enter. Here. Zoom is at three, and scroll is at zero. So scroll means I didn't
want to move from January. And Zoom will show three months
is now let's try scroll. If I move, you can
see now I've got FAB, three months is this one. If I change, I get four months. So that's great. Now
that I have this, I can do the same for sales. So instead of starting
at B3, I can be at C3. What I want to do is create two other variables
with this formula. And these variables will
be useful for my charts. So first, I'm just going to
copy this Control C, Escape. Let's go to Name Manager. And then let's do you. First of all, let's
start with the monsters. So X1, be careful
how you write it. You will need to write
it the same here. And instead of this, we can just paste our formula. We can change our B3 to
this just to be safe. So now we have the name
of the sheet and B3. Same formula. Press Okay, and now I
need for my y values. So y of n here, I'm just going to delete
this, base my formula. Now instead of V3, this is for my sales numbers. So I'm going to start here. I select C3, so I get again
the sheet name and C3. Press Okay, now we have x value and y value,
close parenthesis. Now it's time to
use those values, x value and y value in my chart. So we right-click on
the chart, select data. Here I have my sales, so edit. The name is okay,
the series value. I don't want this. I will
click on this one, delete S3. And here I'm going to do y. Be careful how you write it. Now let's press Okay,
added this one. Delete, click, select
anything here, the months, and then
we just remove b3, put x value, so that's
my second value. Now, what I've done is I put X value here and y value here. And those are determined by
offset formulas that I wrote. So if I press OK, you can see that now the chart is dynamic. Let's try. So here it starts with February. If I go back, this is January. We have four months is plotted. If I move, you start
seeing how it's moving. Let's go back. If I click on the Zoom, you start seeing more
months as being plotted. If I move like this, then it starts moving. And you can also click on the chart on your own and try to scroll and the zoom and see what data is
selected for the chart. This is how you can apply
offsets to make dynamic charts.
71. S5 L20 Multiple Matches (*****): What we have seen so far with lookup formulas is that
they return only one match. What if I want to return
multiple matches? This is what we're going
to see now in this lesson. So here I have a list of countries and I
have the clients. Whenever I select a
country like France, I want the clients that
corresponds to France. Same thing for Japan, and so on. Now let me show you Brazil. And if you see what I have here is basically the row
where we have the client, so 59, et cetera. And I have the list of clients here using a simple
index formula. This is what we're gonna do now. I'm just going to
delete everything. And let's start
again from scratch. So the first thing
I want to do for my index formula is to try to know where I
have received here. So let's use the match formula. Equal match, open parenthesis. My lookup value is Brazil. Let's choose a four, because we're going
to drag comma. What is my lookup array? It's column a comma. I want an exact match, close parenthesis, press Enter. So that's great. You get the first one
which is in row five. And if you drag it down, you will get five everywhere
because it is static. So now let's change
this column a, so it's not static. So instead of column a, what we could do is
use an offset forward, offset, open parenthesis,
my references A1. Let's do a four comma
number of rows. I want to go down for now because we are
at the first one is zero comma number of
columns we want to move. I don't want to move columns because I'm in the
country column ion fine. So zero comma, what
is the height? Here? I'm going to
put 1,000 just as a big number to be able to ensure that I cover all my data. We're going to fix this later. Comma. And then the width is
one because it's one column. And then we close
parenthesis, press Enter. So I still have my five. Double-click. All of them are still five. Here it is still static. Because what is happening
is that I am starting at A1 and I'm moving zero rows. What I want ideally is I find my first
Brazil at row five, then the second one. Whenever I'm looking
for the next Brazil, I start at row six. Look for it, find it here, then start at row ten, find it, then start at row
11 and find it. So to do this, what we
could do is use this one, which is the previous
value and press Enter. So here, there is nothing, it means it's a
zero double-click. You can see that I see a change. Because now if we
look at this formula, what we are doing
is we start at A1, but we are going down
five rows, 1,234.5. We start here now we
find Brazil and so on. The only problem though is that the second one is a draw
nine and then row ten. So here I have 4.1.
Why? Because what is happening is in this, we are starting
here and Brazil is the force record starting
from this range. And for me, I want it
at the ninth record. What I could do is add
plus the previous one. Press Enter. And now if we drag, you can see we get 910.11. Why? Because now what we did is
here we added five to it. So now the fourth
row that we found, that is five or more. And then you get your nine. Now that I have this, I have some errors. So I can do IF
error, that's easy. If I have an error, I can just have a blank. Now, double-click. We are good. The only thing I
need to change is this 1,000 because
it's hard-coded. I don't like it. What you could do is count
a and select column a. So now at least what it will do, it will count the number
of records you have, and then it will ensure
that you're always safe. So press Enter. You can see that now
you are always safe. Here you have like ten records. So it will always
take ten and go down. Now that I have this, let's use an index formula. D array is the array of clients. So I can select it like this. Come on, the row number is here. Then we close parenthesis. We don't want the column number. Press Enter. You have client three. Double-click, you have problems. So here you can
put in a formula. If e.g. this one is different
than nothing, you do your index, otherwise, you put a blank. You can also use if
it's blank, same thing, close parenthesis, double-click,
those are my clients. Let's put Japan. It will work also. So this is how you can
return multiple matches.
72. S6 L1 Intro (material in Project section AllToDo, AllCompleted): We are now at the six
parts of this course. We're going to learn
the essential tools to deal with texts. We start off with Flash Fill, which is not a formula, but it's a feature
of Excel that will allow you to do
text manipulations. And you're going to see
that you don't always need a formula in Excel. The second part is
about formulas like proper upper and lower to
change the case of a text. Then we're going
to look at options to be able to join
texts together. The fourth part is about
formulas like left, right and mid to be able
to extract part of a text. Then we will see two
formulas, text and value. They will allow you to
convert a number to a text and give it
a specific format, and convert a text to a number. The sixth part will be
about social and find. And here you will
see that if you combine them with
other formulas, you'll get fantastic results. After that, you have the
substitute function, which will allow you to
replace a text within a text. And finally, we will look at a common problem when you
download data from systems. And you want to perform
some lookup on this data. So are you ready
for this section? Let's go.
73. S6 L2 Flash Fill (*): This is a small bonus lesson before we deep dive
into texts formulas. So what I want to show
you is that you don't have always to write a formula. You can use a ton of things
in Excel and save time. So what we're going to see is flush here my first example, I have some full
names and I want to separate the firstName
and lastName. I can do module and
then go back to Mario, double-click, you get
Mario everywhere. But if you click here and you do flash fill, the magic happens. Now we can do the same
for the last name. So here we write Marino. Then we go back control E. That's the shortcut. You get all the family names. Now notice one thing. This approach is not dynamic. So if something changes here, you have to do the steps again. But if you need to separate the data or do something quick, take this data and use
it somewhere else. This is a great use
case for Flash Fill. This is better in
my point of view, doing texts to column
and things like this. So now let's do the email part. So here I'm going to do Module
dot Merino at desk.com. This is the format. Now, if I go to the
second line and do V, You can see that
automatically Excel recognizes this and
proposes Flash Fill for me. So if I press Enter, I get all the emails in one go. This is amazing right? Now let's go for proper case. So if you see here,
Marino is small letter, the v is small letter. Here. I have a crazy thing
here. All our capital. If I want to fix them all, instead of typing them manually, what I could do is
type the first one, Mario Merino Excel will
understand what I'm doing. And then you can just click
on it and then go under Home. You have here flashed fail, you get all of them. That's another way
to do Flash Fill. Now here I want to
get the initiatives. So m n. Let's write M M, and
then let's double-click. And here we can do flash flood. You can see that Excel
did not understand. So my N, N was not enough
for Excel to know what to do except just sold that I'm taking two times the
first initiative. So what we can do
is give it a bit of help and do VR
here, press enter. In my case, it automatically
recognize the pattern. So that's good and
change them all. If it doesn't, what you
can do is just do this. And then you just select
the first to double-click. And then you can do Flash
Fill and it will fix them. Now let's go to male and female. So here it's m For made. If I go back and do Control E, Excel did not
understand what I want. So again, what I can do is put another M here and
it will get fixed. So this is how you can
use Flash Fill to do some manipulation with text
in a quick and easy way. The only thing I
have to warn you about is that you have
to do it next year data. So e.g. let's say I
want to fix this. If I come and write module here and I go and put control E, you will get an error because Excel doesn't know
what you want to do. So make sure you do
it next to your data.
74. S6 L3 Changing the Case of Text (**): This is another lesson about
capital and small letters. And this time we're
going to use formulas. If you see here, I have some data and it's
in pretty bad shape. Some letters are
capitalized sum naught. And what I want to do is
try to clean this mess. So the first thing I want to do is get rid of the extra spaces. You cannot see it here. But if I click on Will Smith, there is an extra space. You can see it in
the formula bar. If I look at Angelina Jolie, we have two spaces between Angelina Jolie and
that's not good also. You can even have spaces
before the first name. So what we're gonna do is use the Trim formula to fix this. So trim, as its name suggests, will cut the extra spaces. So equal trim, open parenthesis. Select Will Smith, close parenthesis, press,
Enter, double-click. All the extra spaces are gone. Only one space is left
between each word. So now that we have
removed the extra spaces, let's convert everything
to uppercase. And as you have guessed it, the formula is upper. So equal upper,
open parenthesis, select your text,
close parenthesis, press Enter, double-click. Everything is in uppercase. For lowercase, it's
the same concept. The formula is lower. Let's select the data, close parenthesis,
double-click, we are done. The last one I want to
show you is proper. This is a formula that
very few people know. Basically, if I want to
have the first letter of the name and the
family name in uppercase. The rest in lowercase. I can use proper, equal proper open parenthesis. Select your text,
close parenthesis. Then you double-click. You can see the W and
the S are in uppercase. Now, obviously I can
combine those formulas. So instead of doing
trim and then proper, I can do it in one go. I was just showing you
step-by-step how to do it here. So I can do equal proper
open parenthesis. Here. I'm gonna do trim,
open parenthesis. You select your original texts, close parenthesis,
close parenthesis. So first it will trim, then it will do proper. You get the same result as here. Double-click, and there you go. Then I want to
show you something that is not related to formulas. You can use font, do uppercase. So here e.g. I. Have a font
called copper plate Gothic. This one, whatever
you write, it, will come in uppercase anyways. And you don't have to limit
yourself to this font. You can go to those websites. And on this website you can find some additional
fonts to download. E.g. if I go to the font.com, this is the website. If you do top, you
can get some fonts. Be careful. Some are free, some you have to pay. But lemon milk, e.g. is capital letter. B bus newer is also
capital letter. So you can get them
and use them to get uppercase directly without
needing a formula.
75. S6 L4 Concatenate Text (**): Sometimes in Excel, you need to aggregate pieces
of texts together. In this lesson,
I'm going to show you different
methodologies to do it. The first one, if you have an old version of
Excel, you can use it. It is D concatenate formula. If you see here it has
texts as parameters. But the problem is twofold. Number one, if you
have texts in, let's say, A1, A2, and A3 in those three sets, you will need to select
each one on its own. That's very cumbersome. The second one, if you have a delimiter between your text, like a space, you will have to specify the space
as a parameter. So e.g. you will do
cat as a first text. Then the second one will be the space in double quotation. And then the third one
would be dog, e.g. the next one we're going
to see is the answer. This one, as you can
see in this example, you have dog and then you have
space in double quotation. Then you have the end and cat. And I use this one when I want to do something
quick and fast. The third one is conquered. This is a function that
came in Excel 2016. What it does basically, it tries to remediate one of
the problems of concatenate. So now if you have
data in A1, A2, and A3, you can select the range altogether.
There is no problem. The problem that remains though, is that if you have a delimiter between your texts like a space, you will have to put
it as a parameter. So it doesn't help too
much to be honest. And finally, you have
texts the joint, which came in Excel 2019. This one is great because one you can define a delimiter to put between the
different pieces of texts you can
ignore and T-cells. And then you have your text. You can select multiple
cells. That is no problem. Let's see this in the
Excel sheet and practice. So here we have two examples. The first one, I
want the full name, first name, middle
name, and last name. And the second one, I want the full address from
address city and country. Here. I want to separate by a
comma here via space. So let's start with
the concatenate. If I write concatenate, you can see it, it's here. The first problem I
have with this formula. I cannot select, dislike this. If I press Enter,
I get an error. I have Excel Office 365. This is why it's a spill error. But if you have an
older version of Excel, you will get a different error. So what I have to do is
select the first one comma, then double quotation space, double quotation
comma, the second one, comma double quotation
space double quotation comma the third one. You see I cannot select
all of them and I have to put the space as a
parameter, press Enter. It works. Now, obviously, any formula I can double-click and it
will drag down no problem. But here I want to show you the different ways
to concatenate text. The second one is the ends. So I select the first one
and then the same drill. The only difference
is that it's with and you can see
how I'm doing it. It's a bit cumbersome,
and that's it. The third one is to use
the CONCAT formula. Here. If I do concat and
open parenthesis, obviously now I can
select this together. But the problem is that I
have this with the spaces. So now instead of doing this, I would have to do the same
as this one, Control C, Control V. And here instead of concatenate,
you have com cats. But it's the same drill. Honestly, I don't
use conquer too much because it's
not very helpful. So you can see you
get the result. And lastly, we have
texts to join. You open parenthesis. You first put your delimiter. So here, double quotation space, double quotation comma, ignore empty cells here I'm going to put through,
I don't care. Then comma, Let's
select my text. Close parenthesis, press Enter. It's done. It's
quick, it's easy. Now let's do the same
with the address. If I start with
concatenate first, I select this comma. Now I have to do
double quotation. Comma space, double quotation. You see how difficult that
becomes with a comma. Comma. Now, you select
the second one. Then comma saying, I don't know how many times I'm saying come up with these crazy. Let's close parenthesis,
press Enter. You'll get it. Then if you
want to do with the end, it's also very cumbersome
if you have three of them. So now you do like this and you select the
second one another, and then you do the same. I hope I don't make a mistake. And then you have this one, press Enter, you'll get it. As we said with CONCAT, the problem is the
same as concatenate. If I select them, I won't have a delimiter. So I will have a problem here
and I will have to do it the same as the
concatenate formula. And finally, we have my
favorite detects join, which is equal to texts, the join, open parenthesis, the delimiter you just put
at one time, like this. So comma and space
between double quotation, then come a, ignore empty cells. I don't care. I'm gonna
put through comma. Let me select my range of cells, close parenthesis, press Enter. You double-click, you get
all of them automatically. So based on your Excel
version and your needs, you can use one of
those formulas.
76. S6 L5 Text Extraction (**): In many cases, you
will have to extract something from a text and
use it for your analysis. This is why the four
formulas that I'm going to show you are
really important. And they are the
bread and butter of text manipulation
and extraction. So the first one, we have seen it in the
lesson before briefly. It is the left
function. Basically. You give it a text, you give it a number
of characters, and it will return the leftmost characters
from this text. So e.g. if the number
of characters is three, it will give you the
first three characters that you have in this text. The second one is right, it's exactly the opposite. It will give you the characters
from the end of the text. So if you have three, It is the last three characters that you have in your text. Then you have something
in the middle. So the MID formula, it will take a text, you will specify a character to start extracting
something from the text. And then you will say
how many characters you want to extract. We're going to see this in
practice in the Excel sheets. And finally, you have
the Len function, which will tell you how many characters
you have in your text. And this one combined with other functions will
be very powerful. So let's go and try
these formulas out here. If you see I have some phone numbers and I want to extract
the country code. So it's always three digits. So I can use my left formula
equal left open parenthesis. This is my text number
of characters is three. Close parenthesis. You have the first
three characters, and then you
double-click, you get it. Now let's do the number. So the number is the last
four characters that we have. Now, we use our
right formula here. So write texts, comma four, close parenthesis, press
enter 2005, it is correct. Double-click, you get it. Now what if I want to get
the numbers in the middle? Now let's see what it starts. Five is 14 is two. The age is assert. The dash counts is
the force character. So it starts at a fixed
character, right? So let's go here. Equal MID, open parenthesis. This is my text comma. Then it starts at
the fifth character. So five comma, number
of characters is three. So three characters you
have close parenthesis. Press Enter, you'll get 984. Perfect. But now you're
telling me what if I don't know how many characters
I need to take e.g. here, I want to extract all
the numbers after triple a. How to do this? Well, we can combine the length formula
with the MIT formula. So let's do it. Equals MID open parenthesis. This is my text comma. The start number is
where triple a is three. So my start is at four, always, if you can see it for the
number of characters here, I have one, here,
two, here, three. So I cannot put it manually. What can I do when I can
use Len of this text here? Close parenthesis,
and then do minus. Always triple a is
three characters. So I can remove three. Then I close parenthesis. What happened here? Basically here I have
four characters. I remove three, so I take one. In the second example, I have five characters. I remove three, I take two. Here I have six characters. Remove three, take three. So now we get the six. Double-click. You get all the
numbers after AAA. Obviously here
triple a is fixed. So if it was also variable, we have to do more manipulation to be able to extract
these numbers. But in this case, it works. In other lessons,
we're going to see something a bit
more complicated.
77. S6 L6 Text & Value (***): Let's look at two useful
formulas in Excel. They are actually the exact
opposite of each other. So you have value and texts. If we start with text, it will convert a number to text and give it a
specific format. Here the first parameter is
the value or the number. Then you have the
format that you want. Now trying to find
the format that you want is not that easy. But I'm going to show you
in Excel how to do that. The second one is to convert
the text to a number. So you give it a text, it becomes a number. Obviously this text
has to be all digits. So let's go to Excel. This is the situation. We have some barcodes and
we want to normalize them. What we want to do is have five digits for every bar code. If you don't have a digit, it will be replaced by zero. Now to write our texts formula, we need a format. These are the symbols that are mostly used for formatting. The most important
one is the zero. So zero means if
you have a digit, the digit will appear. If there is no digit, you will see a zero. And this is exactly what
we need in this example. The other ones that are used are the dots to four decimal places. So e.g. if you
want to have 3.00, you can use the dot. And then you have the ads, which we're gonna see in a bit, which means just display
the text if there is a text and the hash sign. The hash sign means an
optional character. So why would we use an
optional character? Let me show you if we take
this one and then we go to home under this
arrow is click number. And then we go to
custom formatting. You can see that there are a
lot of formats with hashes. Now the general format
will appear like this. If you use 10, it means that you need to have
at least one digit. Here we have more. This is why it doesn't change. As I showed you the dots, if you put two zeros after, I don't have anything here
after the decimal point. So what will happen? I will see zeros. And then you have
our famous hash. So our hash, what
it does because I want to have a comma
here, separator. I want to tell Excel if the number is less
than four digits, just showed a number
and it's fine. If it's more than I want
to put a comma here. So this is how you can
define your format. Try to play with it. Now in this exercise, what I will do is equal
Text, open parenthesis. This is my value comma. This is the format. Now, I have to do
double quotation, five zeros because I want to force zeros if there
is no character. So we just do double quotation, close parenthesis, press Enter. And you can see we
forced four zeros here. Now if I drag it, you can see that wherever I have characters, they'll appear. Otherwise, it's zero. Now let's use the value formula. Equal value, open parenthesis, this is my text. Then I close parenthesis,
press Enter. I get back the values
that I have here. Now let me teach
you one more trick. Here. Let's do a simple sum. And let's select those numbers. Close parenthesis, press
Enter, you'll get 176. Now if your boss wants to
put saves in front of it. So what you will do
usually is right saves. Then let's do a space, then double quotation
and the add sign, press enter, and you get this. The problem with this one
is that now it's a text. So if I do e.g. this one
times five per cent, I will get a value error
and this is not good. So what I could do
is the following. Let's remove this. Let's keep it as a sum. And what we will do, we will change the
format of the cell. So for this, we will
use custom formatting. Now, custom formatting is outside the scope
of this course. But let me show you a quick
example how it works. So here we click again, we go to number costume, and we will define a format. The custom formatting
works in this way. First you have positive
number format, then negative number format, then the zero format
and text format. All of those are
separated by semicolons. So what we will do, we will select a format for positive numbers
like this one, e.g. then here before it, let's do double quotation. Says double quotation. Then you have this format. So semicolon. Let's copy this. We will select a format
for positive numbers. So Control C, control V. Now we are doing
negative numbers. So let's put a minus
here in front of it. Then we have the format of zero. So for me it's just
a zero, it's fine. And then semicolon, you
need to format of the text. For this. I'm going to use this ad
that you have seen here. So it's a text placeholder. Let's put the ad, put. Okay, and now what you can
see, sales hundred 76. Now, obviously we
could fix the format and put a space, doesn't matter. The most important
thing that you have to see is that this is a
normal sound for Excel. I have written my son with
this text and the sun. And as you can see, if I use this cell and multiply, do some operations,
it will give me numbers and the
value error is gone.
78. S6 L7 Search & Find practical application (**): Search and find our
two formulas that will allow you to search for
text within a text. Now the way it works is that if the formula finds the texts
that you're looking for, you will get the character
at which the text starts. If you don't find the text, you will get an error. Now the difference
between the two is that search is not
case sensitive, but finds is case-sensitive. Other than that, it
is the same syntax. So the first parameter is the
texts you're looking for. The second one is where
to search for this text. And the last one, which is an optional parameter, is at which character should I start looking
for this text? So if you don't specify this, it will start from the beginning
of your text and search. Now I prepared a cool example. Let's go to excel
and try to solve it. So here this is a common
situation where you have some e-mails and you want
to get the user names. So how many of you
have started deleting the ad desk at
hotmail, et cetera. It's not a good practice. Let me show you how to do it. So here I'm going to
use the search formula. Let's try it out. Equals search, open parenthesis. What should I find? If you noticed all of
them have the add sign. I should search for the ad. So here in double quotation, we have the comma where within this text
and start number, I'm not going to define it because I want to start
from the beginning. So close parenthesis,
you get 13. Let's double-click
13, 14, 11, etc. This is the character at
which you have the Add. Now given this information, what I could do, Use the left formula to take all those certain
characters, e.g. let's try it out. So here,
left open parenthesis. My text is actually this one, comma, the number of characters. We can take the result
of this search function, which is 13 in this case. So let's close parenthesis here. Press enter, double-click. If you see all of them
have the add sign. Why? Because this formula
is returning the character at which
this add sine starts. So if I want to take
everything before the ad, the only thing I have
to do is come here, put minus one, so we
take one character, Let's double-click and
I extract my usernames.
79. S6 L8 Combining Search & Find with other functions for powerful results (***): Building up from the
previous lesson, I want to show you the
power of search and find when you combine
them with other formulas. So the problem statement is, I want to know which
user is using Hotmail. Here, what we're gonna do
is try a search formula. So let's look for Hotmail
in those e-mails. So equal open parenthesis. Find texts in double quotation. Hotmail, come on within text. This is my texts and
the start number. I don't want to do anything. So let's close
parenthesis. Press Enter. Click. If you noticed, the only place I have hotmail will
give me a result. The other ones are errors. What can I do here? Well, I can wrap
this in is error. If you remember this formula, I can do is editor,
open parenthesis. And then here we
close parenthesis, press Enter and double-click. You can see that all
of them are true. It's an error minus this one. What can I do now to make
it nice aesthetically, I can use an if statement. So here I can put if
open parenthesis, this is our test. So if it's an error, it means other user comma. If it's not an error, which means I found something. We can say Hotmail user. And let's put the H and
capital double quotation, close parenthesis, press Enter, and then you double-click. You can see that this
one is a Hotmail user. So as you can see, this is the power
of social find. If combined with other formulas.
80. S6 L9 More Complex example with Search/Find (****): I hope that you like the
previous two examples. Because now we're going to
do something more complex. But don't worry, if you
understand the fundamentals, you will be able to
follow very easily. So what I want to do
now is get the domain. The domain means I don't
want the user's name and I don't want this.com.e.br
and so on. So let's start. The basics are to use
a search formula. So here equals search,
open parenthesis. I'm going to look for
my ads because I want to try to cut desk.com, hotmail.com, etc, from
this whole thing. So I'm going to do add in double quotation comma within
this text start number. I don't want to touch
close parenthesis, press Enter and double-click. Here. I'm getting 13, 14, 11, and so on. Now, if I want to get this part, I might use the right formula. So let's do right
open parenthesis. Here you need the text, that's my text, comma. This is the number of
characters my search, the results of my search. So let's close parenthesis, press Enter, and
then double-click. Now here you have a problem. Why? It is because
my search going from the left and telling you
that at, in this case e.g. is that character 13. But my right is taking 13 characters from the
right going backwards, which means that I have
a conflict, right? So how to fix this conflict while we could use
a lens formula? So then, let's select this
one and close parenthesis. Here you have 21. So the search is returning 13. This is a total of 21, which means that I need eight characters and I can
get rid of the username. So let's add the lands
here before the search. And do Len of this
minus the search, you get your desk.com. And let's double-click. Then we are good. So now if I want to
get rid of this.com, what do I have to do? I can use a left formula. So let's do left
open parenthesis. What is my text? My tax is actually
what we have here, which is the result of this
crazy formula that you see. So that's fine. We have it comma,
how many characters? This is where I can use
another search formula. So here, search, open
parenthesis, find texts. What do I need to find? If you see I need to
find the dot, right? So double quotation dot, double quotation comma
within text, what text? The text is. Again, what I have here, which is the result of
this crazy formula. So let's copy this formula. Control C, paste it here,
and close parentheses. And then we can just close and other parenthesis to make
sure everything is correct. Because the last parenthesis
has to be black. Press Enter. You double-click. You still have this dot here. So what I need to do is
take one character or less. So let's go here. Do minus one. Be careful where you
do the minus one. I did it after the search. So it will do the search
and subtract one. Let's press Enter and double-click and you'll
get your result. So the formula looks crazy. But actually if you
assemble it the right way, you can get your
results very easily.
81. S6 L10 Substitute (***): So far, in this section, we looked at formulas
that can find texts within text
and then extract it. But we didn't look at any formula to replace
a text within a text. And this is why you have
the substitute formula. So if we look at the
syntax of this formula, first of all, you
have your full text. So this is the whole
texts that you have. Then what do you
want to replace? So that's the old texts with what do you
want to replace it? That's the new text. Then you have an
optional parameter, which is instance number. So assume that what
you're looking for is available in this text
two or three times. Should I replace
the first instance, the second instance, the
third instance, and so on. Then you can specify this. If you don't specify it, it will replace the first one. Now let's go to Excel with just a quick example
to see how it works. Here we go, we are back to
our phone number example. What I want to do is here
is my extension 2005, etc. And you have a dash next to it. Instead of a dash, I want to replace it
with another symbol. And this will make it just
a bit easier to read. So let's just do this. And in the next lesson, I'm going to show
you how you can use substitute in an example
that matters more. So here, what I need to
do is equals substitute. Then what is my text? This is my text. Comma. My old texts is the dash. This in double quotation
comma my new text, I want to use this symbol. And then we do double
quotation comma. Here, I'm going to use the
instance number because if you see I have two dashes
in every phone number, I want to replace
the second one. I'm going to put a two
close parenthesis, press Enter, and then you
double-click. And here you go. You have fixed your
phone numbers.
82. S6 L11 System Data (*****): Let's resolve the
problems that you might encounter whenever you apply
lookups on system data. So data coming from system. So here I have a bunch of codes and I want to get the
corresponding items. Let's try our VLookup here, equals VLookup,
open parenthesis. This is my lookup value, comma. This is my table. F4 comma, the column is two, and then we have false
close parenthesis. You get an a. Let's
double-click. And then you can see
that I still have an a. Now, why do I have this NA? It is because you have spaces
before and after the code. So if I select this, you can see that
this is my space. What to do in this case? Well, you can use
our trim formula. So here I'm just going to put
them in front of the quote, close parenthesis, press Enter. It works like a charm. Double-click, you
get your answer. So now let's just
copy paste this here, put it here, and double-click. You can see that it
works sometimes, but sometimes it doesn't. And if I just click
on the formula, it looks okay to me. No. What is the problem? Well, there is another type
of space that trim does not remove and this face might appear when you download
data from system. Let me show you the
space it is here. So what we're gonna
do is to try to understand the difference
between those two spaces. So Control C, escape. I'm going to paste
this one here. Let's go get the other one. Control C escape. Paste it here. If I press Escape, I wrote here a
formula called code. It will tell me what
is this character. The one that trim
removes is called 32. The one that trim doesn't
remove is one-sixth. So here I can do the
opposite of code, which is unica,
open parenthesis. Select your cell, and then
just drag it to the next one. And you can see that
I have nothing here, but actually the
spaces will appear. What to do now with this 160 when you can use your
substitute formula. So let's go here.
Inside Premiere, we can use substitutes. The text is the same as the
old texts is uni card 160, close parenthesis, comma, double quotation,
double quotation. And then the instance number. I don't want anything. So let's close parenthesis, press Enter, and
then double-click. You will get your result. That's great. So now we can apply
the same numbers. So here I can just
come and do equal, trim, open parenthesis,
substitute. Let's select our number, gamma unica, 160 for all texts. Comma double quotation, double
quotation for new texts. We don't want the
instance number, close parenthesis,
close parenthesis. And then if you
see now it's good. What I can do is transform
this to a number so I can use our value
formula, close parenthesis. Now it's a number. Double-click. You can do the sum
at the bottom. That's great. Now I'm going to teach you how to do all this in one step. First thing we're gonna do is take this formula control C, S, K, go here and paste it. Now, instead of just having
the formula for one cell, we can just do like this
and select all the cells. Let's press Enter. I get all of them
fixed in one go. Now I get this because I
have Excel Office 365. So I have dynamic array
formulas, which is great. If you don't have them, just select your forces, go to the formula and
do Control Shift, Enter, and you will
get the same results. Now, I can wrap this
formula into a sum. So let's just copy this Escape. Go here, paste it, put some around it. And here I'm going
to press Enter. If you have an old
version of Excel, just press Control Shift Enter, and the magic happens. So you have it in one step.
83. S7 L1 Intro (material in Project section AllToDo, AllCompleted): We are at Section seven of
this course, date and time. Here it is an easy section. However, you will have a lot
of formulas to deal with. So first of all,
we will start with some basic date
and time formulas. So you get acquainted
to this concept. Then we will look
at Flash Fill and especially how the format
of the date works. Once you understand the
structure of a date, all the formulas will be easy. After that. Too useful formulas
today and now to get the current
date and current time, the force part is about
extracting information from data. So we will look at
formulas like here, months, our minute, et cetera. Then end of months is a very important formula that will allow you to calculate
the last day of the month, the first day of the month, and the first day of the year. So we will see how to do that. But six is for those of you who work in
project management, project planning, and logistics. So you have to set some
deadlines to deliver items. We will learn formulas that
will help you do all this. And finally, we will apply our knowledge for more
complex scenarios. So I hope you are ready
for this section. Let's go.
84. S7 L2 Dates Basics (*): Let's start with
basics about dates. And here it is very important
to understand this concept because everything
that will come later on will be
way easier for you. So once upon a time, on one January 19, hundred times started in Excel. What do I mean by this? Basically, this
is the first date you will encounter in Excel and everything else will be measured relatively
to this date. Excel is very good at
recognizing dates. So when you type
a date in a cell, it will automatically
assign the date format. Now when it doesn't work, you can try using date
value and time value as formulas to convert
your text to a date. And it is very important to understand what's
behind a date in Excel. Basically, behind the
date, there is a number. So dates are numbers for Excel. So now if I go and
check out one, January 19 hundred, this is one. This is the first day for Excel. And every day that passes, it will be added to it. E.g. to Jan 1,900 is two. Let's do a bit more complex. 23 April 1983, it's 30,429, which means that from
one Jan 2019 till this date, 30,429 days past. Now, what about time? Basically if we go now to known, known is half a day, right? So what happens is
that you will have the same number, but 0.5. Now what about 06:00 P.M. 06:00 P.M. is three
quarter of a day. So the same number, 0.75. Let's go to Excel and
try a few dates there. Here I added Sheet1 and
let's type one Jan 1,900. As you can see, Excel, we'll change this to a date. You can just go
there to check it. And you see in costume d, d, m, M, m and y, y. So let's press Okay. And if I convert this to
a number, I click here. You can see the
famous number one. Now, if I come here
and I do 2304, 1980s three, it will also
understand it's a date. This time it shows
this format for me. That's great. Cancel. If I click here, I get the number that we
saw in the PowerPoint. Now let's type this number for 29.75 and let's
see what happens. So if I go and
convert it to a date, I can select a date, e.g. let's say this one. Anything will work.
You can see that here. I get the 06:00 P.M. that we discussed in the PowerPoints. Last two things I want to try
is different dates format. So if I do 230-41-9803
with dashes in between, it recognizes that it's a date. And if I do 23, dash zero for slash 1980s three, again, exert, recognize
it as a date. So as you can see, Excel is pretty good at
recognizing dates.
85. S7 L3 Flash fill & Format (*): Now that you know
the basics of dates, is time to show you a little bit how formatting
works with dates. And also how you can use
flesh Finn to save time. Because you know me, I like to work
smarter, not harder. So here I'm going to
type three, April 2008. We selected. We go here, number under Home. Click and you can see
that it's a date. Let's go to custom. Remove this. And you can see here the sample, it shows you the format. If I do 1D, you get the three, which is the day in this date. Obviously, if it was
23, you'll get 23. If I do Tuesdays, you have a zero forced in front of every number below ten. So that's why you have 033. This is the day of the
week, so that's Thursday. You can see how it writes it. For this. It will write the full Thursday
and five d's and onwards. We don't use, Let's
try the m1m is four, which is the month. Again, if the month is 101112, it will appear m, m is zero for it will force a zero in front of the month
if it's less than ten. Triple M is April 3 letters, four amps, April full, and five. Ems is the letter a. Now let's try the year. One. Y will be 082. Y's is the same. Three, y's is 2,008.4, Y's is the same. So now I can define a
format of my own. Dd. Mm YY, and here you go,
you have your date. Now, I'm going to
drag this down. And you can see that there is
one day extra in every row. Why? Because if you click here, I have filled series. If you do copy cells, it will be all the same date. Now you have other options here. You have filled days,
which is the same. It will add one field weekdays. If you see here between
11 and 14th of April, the week and this
will not appear. Then you have filled months. One month will
increase every line, and then you have fill years. One year will increase
with every line. So this is how you can use Flash Fill to create
dates very fast.
86. S7 L4 Today & Now (*): Let's open our Excel on dates, and let's go to 07.04. And I want to teach you two important functions that you will use when using dates. The first one is to
get the current date. So the formula is today. Don't forget to open
parenthesis, close parenthesis. You don't need any parameter. Press Enter. You'll get today's date. Now, if you want to
add the time to it, the formula is not time. It's now. So now open parenthesis, close parenthesis, press Enter. And you can see that here. I have 07:41 P.M. if you
don't see it in yours, you can just go to
the format and go to this costume and add
here column S, S. Let's press Okay. The only problem with
these two formulas is that anything you do in
Excel, it will update. So e.g. if I put 78 here, you can see this updated, this one also updated, but we are on the same day. So this is why you
don't see a difference. And every time you press
F9, it will recalculate. If you don't want
it to recalculate, you just select them. Control C, E, S, V. You paste them as values. And now they won't
change anymore.
87. S7 L5 Date fields extraction (*): Now that you worked with
today and the now formulas, it's time to learn other
very easy formulas to extract information
from a date. So the first one is
to get the year. So equal year. Just select your current date. Close parenthesis, press Enter. You'll get it very easy. The second one is
months. So just months. Select this. Enter your done. The day is easy to remember. We select this one, enter the hour, now, it's hour. But if you select
this current date, which comes from
the today formula, you press Enter,
you'll get zero. Why? It is? Because the Today formula
assumes you are at midnight. So to fix this, you just go here and just
select the null formula, which is what I call
current time here. Press Enter. You'll get it for a minute. You have to write
minute, not mean. Mean is the minimum. We select the null formula, close parenthesis, press
Enter and 4 s, it is. Second, not sac. You can see seq is a
mathematical formula. So second, Let's
select this one. Press Enter. And now
if you press F9, you can see that the seconds
are updating automatically. Because my now
formula is updating.
88. S7 L6 Get First/Last day of the month and First day of the year (***): What is e or months? Basically, E or months
is end of months. So this is a formula that
returns the last day of the month based on a date and the number of
monsters you require. To understand this better. Let's look at the syntax
and the parameters. The first parameter
is a start date, which is the date
that you specify. And the second one is monsters. So to understand monsters, let's take an example. If we have one April 2020 and the number of
monsters is zero, it will give you the
last day of April, which is 30th of April 2020. Now, if you specify
months as one, it will go for the next month and give you the last
day of the next month, which is 31st of May, 2020. Now if you go negative
and you do minus one, it's going to go one month
backwards and give you the last day of last
month and so on. Now, unfortunately, there is no formula like B or months
beginning of the month. So we have to be creative to get the beginning
of the month. That's enough for explanations. I think we should
go to Excel now. Here, I want to do is first get the last
day of the month. So that's easy. We just saw it. So E or months, open parenthesis, my start date. I can select any of
those to this one. Let's say number
of months is zero. Close parenthesis. Press Enter. You'll get 30 November 2022, which is the last
day of this month. Now, the first day of the month, we have to be
creative, as I said. So what we're gonna do is do the same equal E or
months, open parenthesis. This is my start date. Now instead of zero months, Let's do minus one.
What will happen? You get the 31st of October, 2022, which is the last
day of last month. Now, if you remember what we did in one of the
lessons about dates, one day in Excel means plus one. So what I can do is add one to this formula and then I get
the 1st of November 2022. Now let's get the
first day of the year. So equal and of months. Same formula. My start date is the same. Gamma. If I go back 11
months is because we are in months 11,
what will happen? You get the 31st of
December of 2021. Let's add plus one. Now. You get the first object. That's great. But I hardcoded 11. And this is not good practice because what if now
we are in December? How can I get the
first day of the year? So what I could do, I can replace this 11
by months of the date. The mass will give me 11. And then it will do the mass. If we are in December, the mass will become 12. It will go backwards 12 months. Last day of last year. It will add plus one
and give me 1 July.
89. S7 L7 YearFrac (**): Year frack is another
useful date formula. So what does your fraction do? Basically, it will give you
the percentage of a year represented by the number of whole days between two dates. So if we look at the syntax, you have Year frack, start date, which
is our first date, and date, which
is our last date. And then you have this
optional parameter, which is called basis. And here you can choose
how to calculate. Now the one that I
prefer is option one, which is actual number of days over the actual number of
days that you have in a year. You have some others option too. I don't like because it
assumes the year is 360 days. Option three also, I don't like because the
year is 365 days. But what if the
year is 366 days? And then you have option zero? And for both of them will
assume that a month has 30 days and the ear has 360 days and perform
the calculation. But there is one
difference between them. The difference is how they treat the last day of the month. Now, for european, if you start or end on the 31st of the month, it will assume the day searches and do the math for the US. If you start uncertainty first, it assumes that
the day searches. But now if you and uncertainty first and your
start is less than 30, it will take the first
of the next month's. Otherwise, it will assume
is the 30th of the month. So these are some
technical details. What I advise you to do, one, you want to use this formula
and not have problems. Just use option one. It's so easy and it's accurate. So let's go to Excel
and try it out. Here we have the
percentage of the year. We are on 24th of November. So let's use Year frack, equal Year frack,
open parenthesis. Our start date is here. Cover. The end date is here. Cover. Here you choose
your famous basis. I'm gonna choose option
one, close parenthesis. Press Enter. You'll get 89.6. I think this is how you
should use this formula and not worry about the
other ways of calculation.
90. S7 L8 Workday & Workday.Intl (***): If you work in
project management, project planning,
or in logistics, and you need to
define deadlines. You are lucky because they are two sets of formulas
that will help you. In this lesson, we're going
to check the first one. And what I have is
some tasks name, I have started date, number of working days, I have a list of holidays, and I want to define
the deadline. So let me take this four here, put it in this set, and then let's learn
this new formula. It is called Workday. Open parenthesis. You need a start date. This is our start date, number of working
days. This is the one. And then you have the holidays. They are optional, but here
we have three of them. So we select them and we do
a four, close parenthesis. Press Enter. You
get tense of John. Let's come together. So the third of John
is the start date. It doesn't count in the formula. What counts is the force of j. So that's the number
one, then number two. What about 6 June when it shouldn't count
because it's a holiday. Sevenths of Jan is
day number three. Saturdays, Sunday are off. And then the tense
is the fourth state, and that's how you
get ten of Jan. Now what I'm gonna do is
put an equal sign here, select the deadline,
drag this down. And then here I'm
just going to copy this Control C Control
V, double-click. And then we get our results. Let's take another
one to understand it. Then solve Jan, six days. It will give me 18 soft Jan, tens of John is here. It doesn't count. So 11 is the number one. 12th is the number two. 13s is day number 314 says
For week and weekend. Number five, and the
18th is the sixth day. But now you will tell me what if my weekend is not Saturday, Sunday when you have
a sister formula? Workday International. So this is how you write it. If you go here, you can see that the third parameter
is the weekend. So let's put a comma here. We come here, we
delete this comma. You can choose
your weekend here. So assume my weekend
is Monday, Tuesday. I'm going to select option
three and then press enter. We can just double-click
to get the new dates, but let's investigate this one. So here we have the third
of John for four days. Third of jenn doesn't count. Force of Jan now is
a weekend because my weekend is Monday,
Tuesday doesn't count. The fifths is the number one. The six is a holiday day. Number two, number three, and the ninth is my force day. So this is how it
works basically. Now you can use this to set deadlines when you are
producing monthly reports, e.g. so assume that I need to produce a report every force
working day of the month. So here if you see
I have Jan 2022, but the date is
one of June 2022. Same for FAB March and April. So I can use my formula, equal work day,
open parenthesis. My start date is this one. Comma number of days is four because it's the first
working day of the month. Comma, those are my holidays. Let's select them. F4,
close parenthesis, enter. So the first one has to
be on the seventh of Jan. Then if you drag this
87 March and April, so you don't have to
do this manually. You can just use this formula.
91. S7 L9 Networkdays, Networkdays.INTL + Changing holiday list (****): Let's go to the second
set of formulas that are important if you're working in project planning or logistics. So here I have the
reverse situation. I have my tasks. I have the start date
and the deadline, and I have my holidays here, but I don't know how many
working days each task takes. So here we're going to
use the other formula, equal network days, open parenthesis,
UNI, the start date, it's here, comma and
date it's here comma. You need your holidays,
they are here. Let's do a four
close parenthesis. Press Enter, and then
you just double-click, you get the results. However, did you
notice something? Here? I have three Jan
then Jan, five days. If I go back to the previous
lesson, the region, then John was the
normal working day without the special weekend. And I have for this why? It is because Network Days takes to start date and end
date when it's counting, whereas Workday doesn't
count the start date. So this is why you are
getting one more to fix it. What you can do is add a
plus one to the start date, and then you double-click. You can check the sum
of this is 39 days. If you go here, the sum of this is 39 days. So now let's go to the international
version of this formula. So here I can do the same dot int and then I will have an
additional argument, which is the weekend. So here I add a comma, go back, delete this, put the comma, and you have the
rest of weekends. In this example, I'm not
going to change the weekend. So let's use
Saturday and Sunday. We can use one, press Enter, and then
you can double-click. You get the same
results because by default it is Saturday, Sunday. Now let's do something
a bit more fun. I have two countries here. I want to change the holidays based on the selected country. Because if the project
is done in one country, it will have different holidays. If it's not in another country, the holidays will change. So I'm just gonna do data
validation here quickly. We click here list, and then we select
our two countries. And now we have Country 1.2. Let's keep country one. But let's think how can I change my holidays here
to make it work? Let's delete this. And the formulas are, if you remember,
the lookup section, it is index and match. So here, index,
open parenthesis. You need your results, your results are here. So we select those. Let's do a four
comma. Now which row? The row, I want all of them, so I will put nothing
and put another comma. And you need color. If I want country one,
it's called the one. Country two is column two. Which formula should I use? The match formula? So much? This is my
lookup value comma, my lookup array is
those two countries. Let's do F4. F4 here also. Then let's do comma, exact match, close
parenthesis for match, close parenthesis for index. Press enter. Now you double-click. And here, let's see you
have 39 working days. If I do contrary to, then you will see you
get 38 working days. Why? Because there is
one more holiday here, which is 5 June. So you're gonna get a different
number in the first one, you can see three versus four. So this is how you can
combine formulas in unexpected ways to get very
flexible analysis in Excel.
92. S7 L10 Weekday & DateDif (**): Let's look at a couple more
formulas related to dates. I know there are a lot of
formulas related to dates, but you need to know
the fundamentals if you want to do stuff that
are a bit more complex, like what we will see in
the next couple of lessons. So the first formula
is weekday, week day. We return the week day
given a data as input. And this is a numerical value. So it has two parameters. The first one is the serial
number, which is the date. And then you have return type. If you select zero, Sunday will be a
one, Saturday seven. And obviously you have the
weekdays in the middle, then you have 11 means
Monday is equal to one, Tuesdays two, etc,
and Sundays seven. So you choose the
one that you prefer. And obviously you can tell
me I can use formatting, transform the data into
a weekday and I'm done. But it's not always a good
practice because sometimes you want to combine this formula
with something else. And it's better to use
the weekday formula instead of just masking
the date with something S. The second one is date
dif they they've simply gives you the difference between two dates without
excluding anything, holidays, week, and nothing. It has a start date, which is the first
date you have. It has an end date, which is the second
date you have, and it has a unit. So D is days. But I don't use the
D because I can just subtract the end date minus the start date and
get the same result. What might be more useful
is M or why it will tell you the number of
differences between the two dates or the
number of years? The other three, I don't use
that much, which is e.g. we can ignore years or months
when we do the calculation. Now let's go to Excel and try
those formulas out. Here. If you see what I've done is I added deliverable due
date to our project. And what I want to do is
calculate the day still do. So that's very easy. You just do equal the due
date minus the current date. Press Enter, you'll get 363. Now how many work they still do. Here? We can just use the
network days formula. So equal network days, open parenthesis, my start date, comma, my end date. No holidays. So we can close parenthesis. But now what I like to do
is to augment this by one, augment the start date by one y. You can look back at
the previous lesson about network,
this network days. We'll count the start date as one and the end date as one. And I think that it's
not fair to do that. So this is why I'm adding one to have one less working day. So you can check this
lesson and you will see why I'm doing
this in more details. Press Enter to 59 days. The day of the week we
have our new formula week. The serial number is this
one, comma return type. You can see there
are so many of them. I'm going to use this option to get Monday as one
and Sunday as seven. Close parenthesis. You got five. Why? Because the 25th is a Friday. Now let's calculate the number
of months has remained. Here. We will use our date
dif here in Excel. Something is weird. They differ is actually
the only formula I. So if I open parenthesis, it doesn't show me
the parameters. Maybe there is a bug. I don t know. So here you have
to remember what's inside. This is my start date comma, my end date comma,
I want monsters. So that's an m in double
quotation, close parenthesis. You get 11 months. Now notice that it
will always truncates. So if I just change the
format, it's 11 months. But if I put 25th
of November 2023, it becomes 12 months. Now let's do Control Z and try the years equal date,
diff, open parenthesis, start date comma, the comma
y in double quotation, close parenthesis,
zero year also, because we don't have a
year between the two. But once you put e.g. 25, November of 2023,
you get one year. Now if I put 26th November, 2023, nothing will change here. It will just add in
the other formulas. This is how you can use
those two formulas to get some more information
about your project.
93. S7 L11 Count Fridays between 2 days (****): Now that you are familiar
with the date formulas, Let's do something a
bit more complicated. Here what I want to do is count the number of Fridays between the 6th of January and the 21st of January,
end of the day. Here, if you see we
have three Fridays. Now there is no formula that will count the number
of Fridays for you. Unfortunately, we have
to be a bit creative. Now let's start with counting the number of days
between those two dates. So what I can do equal
this one minus this one. So 15 days, that's fine. Now, think about a
formula that you can use that can count days between two dates and
remove some days. What do you think it is? It is network days that
we saw in this section. So if I use network this normal, it will remove
Saturday and Sunday. But what do you have as an alternative to
remove other days? You have network
days international. So now we're going to write equal network dot international,
open parenthesis. My start date is the six comma. My end date is the 25th. That's fine. Weekend now, if you see option one
is Saturday and Sunday, but if you scroll down, you have Friday only. So we can select options. 16 can just type it. And then I don't
have any holidays. I just close parenthesis
and press Enter. So now we counted the
number of days between two dates and the number of days between two dates
without the Fridays. So should I just subtract them? But if you see here, 15.13 will give me two. But I actually have
three of them. How come? Well, let's try a small exercise to understand
what's the problem. Instead of this, I'm just
gonna do three John. And I'm going to do six. Jen. If you see 3-6 jam, I have no Fridays, right? So there is no reason why
this formula will give me three and this formula
will give me four, right? Well, let me explain to you. For this formula. Three Jan starts at zero-zero, so midnight and then it will
count the third of Jan, the force of John, 5 June til midnight,
which is the six. So that's three days. The other one, it counts the
start date and end date. This is why you have one extra. Now to fix this, if I want to take the 25th, I can just add plus
one here and get four. So now let's go back and
put six of Jan, 21 of John. You can see if I do 16 -13, you get your three Fridays. Now I can get the full formula, which is this one,
control C escape. I can paste it here. And then we have
minus this formula. So Control C escape. I will come here
minus this formula. That's your full formula to get the number of Fridays
between two dates. Now I've done it for Friday's, but you can do it for
Thursday, Wednesday, Tuesday.
94. S7 L12 Define a custom weekend in Networkdays (*****): I'm going to teach you one of my favorite tricks with
network days internationally. In this lesson, we're going to learn how to define
our own weekend. And to do this,
we're going to do it with a very easy example. So you can apply it
to whatever you want. Here. I only work Monday,
Wednesday, and Thursday. And we're going to
take only the force to the 8th of April
with two holidays, 7 April and the 14th of April. So first of all, let's
use the network days and we have a start date
and end date comma. Let's select our
holidays and press F4, close parenthesis, press Enter. Great. You get four days. How? Let's count together. The force of April is one day, the fifths is another day. The sixth is a third day. The seventh is a holiday, so I don't count it. And Friday is another day. So that makes it for. Now, let's use the
international version so I can add a weekend. So dot international. And here as we saw, if we put a comma, we can get all the options. The problem is my
weekend is Tuesday, Friday, Saturday, and Sunday. But I don't have
this option here. So how to do it? Basically,
let me teach you the trick. You go here, you do double
quotation or double quotation. Inside it. It's very simple. Every day, that
is a working day. You will put a zero. Every day, that is a
weekend. You will put a one. So Monday I work. Right. So that's a zero. Tuesday, I don't work. That's the one. Wants their work 0
h they I work zero. Friday, Saturday, Sunday. Either work, press Enter. You get two working days. Let's come together. Monday, I work, right? It's one working day. Tuesdays of doesn't count. Wednesday I work. Second working day, Thursday, I work, but it's a holiday,
so it doesn't count. And Fridays weekend for
me, so doesn't count. So you get two working
days at the end. So you can use this trick
to define your weekend and make network days international work with any type of weekend.
95. S8 L1 Intro (material in Project section AllToDo, AllCompleted): Formatting section is a small but cool section
where you're going to apply your knowledge
from this course to give a bit more
punch to your reports. So what we're gonna do is first apply formulas in
conditional formatting. See how this works. Then we will look at a
formula called mode. It looks like a useless
formula at first. But you can see the power
of it in real life. When I'm talking about mode, I'm not talking about
the mode that we saw in the statistical
section of this course, which was returning
the number that is the most prevalent
in my dataset. And finally, we're going to
look at the cool example, where you will be able to color the cell in a matrix
based on your selection. So are you ready
for this section? Let's go.
96. S8 L2 Conditional formatting rules with formula (****): One of the things that people
struggled the most ways in Excel is to apply formulas
in conditional formatting. So this is what we
gotta do right now. I have here a bunch of students, their grades, and I want to color every grade
that is above 70. Let's try to do it together. I'm going to select the grades, conditional
formatting, new rule. Use a formula to determine
which cells to format. We click here, select my first cell bigger
than E two. Press enter. Then choose your format. I'm going to choose this blue
with some fonts in white. Press, press. Okay, nothing happens. Now, if I change this 17 to 18, suddenly all of
them are in blue. Why? Let's understand together. So control Z, what
I'm gonna do is go back to Conditional
Formatting, Manage Rules. Double-click here. Copy the formula. Press Okay. Press Okay. Go here and paste the formula. Let's press Enter and then double-click and see what
happens in the first one. If I click 17 is
not bigger than 70, which is why it's false. Now let's go to the second
one where I have 79. 79 is bigger than 70. But once we click
on the formula, you can see that it's
still pointing to 17. Why? It is? Because when you wrote
the formula there, when you click on the send, automatically Excel put the
dollar signs in front of it. So when you drag it
down, it doesn't work. Now, let me teach
you a few things about conditional
formatting and formulas. First rule, formula
that you will write will be for the top
left cell in your range. So in this case, this is my range. The top-left cell is this one. If my range was this, my top-left said is John. So you need to
keep this in mind. The second thing that
you need to know is that once you write the formula
for the top-left cell, you need to imagine
that you are dragging the formula for the
rest of your range. In this case, this
was my formula. This is how it's
dragging and this is why I'm getting this
disaster was all false. Now, let me teach
you best practice. I don't go and write the formula in conditional
formatting directly. Know what I do is that I
write the formula in Excel. I drag it, I see how it works. And then I copy paste
the formula there. So in this case, we need to drag it, right? So let's select this and
press a for a few times. And here, I don't have dollar
signs anymore for before. Press Enter, double-click. You can see that now
I have some truths. So the formula works, right? So now what we do, we take the first formula, which is for my top-left
cell in my rage. Control C, escape. Let's select my cells. Conditional Formatting,
Manage Rules. Double-click. We go here and we
paste the formula. So the difference is that I don't have anymore
the dollar signs. Press. Okay. Press Okay. Now it's working perfectly. You can see that those
two cells are in blue. Let's do a second example. Here. I want to color the student and the grade if they are above 50. So what do I do? Basically, as I told you, this is now my range. I have to write a
formula for John. So let's write the formula here. Then we can copy paste it equal. Now, we select the cell
bigger than this 50. 50 obviously has to
have dollar signs, so F4, we have to fix it. But now what do I
do with this B6? Let's press Enter and
see what happens. So that's false. That's fine. 17 is less than 50. Now the formula will be dragged automatically
to the right. So if I do this, I get a true because
this be 16 has moved and I don't want be 16 to move This
way to the right. So what I have to
do is just fixed my B with $1 sign, keep my 16. And now let's drag it this way. You have a false. Let's drag it down. 79 is bigger than 52 tools. We drag it down one
more. It works. Let's just drag it down. You can see that
everything is great. So now I can just
copy this formula. Control C, Escape,
select my whole range, go to conditional
formatting. New rule. Use a formula, paste it here. Let's go to format. This time I'm going
to use this color. And for fonts, I'm going
to use bolt, press. Okay. Press Okay. You can see that
those are in bold. That's great for me. Now a third example, I want to compare the
sales versus targets. And I want to color the
ones that are above target. In any color, we will
choose one of them. So here, my range is what? This is my range. I need a formula for this one, equal this bigger
than my target. Here. I don't need
to do anything because this will move
and this will move. Let's double-click. You can see that it's
working perfectly. Now we just take the first
one, control C escape. We select our sales conditional
formatting new rule. Use a formula based
on rule format. Fail. This time, I'm going to choose this color and I'm gonna
keep everything the same. Press OK, OK. You can see that those
are colored in green. Those are the best practices to apply formulas in
conditional formatting.
97. S8 L3 Boring Mod used in a Powerful way (*****): In this lesson, I want to teach you how you
can take a formula that might look useless and transform it into
something more powerful. This function that
we're going to focus on is the mode function. It is MOD, and it
is different than the mod function we saw
in the statistical part. The other one was an ODE. And what it does, it will tell you which number comes the most in your dataset. This one, what it will do, it will check if a number is
divisible by another number. If not, how far away is it
divisible by this number? So it has two parameters. The number, then the divisor. So let's look at examples
to understand it better. We're going to start with to as a number and two as a divisor. Now, two is divisible by two, which is why you get zero. But to understand it, let's think about
it as an equation. To equal two times one plus 00 is the result
of this formula. Now what about 3.23 is
not divisible by two. So three equals two
times one plus one. Your result is 14.24 is divisible by 24 is equal to
two times two plus zero. Result is 05.25 is equal
to times two plus one. Result is one. Now we go a bit more
difficult, 1.3. The way to think about
it is that you have always to look at the
number that is below, whatever you have as number. So in this case, one is
equal to three times zero, which is zero plus one. So the remainder is one. This is what you
get as a result. Last one, negative numbers -1.3. In this case, you
cannot do three times zero minus one.
It doesn't work. You have to do three times
minus one is minus three, plus two, it is minus one. Now if you look at this formula, you will tell me what
can I do with it? This is why we're
gonna go to Excel. And I'll show you how you
can use it to its potential. I am so excited about this concept that I prepared
three examples for you. The first one is about shipping. So here I have some items
and I want to see if I ship them in packs of
six or four or three. And I want to minimize
the remainder, because the remainder
I might have to throw. What we will do is
use our formula. So equal MOD open parenthesis. This is your number comma, you need your divisor,
which is here. So I'm going to use a
formula that we saw in the text section,
which is right. This is my text, comma one. I take the rightmost
character, close parenthesis. Close parenthesis here you get one because 11 times six is 66, the remainder is one. Now, I need to drag the
formula this way and this way. So to do that, let's look
at this VServer t. Here. I don't want to move columns. I want to move row. So I'm going to
put $1 sign here, and here it's the opposite. I can move columns but not rows. Let's put the dollar sign here. Press enter, and then
you just drag it. You just drag it down. And you can just do
the sum at the bottom, some of this close parenthesis, press Enter, you
paste the formula. And as you can see, back of three is my best option. Let's go to example number two. In example number two, I'm doing a report. I have two metrics. The first metric I want
to show every month, the second metric I want to show every X number of months. And here you have
your parameter. So if I put four, you can
see how it is changing. How to do this. Let's do Control Z
to go back to three. And let's delete the formula. I'm gonna do like this. Let's think about it. I want it every three months, which is in March, which is in the
middle of the year, September, and then December. So if you think about
it, it's months 369.12. And all those are
divisible by three. The remainder will be zero, so the mode will be zero. Let's write a mod formula equal
M or D, open parenthesis. So that's my number one. I can extract the months
from this date, right? Months of this date,
close parenthesis comma. And then I need my divisor. My divisor is this one. We need a four here because we're going
to drag the formula. Then let's close parenthesis. Here we get one. Let's double-click. You can see that we are getting
zero every three months. So now I can use any formula if. The mode of all this is
equal to zero comma. Then I need to get
my value from here. So let's do it. We need an HLookup, H lookup. This is my lookup value, the date comma that
they will erase this. Just going to select it. Let's use a phone here. Comma, the row indexes to false for exact match,
close parenthesis. Then we do comma value. If false, I don't want
to show anything. So double quotation,
double quotation, close parenthesis, press Enter. Now we double-click. You can see that the value is
coming every three months. The only problem I
have is that I want the value to come
in January and I don't want to fix
only this formula and then somebody drags it
and I have a problem. So what I can do is added
or condition here and say, these are my mode is
zero or my month is one. So here I can do or
open parenthesis. Here we put a comma. I can do months of this is equal to one close parenthesis
and we press Enter. If we double-click, you can
see that everything is the same except the first
one, I get my 96. Now let's go to
my third example, which is even more fun. It's a chart based on
some answers and sales. And what happens in this chart is if I change this frequency, you can see that the labels are coming every four months is now. If I put them e.g. every couple of months, as you can see, more labels. So let's put back three
and let's delete all this, which is my data
preparation. They will. Let's delete it and
let's think about it. Step number one, let's
insert a similar chart. So I'm going to select month's
sales Control Shift arrow down, insert. We go here and
select this chart. Now let's go up and put it
on top of the other one. If you see this chart, it has two problems. Number one, I don't have
the dates in a nice format. Number two, I don't have
the labels for the dates. Let's take care of it by adding this column and
this column months. So what I'm gonna do is equal if the months of this
date is equal to one. So January, I wanted
a year to appear. Comma if not, I want nothing. And you'll see why when
we add this to the chart. So here I have the year, double-click, I get
it one more time. For the months,
it's even easier. Equal I'm just going
to select the date, as simple as this
and double-click. You can see that I get
the months in one letter. How if we go to formatting
and custom formatting? If you remember, our date, section one, m is 12, is 013 is Jen for his January
and five is the letter J. And this is what I've done. I just did some formatting here. So press Okay. Now that
we have fixed this part, it's time to get the values. So what I'm doing here is
I have my sales to get the line and then I have
value to get the labels. And this is a
charting technique. They will be a course on charts. So stay tuned. You'll be
able to understand a learned all these techniques and make amazing charts for your reports. Now what I'm gonna do is something similar
we have seen above. So I'm going to use in a formula mode of
the months of this. So the mass of the date comma, and then this is my frequency, press F4, close parenthesis
equals zero comma. Then the value if true, is the Saves comma if not, double quotation, double
quotation, close parenthesis. So we press enter, we double-click, and
we get our numbers. Now, it's time to add
this data to my chart. So right-click
here, select data. First thing I want to do
is to add a data series. Here. If you see this sales, I want to keep this line
and add one for the labels. So add series name is the value. Always give it a name. It's good practice. Series values,
trickier, Control, Shift, arrow down, press. Okay. Next we want to add the dates. So here I have year and months
Control Shift arrow down. Here. We have replaced it by this
2019 and the letter press. Okay. If I just move the
chart a little bit, you can see now that this
is the effect that you get. And if I put another time
2019, It is not good. You can see what happens
if you have at one time, excel will put it in the middle, and that will look good. So now Control Z to get back, Let's do some formatting. We click here, delete this, click here, delete this. What I need to do is take
care of this orange line. You can see that every
time I have nothing, it crashes to zero. How to get rid of this problem? Well, what you could do is use another formula
that looks useless, but will be very useful here. The formula is N A open
parenthesis, close parenthesis. So this one will
give you an error. So there is a formula
in Excel for errors. Once I do this, you can see that
this disappears. Why? Whenever Excel doesn't
know four charts what to do. Like here when I have an error, it will not put the data points. So now if I double-click,
everything is gone. But actually those
values are still there. But you cannot see
them because there is no connecting point
between them. So what I could do now
is double-click here, and then I can play with things. First thing I want to do
is select my series value, which is this series from here. And I want to remove the line, go to marker, marker
options built in. You can see that now I get
the points, which is good. Next thing I want
to do, close this, click on this plus
and put data labels. And why this works, because I selected
the right series. So the labels of the
series are coming. Let's click on one of them. Go to home, do B for bold, and now they are in bold. The next thing I want to do is colored this line in
a different color. So let's click on it. Double-click here, you can just go and check you have selected. So Series Sales. And then you can go here, change the color of the line, and it will look much nicer. Now if you see, if I go and change this to four, it is working perfectly. So let's go back to three. The other thing I want to
do is show the first one. Always. We're going to use
a trick with all. But this one is different. Because here I have two times
January that are just said, if the mass is January, show me the label here. I cannot do this. So here I can do an or. And my second condition, I'm just going to write
it, then explain it. The row formula. If
you remember it. Here, we select
this n equals Rho. Select this cell, and then
just close parenthesis again. Here, I'm going to use F4. So press enter, double-click. You can see that it works. How, if you see here rho a 43
is 43 and draw a 43 is 43. But whenever I go down one, this becomes a 44. So that's 44. And this remains 33, which means that only the first one will be true.
And it will appear. This is how you can use seemingly useless
formulas to create something really
dynamic and powerful.
98. S8 L4 Conditional formatting with logical operators (***): In a previous lesson, we looked at using formulas
to do conditional formatting. But the formulas that we
used were very basic. We were just comparing
a couple of numbers. Here. I want to show you the
extent to which you can go with formulas and
conditional formatting. We have some data and what is
important is the country's, what I want to do is
color every country starting with an I in one of the colors
that we can choose. The best practice is always
try the formula in Excel, then copy paste it in
conditional formatting. And the formula,
we have to write it for the top left
cell in my range. In this case, my range
is my countries. So it's from here down. What I have to do, I have to write the
formula for China equal. We don't need the
NF here because conditional formatting
looks at true and false. If it's true, it gets applied. If it's false, it
won't get applied. So what is the formula that can check if the
first character is and if you remember our
texts formulas, it is left. So left. China. Comma one,
close parenthesis, equal double quotation. I double quotation. Press Enter. Now we double-click
and check the formula. We can see that India is
true and Indonesia is true. So it seems that it's working. Let's copy paste it. Control C escape. We will select our range. Here. Be careful
you have to select from China and not from country because the formula
is for China, the first one. So Control Shift, arrow down, conditional
formatting, new rule. Use a formula, paste it. Let's go to Format and
select this green. Now let's press Okay. And then you can see that India, Indonesia are in green. You also have Iran. The next thing I want to do is make it a bit more complex. I want also the last
letter to be an a. So I want to get rid of Iran and keep India
and Indonesia. So let's change the formula. What we can do is add
an end condition, so that's a logical operator. So this is my first
condition, comma. My second condition is right. We take the text comma one, close parenthesis equal
double quotation. A double quotation. Be careful here it's capital, here it's small cap. And then close parenthesis,
press Enter, double-click. Let's check Iran. Iran gives me false. Italy also endorse are true. So now let's copy the formula. Control C escape. We go here, Control
Shift arrow down, conditional formatting, this time managed rules because
we already have a rule. Double-click, you can
change the formula, paste it, the Press,
Okay, press Okay. And here you can
see that only India and Indonesia are in green. So that's how you can apply
conditional formatting and formulas and you can
make it as complex as you want with
an old conditions. The last thing I want
to show you is that if you want to remove
conditional formatting, you can go to clear rules. And you can clear rules
from selected says. So it says that I selected
or the entire sheet.
99. S8 L5 Adding icons to your reports (****): So here I have a
boarding sales report, and I want to give it a bit
more colors using icons. If you meet the sales targets, I want an icon. If you don't meet it, I want another icon. And we're going to see
two ways to do it. The first one is with fonts, the second one is with uni car. Let's start with fonts. So here I'm just
going to go under Insert symbols, symbols here. And if you go instead of normal text, you
select Wingdings. This is a format. You click, you
have some symbols. I'm going to select this one, double-click, it's
inserted here. Let's press Cancel. You can see it. Press enter. Now, if I go here
and I go to Home, you can see that now the format
of the cell is Wingdings. And if you go to
the formula bar, you can see that it's a C. Why is it a C? Because if you go to
any other format, let's say Calibri, you can
see it's a C for Wingdings. A c means the thumbs
up. That's great. Now what about the sum down? So insert symbols. Let's go here. You can see that if I
click on the thumb up, the character code is 67. So now let's go to Wingdings. You can see it here. This arm down is character 68. So now given this knowledge, what I could do is do equal. Don't worry about
what is written here. This is where you have to focus car and put 67
close parenthesis. You get the thumbs up. If I do equals 68, you get the d. And if I just copy
paste the format, you get the sum down. Now given this knowledge, I can use a formula
and get my result. So don't worry about
what you have here. Again, it's just a formatting
focus on the formula bar. If the sales is bigger or
equal to the target comma, We want character 67, comma. Otherwise character 68, close parenthesis,
close parenthesis. Press Enter. You'll get the sound down. And in some of them
you'll get the sum up. If you don't see this, you see Cs and Ds. You just go to Home. You change the format to
Wingdings, and it's done. Now the second way to do this is to use
unique characters. Unique characters will appear if you use the formula unit car. So let's go to this website
where you can see them. You see there are
so many options. I can select any of them, e.g. this one, this is the number. I can go back to my Excel sheet. If I paste it. And I do equal unica, open parenthesis, select the
cell, close parenthesis. You can get it here. So now I chose two of them. These are the numbers
and we're going to use them without
doing any formatting. To get our icons. Here, I'm gonna do
open parenthesis, sales bigger or equal
than targets, comma. If it's true, we're going to use Unica and select the first one. Close parenthesis
comma, if it's false, Unica, or the second one, close parenthesis, close
parenthesis. Press Enter. Now let's use F4, F4, and F4. Press Enter again,
and we can drag it. You can see here you get the
other icon that I chose. And this is how you can add more character to your reports.
100. S8 L6 Matrix Coloring (****): This is another
real-life example. What I'm going to teach you
a cool trick to impress your boss using the formulas that we have learned
in this course. The situation is the following. You have a matrix of sales numbers and you
want to select the name amounts and get the corresponding value
highlighted in orange. So how to do this? Let's start first
with data validation. So here I'm going to create
a data validation for name. So I'm gonna do data
data validation list and then select my names. Then you say, okay, we select the John. Let's do the same for months. We use list, click, select my monsters, and then
I'm okay, let's select Jan. And you can see that this
is highlighted in orange. So that's cool. Right? Now let's remove this effect. Let's go to Home. Conditional Formatting,
clear rules, clear rules from entire sheet. And this has gone and
start from scratch. Now the way I thought
about it first is to write an index
and match formula. And maybe afterwards I can use it in conditional
formatting. So here I'm going
to do equal index. And then my array is
where I have my answer. So it's one of those numbers, F4 comma, then I want my row. My row is a match
formula so much. This is my lookup
value for Gamma. This is where I want
to look for it at four comma zero for exact
match, close parenthesis comma. Then for my column and
other match formula, this time with demands match, this is my months for gamma, this is my area. Four, comma zero
for exact match, close parenthesis, close
parenthesis. Press Enter. Here you get 13. Now what about taking this
formula control C escape? I put it here, paste it, and do equal to this number, I get a true right? So that seems that it is nice. It can work if I put it in
conditional formatting. What do you think? Well, this is a trick question because
it won't work. Why? Let me drag the formula
here and double-click. You can see that
here I have a true, and here I have a true, which is these two numbers, 13. Now what will happen if
you select John and John? It will color this one. And this one, which
is not what you want. So the formula is not correct. What can I do in this case? When something way more simpler? Let me delete this formula,
equal open parenthesis. And here we're going to do
two conditions for the 13. The first one is this
F2 equal John comma. The second one, January is equal to the close parenthesis. Now C1 and C2, I need a four because
we're going to drag the formula.
So that simple. Now what about F2? Well, I can move rows,
but not columns. So I have to fix the F. And
here it's the opposite. I can move columns,
but not rows. So I can fix this one. Press Enter, and let's drag
it and see what happens. Double-click. You can see that everything is false
except one of them. Now the simple
formula should work. Let's copy it, Escape. Select my data range, and go to conditional
formatting. New rule. Use formula, paste it here. Format. Let's use
the orange press. Okay, press Okay,
you get 13 here. Let's select VBA and April, and you get the other 13. That's pretty cool, right? So here you can learn
that we always have to work smarter, not harder. So instead of having
a crazy formula, I just have this small
formula and it works.
101. S9 L1 Intro (material in Project section AllToDo, AllCompleted): Welcome to the section about
dynamic array formulas. Before I go to the usual
content of this section, I want to tell you two things. Number one, dynamic
array formulas will work for the newer
versions of Excel, e.g. Office 365 and Excel 2021. If you have an older
standalone version of Excel, it will probably not work. To know if you have
dynamic array formulas. Just go to Type one
of the new formulas, e.g. equal unique A1A2. If it doesn't work, it means that you don't have
dynamic array formulas. The second thing I need
to tell you is that if you use dynamic array
formulas in your Excel, and then you share your workbook
with somebody else like a colleague who doesn't have the newest
versions of Excel, it will not work. So there is no backward
compatibility. Now, let's start with what
we have in this section. First of all, I'm going to explain to you the
difference between the traditional or the old Excel and this dynamic
array formulas, because it's a big revolution
in the way Excel works. Second of all, we're going
to look at speed range and the hash sign and how to take advantage of those
properties served. We're going to look
at the new formulas that you have in dynamic arrays, how to use them. Force, we can attest dynamic
arrays with drop-downs. Then we're going to see how
calculations with change in x with this new
engine that you have. Number six, we got to try dynamic array formulas with
formatting, then on charts. And finally, I'm gonna
give you a couple of pro tricks with the choose
formula and the formula. So are you ready
for this section? Let's go.
102. S9 L2 The Situation: So here's the situation. I know the picture
looks horrible. It looks like a plant that
is polluting everything. But you have been hired by Food Inc. in their data
analysis team and you need to help them into areas analyzing sales and HR data. Now the head of the department, she's very excited because she got access to the new
Excel Office 365. And it has dynamic
array formulas. So she has heard a lot about
dynamic array formulas. And she wants you to conduct different analysis
using the new formulas. And functionality is available. Now, luckily for you, I am here to help you. So let's go do the
assignments together.
103. S9 L3 The Buzz about dynamic arrays (*****): So what is this buzz about
dynamic array formulas? Let me try to explain to
you this in plain English. The biggest change
that we have between all the Excel and dynamic
array formulas is that before the result of a formula
will come in one sense. Now is dynamic arrays. The result can come in
multiple cells and it can spill over into adjacent
columns or adjacent rows. And this is a huge
change in the engine of Excel that unlocks a great power to simplify your analysis. Before, if you wanted to get the results in
multiple cells, you would have to select the cells where you
have the result. And then you would add to press Control Shift Enter to get it. And that was cumbersome reserve
for advanced Excel users. A lot of people don't
understand it and so on. Now it's so easy, you just
press Enter and that's it. Let me try to explain to
you this with an example. So here you have
column a and column B. If I do A1 to A3 times v1 to v3, what would be the result? Basically in the old exam, you will just get too, because you'll just get one times two the first
row, and that's it. Here you will get 26.12, each one in a different row. Now note a few things
about dynamic arrays. First of all, it has potential
for multiple results, not just one result. To the result will spill
over multiple cells. It could be columns or rows, then the results are dynamic. So if something changes, everything
automatically updates. And you will have the
formula in one cell, although the results will
be in multiple sets. The second most
important topic about dynamic array
formulas is that you have some new formulas
that are very powerful. So you have sort, filter, unique deck, split and sequence. Those are some of the
examples of new formulas. We're going to see a lot of
them throughout this section. And finally, as I said, given this calculation engine, no more control shift
enter business. And you can apply a formula on multiple cells at the same time. So let's go to Excel. Let me show you what
I mean by this. Practically here in 9032905, you have some data. We have quantity and price. And what we want to do is
calculate total sales. So to calculate total sales, in the old way, you would do quantity
times price. And then you'll
just double-click and the formula will drag down. You will have a
formula in each cell. Now is dynamic arrays. It is way more simpler. So what you can do is you
just do Control Shift, arrow down, then you do times. Let's go up. And let's select the
price control shift arrow down, press Enter. You can see that directly. You get all the results. So the formula is here, but if you go to
the second cell, it is grayed out because the formula is only
in the first set, but the results are
spilling down till the end. Now the good thing about
this is that you can use it on all formulas. So whether it's a sum, it's an if statement, the same concepts will apply. And this is how you can use this powerful
calculation engine.
104. S9 L4 Spill Range & # (*****): I have alluded to this
in the previous lesson, but this one is focused on
speed range and hashtag. So what is spelled range? Basically, it is the range of cells where you're gonna get
the result of a formula. And you need to note a few
things about spilt range. Number one is that the formula
is in the first cell and all the other cells will have the formula grayed out because
the formula is not there, but they will show the result. Number two, cell
formatting will only apply to the first cell if you want to have it
on all the cells, just do it before putting
the formula or after. Number three, you will see a blue rectangle around
the speed range. You can see it in
the big number four. If you add data or remove data, the range will
automatically resize, except if you add
data at the bottom. And I'm going to show you
this in the Zen number five, you can use the hash to
reference arrange e.g. here I have a formula in H2. If I want to have the sum of all these numbers
in another cell, I can do equals sum, open parenthesis, H2,
hash, close parenthesis. And finally, you will get
the hashtag spill era. If there is a cell
that is merged or data that is blocking
the spill range. Or if you have an Excel table, what do I mean by Excel table? Let me show you by going
to an Excel sheet. So here you have the
same Excel sheet. And if I add the table, what I mean by this is what
we have seen in this course. Insert table. And you can just
select the cells. Those cells are fine
to me, put okay. And here if I do some e.g. I. Select these numbers,
Control Shift arrow down, you can see that you
get the table name, table three, and
then the quantity. And here you can get the sum. However, if you have
an Excel table, you can use dynamic
array formulas and refer to columns that
are within this table. So now let me do control Z to remove this table and go
back to where we were. What I want to do is to
do the sales of 2020. So here I can go and do
some open parenthesis. If you see, I'm going to
start selecting the data. Look at the formula bar. Whenever I reached
the end of the data, it will be transformed
into a hash automatically. So if I do this
close parenthesis, you get the series. Now, if I change something here, obviously the number will
update automatically. So Control Z. If I
delete something, same thing, the number
will update Control Z. If I add something, let's put here some numbers. Also, the formula will update. So control Z, we get
back where we were. Now, let me do 2021 and I'll
show you one more thing. For 2021. I will go down here
and do the same. Equal this one Control
Shift arrow down times this one Control
Shift arrow down, press Enter, you'll get it. The format is in percentage
so we can just fix it. And then let's go up equal
sum and then go down. Here we select the first cell, put the hash close parenthesis,
and you'll get it. The only problem
that you will face. And we will see how to fix
it in the next lesson, is that if you go at the
bottom and you add data, you can see that the
formula will not take this in the range and
so it will not update. So don't worry, we will
learn how to deal with this.
105. S9 L5 Excel Table to automatically calculate formulas for new data (****): We are back to 9.03, 29.05. And if you remember from
the previous lesson, here we had the
dynamic array formula. And if you go down with
control arrow down, you add some data here. It doesn't update automatically
what to do in this case, there are several methodologies, but I'm going to teach
you the one that I prefer because I think it's more sustainable
and easier to implement. So let's delete this, go back up, control arrow up. And the first step
you will have to do is remove any filter. So here you have a filter. Do a T, the filter is gone. Second step, you have to move this at the
end of the table. Because as you know, Excel tables do not take
dynamic array formulas. And to, as a best practice, it's always good
to have your data. And then you start
your calculation. To do this, I will do
Control Shift arrow down. I will do Control X or cut. Then come here, right-click,
insert cut cells. And here you have your
sales at the end. Next, we're going to
add a data table. So click inside. Either you do
Control T like this, or you go to Insert table. Now, if you see here, excel has tried to guess
what is your data range? And it goes to I. I don't want I, because this should not be
in an Excel table. Otherwise you'll get
a spelling error. So what I could do is come here, delete and put H, or I use the arrow
and select the data. Now my table has headers. Put. Okay, Finally, let's try our concept and
see what will happen. So we click here,
Control arrow down, put five here, six here. You have a formatting problem. You can just click like this. And you see that automatically
the formula is updating. So this is how you
can solve the problem of growing data and
dynamic arrays.
106. S9 L6 Important new Excel Functions (*****): Before we deep dive into the exercises related to
dynamic array functions, I just want to show you the newest functions
that you get or the most important ones with
the newest version of Excel. So maybe you want
to upgrade and take advantage of those functions
to make your life easy. If you remember in
the statistics part, we saw three formulas when we were generating
random numbers. First we wanted to
generate random numbers, so we use the random array. And two, we want to, those random numbers
to be unique. So we use the sequence of numbers using the
sequence function. We sorted it by a random array. So for this we use
the sort by function, which can sort an
array of data by one or more columns
in another array. Now, also, we looked
at X lookup and we saw how it is different than the traditional lookup
functions such as VLookup, HLookup and index and match. Those are the formulas
that we briefly, so we're going to see some
of them in this section. For the new ones,
you have soared, the difference between sort
and sort by source will allow you to sort by one or more
columns within the array. Sort by would be
in another array. Now you have filter. Filter will allow you to
filter your data using some criteria and it's much better than
filtering manually, then you have unique to remove duplicates and return
distinct records in an array. Texts plate will allow you to split a text using a delimiter. So e.g. if you have
spaces between the words, you can easily split your text. And then you have texts before and texts after. Texts before. We'll get the text before
or the limiter texts after. We'll get the text
after a delimiter. So some of the things that
we did in the text section, you won't have to go through all this and put 34
formulas together. You can just get the
result in one go.
107. S9 L7 Sort (*****): Let's start with
the sort function. And as its name suggests, salt is used to sort an array of data by one or more columns. Now what is the most important here is to understand
the syntax. So if I look at the syntax, I have four parameters. One is mandatory,
three are optional. The first one is
very easy array, which is the data
you want to sort. Then you have the sort index. It's the column number
you want to sort by. And here the default
is column one. Then you have the sort order. Ascending is one,
descending is minus one, and ascending is the default. And finally, you have
a parameter that I nearly never used,
which is by column. Usually your data is by row, so it's a table,
as we have seen, e.g. in this section. So automatically the
default is by row. You don't need to put it. But if your data is
in reverse order, which is rare, you
can use by coal, which is option one. Let's take an example. If I have sought a one to d
ten and then I have to -1.0. So A12 D ten is the array. Two means I want to sort by Column B because it's the second column that
I have in my range. And then minus one means I
want to do it descending. And the zero means by row. So my data is in
a tabular format. Now what if you want to sort
by more than one column? Well, this is what I'm
going to show you here. You can see that if I want to sort by more
than one column, I will put the columns
in curly brackets. So here I want to sort
by Column two first, then by column three. And then you have minus one, which means that column two
I want to solve descending. And then one for columns three, which means column three, I want to sort ascending. So let's go to Excel and let's look at
practical examples. Here, my boss gave me
some data about sales. And what I want
to do first is to get the product sorted
alphabetically. So let's try our formula. Equals open parenthesis. You need your array. So those are my products. Comma. Do I need to put anything as a salt index or
older or by coal? No. Because my sort index
is any ways one by default. And I only have one
column to sort order. I want it ascending, so that's a default. And by column, my table
is in a tabular format. So I don't need to do anything. So let's just close parenthesis. Press Enter. It is sorted. As simple as this. Now let's do a bit
more complicated. I want to sort the
whole array by sales. So let's go here and write
equals open parenthesis. This is my array comma. What is my index? It's my total sales. So that's two comma, what is my sort order? I want the top stays at the top. So I'm gonna do this
ending and by cold, I don't need to use. So let's close
parenthesis, press Enter. And as you can see, you get cut out, which
has the most sales. Now let's make it
more difficult. Even. I want to sort by margins
first and then by sales. So here I'm going to go and
do equal open parenthesis. Select my array comma. Now here I have two columns. So I have to do curly brackets. Margin is my third column. So three comma, then sales
is my second column. Close curly brackets, comma. I want the sort order. Now if I want to sort
them all descending, I can just do minus one close
parenthesis and I get it. But if I want to specify
different orders, then I'm gonna do curly brackets comma
here and put one e.g. for ascending, for
column two and column three will be descending
because it's minus one. Close curly brackets
and press Enter. As you can see, you get the top margins first. And then obviously
if there is a time, it will sort by sales.
108. S9 L8 Sortby (*****): After seeing salt, it's
time to look at sort by. Now the difference between
the two is the following. For salt, you are sorting by a column that is within
your data range. But for salt by the array might be
outside your data range. So if you see the
parameters, first, you have the array,
which is the same, the data that you want to sort. And then here's the difference. You have byte array one, which is the first array
you want to sort by. Then you have the
order ascending one, which is the default
descending minus one. And then you will have
array 23 and so on. Now let's go to Excel
and see the difference. We have the same
Excel, 9.079, 0.08. What I'm gonna do
for you to see, I'm just going to
hide those here. The first exercise we have
to do is sort by margins, then sells the same
way we did before, but now we're going
to use sort by instead of sorts.
So let's go here. Equals sort by open parenthesis. My array is this comma. If you remember in
the sorted version, we put the columns
and then the order. Here we will put
the first array, which is the margin. So I'm selecting
my margin comma. I want it to be descending. Then comma, my second one is
my sales, so I select it. I want to sort order
to be ascending. So I'm going to put a
one close parenthesis, press Enter, and you'll
get the same result. Notice two formulas
to do the same thing. Now let's do
something more cool. I want to sort my products,
but not alphabetically. I want to sort them by sales. And I don't want
to show my sales. So here I can use sort
by open parenthesis. This is my array comma by what? By sales, which is
outside my array. Then comma sort order. I wanted descending
close parenthesis. And now you have cut out, which is the one
with the top sales, and you don't see the
cells next to it.
109. S9 L9 Filter (*****): Filter is one of my favorite
functions in Excel, along with x lookup. Usually in Excel, a lot
of times you have data. You want to check
things in your data to start filtering and
unfiltered in manually. And that can be very cumbersome. So what is the syntax of filter? Basically it has
three parameters. One is the array, which is the data that
you want to filter. Do is include which aren't
my filtering conditions. And then you have if AMT, which is an optional parameter, if you don't find any data, what do you want to
return to the user? So let's take an example. If I want to do
Filter A1 to d ten, which is my dataset, B1 to be ten equal chicken. And then if I don't
find anything, I will write nor data. So what will happen
in this case? Basically A12 D ten will get filtered for all the rows where the column B
has chicken in it. And then I'll get my dataset. What if I want to
add more conditions? Here? You have to think
about some product. So for an end condition, you can just multiply and put the second condition
like you can see here. If it's an OR condition, just replace the times with
a plus. That's the trick. Now you'll tell me why do I have multiplication and
addition for n then? Or if you have forgotten
the sum product, you can check it out. But in this lesson also in the Excel, I'm
going to show you. So here we are at 9.99, 0.10. I have my sales data. What I want to do
is select category, product and quantity based on category equal box.
So let's do it here. Equal filter, open parenthesis. What is my data? My data is here. So we select the three of them, Control Shift,
arrow down, comma. Let's go up again. And let's see what is
my filtering criteria. I want my category. So let's select the category Control Shift arrow down equal. Let's go up again. Bar comma. If we don't find anything, Let's put no data. And then double quotation, close parenthesis, press Enter. As simple as that. Now, if you see we
have all the bars. So first carrot at 33, then you don't get anything. Another cut out at 54. So that's how it works. Now let's do something
a bit more complicated. I'm just going to hide those. So right-click Hide,
we get this one. Let's hide one more. Here. What I want is
another condition. I want bars and quantity
has to be above 50. So let's try it out. Equal filter, open parenthesis. My array is the same. We select it, Control
Shift, arrow down, comma. Now what is my criteria? First criteria is the same. We need the category equal bars, so open parenthesis, select
my category the same way. Control Shift arrow down equal. You have bar, then
close parenthesis times because it's an N
condition, open parenthesis. We want the quantity. So we select the first one, Control Shift arrow down. We want it bigger
than. We go up. Select my 50, close
parenthesis, comma if empty, no data, and then
double quotation, close parenthesis, press Enter. Here you see we
get cut off at 54. So my first carried out at 33 is gone because it doesn't
fulfill the criteria. So you get the second
one and so on. Now let's understand
how this works. I'm just going to go
get my first criteria, which is this one,
control C escape. I will go here, equal based it, press Enter. So you get a bunch
of true and false. We get the second one. Control C Escape,
go here, paste it, put equal at the front, equal, and then you get a
bunch of true and false. So this means that
the category is bars, and this means that the
quantity is less than 50. Now, if you remember
what Excel does, a true is equal to one, force is equal to zero. So here I have a multiplication. So I'm doing this
one times this one. Let's just double-click. And you can see that
wherever I have two trues, it's a one times one, and then it's one. So in this case, this
is my 54 catalogs. In this case is my 51 carrot. Now, if it was a plus, because if we want to
do a normal condition, so one of the two, if you have a plus,
let's press Enter. And if you can see, we're getting the
bars, carrots 33. Now the bars is okay. The search history is not, but because one of
the two conditions is fulfilled, it works. Here. Cracker is not bars, but 87 is above 50, so it's coming and so on. How does it work? Let's just replace
the times with a plus and just double-click. And you can see again, through is the one
false is zero. So wherever I have one or two, because here you have two trues, it will come in my data. And this is how a filter works.
110. S9 L10 Unique (*****): Let's say goodbye to remove
duplicates in Excel. So you remember
the old way where you have to select your data, go click on Remove Duplicates, and then you get your value. And this is static. Now we have a formula for this. So we have this unique formula
with the following syntax. First of all, you
have your array, which is the data that
you want to work on. And then you have two
optional parameters. Honestly, I nearly
never use them. The first one is by cold, which means that if your
data is in tabular format, the default is zero. So you don't have
to do anything. If it's not, if it's in reverse, then you can use
one as a parameter. And the second one
is exactly once. If you don't do anything, you'll get all the unique
values in your dataset. If you put one, you will get only the values that are appearing one time
in your dataset. Now let's go to Excel and
let's look at this function. Here we are back to 9.099 point. Then I have hidden
the data in between. And what I want to do is
get the unique categories. So obviously here we
have the whole thing. But what I'm gonna do equal unique open
parenthesis, your array. We start here, Control
Shift arrow down. And then I'm not
going to use by coal. And not exactly once. Let's close parenthesis
press Enter. You can see you have
four categories. Bars, crackers,
cookies, and snacks. Now you can use this formula
on more than one column. So here, if I just click and
drag this to the product, you can press Enter. And now you get a
unique combination of products and category 4 bar. You have bars cutouts. Here you have bars,
brand and bars banana. And this is how the
unique function works.
111. S9 L11 Filtering non adjacent columns (*****): Since now you are
well-versed with some of the formulas related
to dynamic arrays. This is a time for a challenge. Your boss gave you this HR data. And what she wants is the
names of the employees and their departments
where the salary is above hundred $20,000. Now the problem if you see here, the employee name is here
and the department is here. And so far in this course, we have not seen what
to do when you have non adjacent columns and you are using the
filter formula. The other thing I want
to tell you is that this is formatted
as an Excel table. If you're not sure
what this Excel table, you can refer to a less
than in the same section. So now let's start. What we're gonna do
first is filtered the employees where the
salary is above hundred 20. So we will do equal
filter, open parenthesis. My array starts from here
till the department. Control Shift arrow down comma. Now you have include. Include will be my condition and it's based on
salaries, right? So we click here and we do
Control Shift arrow down, bigger than you go
up, you select 120. Now notice how, because
I have an Excel table, you can see the names
of the columns up. And now I'm not going to use this node data if you don't
find anything that if empty. So let's just close
parenthesis and press Enter. So here you get this right. Now how to filter
this employees? Well, this is where I'm going
to show you a cool trick. On top of this filter formula. What I want to do is
add another filter. So now my arrays, all this, this
filter data, karma. What do I have to include? This is where we're going to do curly brackets and
closed curly brackets. And in the middle,
this is the trick. Every column that you
want will be a one. Every column that you
don't want will be a zero. So one for employee name
because I wanted sex, marital description,
date of birth. I don't want so that's zero
comma zero comma, zero comma. Then I want the department. So that's the one I am done. I don't want to use this FMT. Close parenthesis, press Enter. And now as you can see, you get all the employees and their departments where the
salary is above hundred 20. Now let's do something else. I want the unique
positions and departments. How to do this? You can see position is
here, department is here. So to get this, what we're
gonna do first is read the whole thing using the same technique and just keeping position
and departments. So let's do it. Let's go there. Equal filter, open parenthesis. Let's go here. We select the position. We do shift arrow
to the right till the department Control
Shift arrow down. This is my array comma. Let's go up. We will use the same trick, curly bracket, curly brackets. Now here in the middle
position I want so that's the one employee is x my little description,
date of birth. I don't want so those
are four zeros. So we're going to have them. Then comma, I want the
department that's a one. If empty, I'm not going to use close parenthesis,
press Enter. And if you see here, now you're getting all the
positions and departments. Now what to do to
get the unique ones? So easy? We have our unique formula. We wrap it in unique. We don't need by color and exactly once close parenthesis, press Enter, you'll
get your results. Now, one bonus
trick I want to do. I want the same thing as here, but I want to sort
them by salary. So how to do this? Let me just do unhide year, so we have a bit of
space. And let's start. What I want to do
first is to filter my data for salaries
above hundred 20. So we go here, equal
filter, open parenthesis. My array starts
at employee name. We select until
salary this time. And then we just do
Control Shift arrow down. So be careful the
difference between the first one and this
one is that I took salary within my
array comma include. Here my condition is the same. I want the salary
Control Shift arrow down bigger than you just go up. Select your 120. Let's not use if empty,
close parenthesis. So here what I'm getting
is all the names, the information, and the
salaries above hundred 20. Now it's starting to sort them. So we do sort open parenthesis. This is my array comma. My sort index is which column? 123456. So my salary is
the sixth column, comma sort order I want descending and by cold,
I'm not going to use. So close parenthesis.
Press Enter. You have Janet King. She is number one. Now that I have this, let's use our
filtering technique to get rid of this column. So here we will do a
filter open parenthesis. Now my array is the whole thing. Comma includes. Let's do curly bracket, curly brackets in-between
the first column. I want comma, then I don't
want those three here. So that's three zeros comma, I want this one, that's a one. And I don't want the
salary that's a zero. Let's not use if mg, close parenthesis, press Enter. You can see that Janet
is now at the top of the list compared
to what we had before. I wanted to show you how
you can combine formulas. And I wanted to show you a
trick that a lot of pros do not know how to filter this way.
112. S9 L12 Creating a dropdown menu (*****): Your boss is impressed by
what you have done so far. And she wants you to
create the drop down menu using data
validation for category. And obviously she wants you to use the new dynamic
array formulas. So now what I want to do is use the unique
formula on category. So equal, unique,
open parenthesis. Let's select the bars and
then control shift down, close parenthesis, press Enter. As you can see, we get bars, crackers, cookies, and snacks. So now let's try to put this in the drop-down menu
here, validation list. And then we go here,
select those four. That's great. Press,
Okay, we get them. No problem. But now, what would
happen if e.g. we get a new one? Aaa. You can see it's here. That's great. But if I go here, I have triple a, no snacks. And that's a mistake that a
lot of people make in Excel. If we go back to the
data validation, you can see that
we are selecting only J1 to J4 and now J5. So when this expands, it's not taking into
account how to fix this. Very simple. Equal. You select the bar and
you put a hashtag. So now that will
ensure that it will take the whole species
range of this formula. Press Okay. Now you can see you
have all of them. Let's add another one. So one, press Enter. You can see that everything is coming in the drop-down
automatically.
113. S9 L13 Filtering based on DropDown Menu (*****): Now that you have
the drop-down menu, your next task is to get the products corresponding
to the value. Select it. Let's do it together. What I'm gonna do is what? Userfilter formula, equal
filter, open parenthesis. My array is now my products
because this is what I want. Control Shift, arrow down, comma, what do I
have to include? What is my condition? My condition is
that the category should be equal to the
selected category. So let's select bars, Control Shift arrow down, and then you do equal, go up. Here you have bars, so you select bars, FMT. I'm not going to use
close parenthesis. Press Enter. And now you see you get
a lot of duplicates. So what do we do in this case? We use uniq, unique, open parenthesis,
close parenthesis. I don't care about the
other arguments as usual. And there you go. Get Out brand banana. Now let's select crackers. You get these
cookies, and so on. This is the power of
dynamic array formulas. You can see how the data will automatically adjust
based on what you select.
114. S9 L14 Improve your calculations with Dynamic Arrays (*****): Now that you've
got your products, it is time to do the next
step in your report, which is calculating
the sum of sales. Now, I'm gonna do this
the traditional way. So you can see the shortcomings before we use dynamic
array formulas. So what is the formula
that you need to use to get the sum of sales? Remember, it was in the
statistical part of this course. It is some F and some EFS. Let's use some FS here. Open parenthesis,
Your some ranges. This one comma, what
is your criteria? It is your product. Let's use F4 on those two. And then we do comma equal to
potato chips in this case, close parenthesis, press Enter, you'll get your results. Now I can drag my result
here and I get my grandson. That's great. But the problem comes
if I go to bars, I don't get the banana. This is one of the
shortcomings that you have in the
traditional Excel way. You wouldn't have
to add formulas. And this is not great. So what to do to transform this into a dynamic
array formula? Basically, you have
to do one thing. Let's delete this
formula. Go here. Next to K7. Let's use the hash sign. Hash will take the whole range, which is great for me. Press Enter, you'll get it. Let's go to crackers. You'll see it automatically
updates cookies and snack. And this is the power
of dynamic arrays.
115. S9 L15 Formatting with Dynamic Arrays (*****): Now that you have built the drop-down menu
for your category, you've got the product based on the drop-down menu and calculate
the corresponding sales. It's time to add a bit of punch and coloring
to your dashboard. So here what we want
to do is add some box. First step in this
is get the sales. So here, instead of writing
the formula, again, I can just do equal this
and put the hash sign. When you put the hash, it will take everything
you have in the range, press Enter, you are good. Next, conditional formatting. We go here and we do
data bars, more rules. And here I can change the color. Let me use a nicer color. And then we can say, okay, you can see we get the data bar. However, if I go here
and select bars, I have a problem, right? Because this one is not coming. So let's try our hash sign
with conditional formatting. So here we just
click Manage Rules. You can see the rule
apply m seven to eight. What if I put M7
hash? Press? Okay? It seems that now it's working. You can see the bar. But now, what if I go to bars, this one and I put
another one, triple a? You have the same problem again. This is the limitation
of Excel for now, the hashtag will not work
with conditional formatting. So what to do in this case? Where you can just go back
to the rule, managed rules. And here you can take a buffer. So if you know e.g. that
you won't go more than 15. Just put 15 press. Okay. And now it will work. If I try all of them, you see it's
automatic, it's good. And if I have more e.g. in bars one, and then
I go back to bars, you can see that it will
come automatically. So this is what you can
do for the time being.
116. S9 L16 Charts with Dynamic Arrays (*****): Your analysis will not get completed unless you
add a chart to it. And what I want to do is see how the dynamic array formulas
will behave with the chart. So let's try to insert a chart. Here. I'm going to take
the only product we have, go try to insert a chart. So this is my chart. Let's make it a bit
smaller so we can see instead of whole
wheat, It's not nice. Let's do equal and
select e.g. Total Sales. Press Enter. You can see you get
total sales here. And now let's just move it here and see what happens
if I select bars e.g. so here I have three, but I only see one. What can I do in this case? Let's try the hash sign. So right-click
Select Data, edit. And let's go here. Put two hash press. Okay? Well, you'll get an error because it doesn't
work like this. Now what's the solution? There is one, fortunately, it's not like
conditional formatting. What you can do is
create name ranges. So let's do one for products
and one for sum of safe. So here we just go to Formulas, Name Manager, new, and then we're going to call
it product range. Remember the names. Let's click Select
the first product and put hash. Press Enter. Here it let me do it. Great. Another one for the sales. So some saves range. Let's select this one. Put the hash, press,
Enter, press. Okay. Now let's close this. Go back to the chart. Right-click Select Data. Edit. Here. Let's remove everything
after the exclamation mark. This is my sum range. Press Okay, it let me do it. You can see it here. And here. Let's edit, remove here and
do product range. Press, Okay, press Okay, you can see your products. Now I can just do a
bit of formatting. I'm just clicking on some of the things and pressing Delete. Here, I click at the
bottom, go to home. Click on B2, make it bold. I can click on my chart. Click here Data Labels, and next I don't
like this color. So just right-click Format
Data Series, you go here. Let's change it to
this color, e.g. and then we don't
want the border. So we can go here
and we can see e.g. chart area. You have border for
border, no line. Here. We have our chart. Let's put it here. Close this, make it a
little bit smaller. And here you go. This is your mini dashboard.
117. S9 L17 Sequence (*****): The sequence formula is a formula that you
rarely use on its own. Usually you combine it
with other formulas. So in this lesson, I'm just going to
show you the syntax. And in the next one, we will go for a
practical example. Here, the sequence
function basically returns a list of numbers and
it has four parameters. One is mandatory,
three are optional. The rows is the number of
rows you want to have. Then you have columns, which is the number of
columns you want to have. The default is one column. The start is the starting
number you want to have. The default is one. And then the step by how much you want to increase
between each number. So the default is also one. Now, let's go for a
practical example. If you have sequence 331.2, it means you will get
three rows of data, three columns of data. You're going to
start at number one, and you will increment
each number by two. And if you notice, the way the increment works, it goes from left to right. So this is why you get
135 and then you go down, you get 7911 and so on. We will go in the next
lesson and check this out.
118. S9 L18 Real life Dashboard with Sequence, Filter & Sort (*****): We are back with our Excel
sheet containing HR data. And here your boss tasked
you with two things. The first one is to get the top three salaries
in this database. The second one is to
get the top x salaries. Here I have three,
but I can change it. And based on this, get all the information
related to the employee. So let's start with
the first task. If I didn't have dynamic
arrays, what can I do? Well, there is a formula that we studied to get the
top x numbers. If you remember, it was large. So let's do it. Equal large, open parenthesis, select your salaries, go down. You can see since I have
a table, an Excel table, I get the name of the table
and the column name comma, I want the largest salary. So that's a one, close
parenthesis, press Enter. You'll get the largest one. Now you copy. And then you put two here, and here, three, and
you get the top three. This is okay. But this is not very
nice. It's manual. So do you remember a
formula that could come in handy when we just studied
the formula called sequence. If we just put three
rows and we don't choose the other
arguments, we get 123. So why not use this here? Let's do sequence than
three, close parenthesis. You get the spill error. But if I delete
those two numbers, now your result is
here, which is great. So now let's use
the same concept, but with the top accelerates. So I can just copy
this Control C Escape, go here and paste it. The only thing I need to
change is this three. I need to refer
it to this three. Press Enter. Now, if you have five, you get the top five salaries. Now that I have the salaries, let's get the
employee information. So the information is here. Let's get it with
a filter formula. Equal filter, open parenthesis. My array is everything.
Let's select it. Control Shift arrow down. Then you do comma, include what you want to include while you
have the salaries. Let's select them with
Control Shift arrow down, bigger or equal then
what do we want? We want the largest x salary. Here we have five. So
it has to be bigger or equal than the fifth salary that you have in this database. So here you can use
large open parenthesis. This is my array. Again, Control
Shift, arrow down, and then comma. You need your K. Your K is here. Close parenthesis. Then if empty, I'm not going to use, Let's close parenthesis, press Enter. So here if you see you get the same salaries
that you have here. The problem is that
they are not sorted. So let's sort them out. Sorts open parenthesis,
this is my array, comma sort, index is my salary. So the column is 1234567. So that's seven Scholar. And then comma, I
want descending, double-click here, close
parenthesis, press Enter. So now they are in
the same order. The only problem is I have
the salary here and here. To get rid of the salary, we can use a trick we saw in another lesson in
the same section, which is by filtering
out the columns. So here I'm going to do
filter open parenthesis. This is my array comma,
what to include? You remember, we
did curly brackets, curly brackets, and every column we want
to include this one. Every column we don't want
to include is a zero. So here I want to include the first six and
not the seventh. So six ones with commas,
those are three, this is six and then
you have the zero, then you don't want
to do if empty. So close parenthesis,
press Enter. The salaries are gone and
your analysis is complete. So if I do e.g. then you can see that I get
the top ten salaries.
119. S9 L19 Recap of Randarray (***): So this is a recap lesson about random array because
we already saw it in the statistical section of this course when we
generated random numbers. But basically this function will return a random list of numbers. It has five parameters. All of them are optional. So the first one is rho, which is the number of
rows of data you want. The default is one row, so that's the minimum. Then you have columns, which is the number
of columns you want. The default is one, so minimum one row, one column, and that's one cell. Then you have Min and max, which is what is your
minimum possible number? What is your maximum
possible number? The defaults are zero
for men and one for max. And then you have integer. So if you want whole
numbers, you put one. If you want decimal, it will be zero. And decimals is the
default option. So if you don't do anything, you don't put any parameter. You will get one number. That will be decimal 0-1. Now let's look at an example. Rand array, 33100,
true, what will happen? You will get three
rows, three columns. The minimum number can be one, the maximum can be hundreds. And you'll get whole numbers
because you put true. True is equivalent
to putting one.
120. S9 L20 Frequency (*****): The frequency function is
a very relevant function. If you want to know
how many records you have between different
ranges of values. So e.g. here I have ten records less than
hundred, 54 records, 100-223 records above 200. So this is a very
useful function when you want to do this
kind of calculation. Now, if you see the
syntax of this formula, it has two parameters. One is the data array, which is your dataset, and two is your veins, which are the intervals
are showed you above e.g. between hundred to
200, et cetera. Now, you have two
things you have to be careful when you use
the frequency function. The first one is that you always have to use the upper
intervals. So e.g. I. Should not use
less than hundred, hundred to 200 and so on. I should use hundred, 200 and so on. And the other thing you
need to be careful is that the data would
overflow. So e.g. here, this 23 will be above 200, they will come automatically. You don't have to write 201. It is within the formula
to understand this. Now let's see how this
formula will help us satisfy our demanding boss. Here we have the Excel
sheet with the HR data. And your boss wants you to do an analysis where you're
going to have the number of people with salaries
0-505200 and so on. And as you can see, I've put the upper ranges to be able to use our
frequency formula. So let's use our
frequency formula and let's see what we get. Equal frequency,
open parenthesis, you need your data array, so I select my salary, but Control Shift
arrow down gamma. Next you need your bins. The bins are re, is here. We just select them, close parenthesis, press Enter. And here you get the counts. And as I told you
in the PowerPoint, you have two people
above 200,000. D formula will always give
you this extra number. Now, how can you get those
numbers in a different way? Let me show you. You just go to salary Control Shift arrow
down and then you do insert, you select the histogram. This is our histogram. You just cut it. So Control x, you go up, you just paste it here. Let's make it a bit
smaller to see. And let's go up. Here. You need to change this x axis. So double-click and
you have options. We're going to start
with overflow bin, which is my maximum. It is 200, 200,000. Then underflow bin, it is
my minimum which is 50,000. You can see it here. Let's put 50. Then you have the bandwidths, which is the difference between the lowest point of the
bin and the highest point. It is 50,000 everywhere,
as you can see. So we do 50,000 and
then we click outside. And let's just close this one. Click on the chart
plus data labels, and then you get 31, 256,185.2, exactly the same
numbers you have here. Now your boss is demanding. What she wants to do is
have everything flexible. She wants to have a max step, get all the bands and
the number of staff so she can play with it and see what to
present to management. So how to do this? Let's think about it. What can give me
numbers like this? When you can think about
the sequence formula, Let's do equal sequence, open parenthesis,
the number of rows. If you see here,
I have four rows, we have the same data. So how did I get the four rows? I have 200/50, right? Because that's my maximum
divided by my step. So 200/50 comma the
columns is easy. It's one. Start, it starts at 50. So we take our step comma. And the step, if you
see the difference between each bin, it is 50,000. So it's equal to our step. Also, close parenthesis, press Enter and you get
exactly the same result. Now, we just need our
frequency formula. So let's copy it,
Control-C escape. We go here, we paste it, and we just changed the range. Instead of this. We just select this. You can see it becomes the
first cell and the hash sign. So if the range
increases or decreases, we don't have a problem. Press Enter and you'll
get the same result. Now, I can change
this to 30,000, e.g. you can see how the
result is changing. I can make it 60. Same thing. You get different numbers and everything
automatically adjust. Your boss will be happy.
121. S9 L21 Create a Matrix with Transpose (*****): After so much time spent
analyzing the HR data, it's time to go back
to the sales data. And what your boss wants
is something like this. A table, a matrix which
has the category here, and then the cities here, and the sum of sales
for every combination. So I'm going to show
you how to do this very quickly with dynamic
array formulas. So the first thing we
need is the categories. My categories are in column
D. So what formula can I use to generate the
distinct values while you have unique, so equal, unique,
open parenthesis, we select the first one, Control Shift, arrow down. We don't need the
other parameters. Close parenthesis, press enter. Now you get this. Let's get
the cities the same way. Equal unique, open parenthesis. This is my first city. Control Shift, arrow down, close parenthesis, press Enter. Now the cities or in this way, but I want them this way. What to do? If you remember one lesson
we did on transposing data. There were several ways. Since we have dynamic arrays, we can use the formula
transpose, open parenthesis. It only needs an array. This is my array, close parenthesis,
press Enter, done. The next thing to
do is calculate the sales based on
those two conditions. So what formula can I use? If you think about it, remember the statistical
part, some F S. Now, if you don't have
dynamic array formulas, you would do it this way. Let's go to the
Formula bar equals sum fs, open parenthesis. My sum range is this one, comma criteria range one
is my category comma. It should equal bars comma. The second criteria is the
city comma equal Boston, close parenthesis, press Enter. You get the result, but you will have
to fix things and then drag the formula this way. And this way. You
don't need to do that. With dynamic array. We just have to change inside the formula and we'll
get the result. So instead of this one, H-H, let's just
select the first one. Do Control Shift arrow down, you can see it becomes H2 hash. So that's my speed
range, That's one down. Then I need to
change my column Z. So what I can do is
select the first one, do the same thing. Let's go up. What do we have next canine? So instead of just one, Let's select the whole range. You can see it becomes
a canine with a hash. So if this increases, there won't be a problem. Then instead of C, we
will do the same thing. Select C2, control
shift arrow down. Here. Instead of what we could do is just select the whole range of cities and you get the hash. So again, if it increases, no problem, press enter. All your values are
here. You are done. All you need to do is
change the format. So select the numbers. Click here. Just make it nicer than you need to
change the color here. So let's select a color. Here, we can select
another color. Let's select this one
than the font is white. The font is white here. I need the grid line, so I just select this and
then click put a grid line. Then the last trick
I'm going to show you is how to make this, this way which is nicer. So select those, control
than select those. You click here,
you go to Borders, select white, and then you click Outline and inside you
will see nothing here. But the trick is, it
makes it like this, which looks much better than having them without
those white lines. And you're done.
122. S9 L22 Merging Spilled ranges (*****): I'm going to teach
you a trick for pros with dynamic
array formulas. And you're gonna really
like it because it would be very helpful if you are
doing dynamic dashboards. So here I have my sales data and I want to get my
list of products. This is easy. You just use unique. You select the first
product, Control Shift, arrow down, close
parenthesis, press Enter. Now I want to calculate the
sales for every product. So here I can use some fs
equals sum, open parenthesis. Your sum range is H2. Then Control Shift arrow down. You can see the hash because
it's spelled formula comma. What is your criteria range one, it is my product. So let's just do Control
Shift, arrow down, comma. What is your criteria? My criteria is this. I'm just going to
select the whole range. You're going to get the hash. So if it expands, no problem, close parenthesis, and
you'll get the results. Now let's sort this
array by sales. So if I do equals salt,
open parenthesis, I select my array indexes column to sort order is descending, so minus one, close parenthesis, you get your results. No problem. Everything looks good. The problem will come. If I add the category. Let's add triple a here. You can see that
this one expands. This one doesn't expand. So I lost one of my products. Why? Because if you go to
the formula here, it only refers to a range. If the range expands, it's not going to work. What to do in this case. Let me show you,
Let's do control Z. Then the solution is something
you don't think about. We're going to use our
old friends choose. So let's delete
this and do choose here equals open parenthesis. For index number. We're gonna do
something special. We're gonna do curly
bracket one, comma two. So now I'm choosing the first
value, the second value. And we did something
like this when we use filter actual value one. Let's select this. You can see it has the
hash comma value two. We select this. It has the hash
close parenthesis. Press Enter. Now what happens is that you get one array that
includes both columns. So I can just sort it by
putting salt in front. And then I can do comma sorts indexes to sort order minus one, close parenthesis, press Enter. And as you can see, now, if I just add one new, both of the ranges will expand because this becomes one array. And this is how you can use this trick for
dynamic dashboards. So you don't have surprises. If you get more
categories of products.
123. S9 L23 Simplify your formula with Let (*****): Let is not a formula that
you will use a lot in Excel. But once you have
complicated formulas, it can help you improve
the readability. So what does it do? It's like a mini program. It allows you to
declare variables, assigned values, and
perform calculation. So let's look at the syntax. It has led name one,
name value one, and then calculation or name2, named value two and so on. So what is name one? Name one is the name of
your first variable, name value, one is what you will assign
to your first value. But it could be a number, it could be a text, it could be a range of cells. It could be a
calculation of formula. So many options. Once you do this, you have named to
a name value to, it's the same, it's
another value. But once you are done
with those combinations, you have to perform
a calculation. So let me show you an
example to understand. This is a simple one. So here you have
lead, price and five. So your first variable, you will call it price. You will give it
a value of five. Then second variable
is called quantity. It has a value of two. And finally, you want to perform a calculation which is
price times quantity. So price equal five, quantity equal to five
times two equals ten. Let's take another example. And now we have price
and phi, same thing. Then you have quantity
as the second variable. But instead of assigning
a value of two, you're assigned two times price, which is a calculation. So it becomes two
times five is ten. And finally, once you are done, you have price times quantity, which means five
times ten equals 50. So this is important to
improve readability. As I said, Let's go use it in Excel on the previous
formula that we wrote. If you remember what we have
done in the previous lesson, we use choose to combine two
arrays of data into one. So then if they expand, I won't have a problem. Now the issue is if you want
to do this in one step, so you don't want to depend
on those two formulas. It will become very messy. So let's do it together. We're going to replace
L6 by this formula. So Control C Escape. Let's go here. Let's replace it. Then. We're going to replace
K6 by this formula. So Control-C Escape. Let's go here. This is k six, and here you have another K6. And you can see how
the formula is. Now, press Enter. If I delete this, there is no problem anymore. So let's do Control Z. And let's see how that will help us improve the readability
of this formula. Let's take this formula,
control C escape. And let me paste
it here so you can see it and we can start. So the first thing
we're gonna do is equally open parenthesis, we need our first variable. The first variable is product. I can call it product comma. I need to assign it the value. The value is this formula. So let me put one and
then let's do Alt, Enter to go to the line. Let's go to the line
and other time, we need our calculation step. So I'm just going
to put one here for calculation and put a comma. So you can see I have
product as name1, one, as name-value one. And here is my
calculation. Press Enter. We don't care about the result. What I care about is get
this unique formula. Control C. We go here and we
assign it to product. Next, if we go to the
line, what do we have? We have the sales, right? So let's call it sales comma. Now I'm going to assign one
as we did for the product. Photo camera. Press Enter. The calculation
returns one. Always. No problem. Let's just
copy this formula. Escape. We go here, assign it. Now if you see here, I'm using k six, but k six is my product, right? So since I've defined it, we can write product instead. Press Enter. No problem. After doing this, what did I do? I use choose right? This is my truth formula. So I can just go here
and do Alt Enter. Let me make this bigger. So you can see here
we define shoes. So here I'm going to
call it c h comma. The value is a formula, right? So choose open parenthesis. We have curly brackets, one comma, two curly
brackets comma. Then what did I choose? I chose the product
which I already have, and the sales which
I already have. Let's close the choose function. Comma, press Enter. Again, it works. And what was the final step? It was the calculation
step where I sorted. So let's delete this one and now do salt open parenthesis. We had to choose array
which is called CH. Now gamma, the sort index
was the second column, so two comma minus one for descending close
parenthesis. Press Enter. You'll get the same result. If I delete this, both of them are there. But now at least if
somebody reads it, it's a bit easier to
understand versus this version where I have a formula within a
formula within a formula. So this is how you can use lead in those situations
where you have to share the workbook with somebody
or look at it later on. And you want to remember
what you have done.