馃攳
Pivot Table Excel Tutorial - YouTube
Channel: unknown
[0]
Hi everyone, my name is Kevin.
[1]
Today I'm going to show you how you can create聽
pivot tables in Microsoft Excel to do some聽聽
[6]
pretty amazing analysis and as full disclosure聽
before we jump into this, I work at Microsoft.
[10]
All right, well what are we waiting for?
[12]
Let's jump into it. Here I am on my desktop聽
I'm going to open up Microsoft Excel.
[16]
The version that I'm using this is the latest聽
version of Excel, but if you have Excel 2019,聽聽
[21]
2016, 2013, you name the version, you should聽
be able to follow along with this tutorial.
[25]
So what I wanted to do is I wanted to聽
come up with a fun example and so today聽聽
[30]
I'm going to pretend that I'm a used car dealer聽
so I have a spreadsheet called car inventory.
[34]
I'm going to go ahead and open that,聽
and one thing I want to do is first聽聽
[37]
kind of help orient you to the data聽
that I have in this spreadsheet.
[40]
So what I have here is this is my this聽
is my inventory of cars that I have.
[45]
As you can see, I have 24 vehicles in my lot and聽
it's a mix of different makes. I have Hondas,聽聽
[52]
I have Toyotas, Nissans, Chevrolets, all sorts of,聽聽
[55]
and then I have many different models Accords,聽
Camrys, Altimas, a variety of colors of vehicles.
[61]
I think black and silver tend to be聽
the most popular cars, so hopefully聽聽
[65]
I have a bunch of those in my inventory. Then聽
I have the different mileage amounts, so some聽聽
[69]
of the cars have a little bit higher mileage.聽
Some of them have a little bit lower mileage,聽聽
[72]
so kind of a nice little mix here. And then I聽
have various price points. Now for the price,聽聽
[77]
this is what I believe I can charge for the聽
vehicle so I've listed that. I've been working聽聽
[82]
in this car business for a while so I have聽
a pretty good sense for what these cars will聽聽
[86]
sell for. And then lastly this is what I paid for聽
the vehicle, and so you can see what my margin is聽聽
[92]
here. I got $1,000 bucks on the car. If I could聽
get the $4,000 because I only paid 3000 for it.
[97]
Hey everyone, got to make a living so I聽
need to get a little bit of a margin there.
[100]
So this is my data here and now what I want to聽
do is I want to do a whole bunch of analysis.
[104]
I want to figure out, hey, what is my total聽
profit margin across all of these cars?
[108]
You know how many how many red cars do I have?
[111]
Or how many Hondas do I have?
[112]
I have all these different questions聽
about my data and I want to analyze it.
[116]
Now what I could do is I could write a聽
whole bunch of formulas like if I want to,聽聽
[120]
you know, figure out what my聽
margin on this vehicle is,聽聽
[122]
I can answer a quick formula,聽
but that takes a lot of time.
[125]
Pivot tables, simplify analysis and聽
really make analysis a lot faster.
[130]
In my job at Microsoft, I use pivot tables all the聽
time and it helps me to analyze data much quicker.
[137]
And so today I want to show you how I do that. So聽
what we're going to do is I have the data here.
[141]
We're going to go up to the聽
top bar and click on insert聽聽
[144]
and you'll notice this option called pivot table.
[147]
I'm going to go ahead and聽
I'm going to click on that,聽聽
[149]
but before I do that I want聽
to show one other option,聽聽
[151]
there's also an option called recommended聽
pivot tables, so if I click on recommended聽聽
[156]
pivot tables, this is Excel recommending聽
different pivot tables based on my data.
[160]
So here they have a bunch of things like I could聽
see the sum of the mileage by the different makes,聽聽
[164]
and here I could go through, and I could聽
see some samples that they've setup. So聽聽
[169]
kinda neat thing that could help you聽
really simplify pivot table creation,聽聽
[172]
but today I want to show you how you can聽
create your own pivot table from scratch.
[175]
And So what I'll do now is let's聽
click on this pivot table button.
[179]
What it's doing is by default it聽
selects this table of data that I have.
[184]
It's already pre-selected it.
[186]
I could also change the selection if I want to,聽
but Excel has done a good job of picking it,聽聽
[190]
and then I could choose do I want a new worksheet聽
or do I want to put it on an existing worksheet?
[194]
I'm just going to create a聽
new worksheet with this data.
[196]
So I don't want to change anything here.
[198]
All this looks good.
[199]
Typically, when I get this, I just聽
click on OK right away. All right,聽聽
[202]
well here I am, this is the main pivot table view.
[205]
It looks a little intimidating at first.
[208]
You have a bunch of different聽
controls on the right-hand side,聽聽
[210]
you have this other thing聽
that says to build a report.
[213]
So let's walk through how to do it. So you have聽
a few different options here. You have filters.
[219]
This is if you want to filter your聽
data by any one of these fields.
[222]
You have your rows, which is rows going down聽
a sheet and then you have your columns which聽聽
[227]
are going across the sheet and then you聽
have the values associated with that.
[230]
Well, why don't we do a real example聽
and then you could see how these work.
[233]
I want to know how many cars do I have by make and聽聽
[236]
model and then by color. It鈥檇 be just聽
to get a sense of what my inventory is.
[240]
So the first thing I could do is聽
I could click on these different聽聽
[243]
items and then I could drag it into聽
these different boxes down below.聽聽
[247]
So I'm going to take make and I'm聽
going to drop it in the rows column.
[250]
So here now I get a quick view of all the makes聽
that I have on my lot. So I have Chevrolet,聽聽
[255]
Dodge, Ford, Honda, Nissan and Toyota. Now what聽
I could do is I could also click on the model,聽聽
[260]
and I could drop it down there and now I could聽
see the make and each of the models under聽聽
[264]
that make and what's kind of nice is I could聽
expand and collapse these different sections.
[269]
I could also collapse all the fields,聽聽
[271]
or I could expand all of the聽
fields using these buttons up here.
[274]
I'm going to drag the color over to the聽
columns and so now here you see I have a聽聽
[280]
table of the makes, the models, and the聽
colors and now I want to get a count.
[284]
So what I'm going to do is I'm going to take聽
makes and I'm going to pull that into values聽聽
[288]
and so now what this has done is it's set it聽
to count and now I can see count by vehicles.
[293]
So here, once again I'm going to collapse it, so聽
here you can see for Chevrolet I have 1 green,聽聽
[298]
1 silver and 2 white vehicles,聽
for a total of 4 vehicles.
[303]
And what I'll do is I'll go聽
ahead and expand this again,聽聽
[307]
and now I could see that, you know, by聽
the different models, what colors I have.
[312]
So kind of a very quick way to聽
visualize my data without having聽聽
[316]
to go through the spreadsheet and聽
filter or enter different formulas聽聽
[320]
to get this data. With a pivot table聽
I can just just do that automatically.
[323]
OK, let's say that I want to know what my聽
profit margin is on my different vehicles.
[328]
So what I'm going to do is I'm聽
going to move the model out.
[331]
I'm going to move the make out.
[332]
I'm going to move the color out and I want to know聽
my margin by make. And so what profit margin is,聽聽
[339]
it's the price minus the cost, so I'm聽
going to pull the price in. Here you see,聽聽
[344]
this is basically what I expect to get if I聽
were to sell all of these models. So once again,聽聽
[349]
I'm going to pull the let's pull the make聽
in again. So here you can see that I have聽聽
[355]
my 4 Chevrolets and I believe that I could聽
collect $14,500 and what I'm also going to do聽聽
[361]
is I'm going to pull in the cost and so聽
here you can see you know I expect to be聽聽
[364]
able to pull in about $14,500, and to buy聽
all these vehicles, I had to pay $13,000.
[369]
So what I could do now is if I want to聽
figure out the margin I'm going to click聽聽
[373]
on this thing that says fields, items and聽
sets and I'll insert a calculated field.
[377]
All a calculated field is, it's basically聽
doing a formula on different columns in the聽聽
[381]
pivot table. So I'm going to click on calculated聽
field and then I'm going to call this my profit.
[386]
Profit margin and for the formula what聽
I want to do is I want to do the price聽聽
[392]
I'm going to insert the price and聽
then we're going to subtract the聽聽
[395]
cost and I'm going to insert the聽
cost and I'm going to add this.
[397]
What you'll see is it just added聽
this as a field to my pivot table,聽聽
[401]
so I'm going to click on OK and now it's聽
automatically added this to my table.
[405]
So now you can see that I have 4 Chevrolets.
[407]
I believe I could collect this.
[408]
This is my cost.
[409]
And then here's my margin.
[410]
What's nice too is I could see well,聽
what make has the biggest margin?
[414]
What you know, I could look through聽
this and figure out which ones the聽聽
[416]
largest or I can right click here, go聽
to sort and I could go from largest to聽聽
[420]
smallest. So here I can see of my 5 Honda聽
vehicles I expect to make about $3,468.
[426]
So that's my biggest margin that I have. So once聽
again, pivot tables make analysis super easy.
[431]
Now let's say that I wanted to know聽
the average cost of my vehicles.
[436]
So let me, I'm going to pull聽
some of these values out.
[438]
I'm going to get rid of the make and to get rid of聽聽
[441]
the profit margin. So let's say for聽
these different cars like Chevrolet,聽聽
[444]
Dodge, what was the average price that聽
I paid when I bought these vehicles?
[447]
So here you'll see that this is聽
currently set to the sum of the cost.
[451]
What I could do is if I click on value fields聽
settings, I have all these different options,聽聽
[455]
so instead of just looking at the sum of all that聽
I paid for these vehicles, what I could do instead聽聽
[459]
is I could say the average. I'm going to click聽
on OK and now this changes it to the average.
[464]
Now, one thing I'm going to do just make it聽
easier to read is let's add dollar signs in. So聽聽
[469]
here what this is saying is for my Chevrolet's,聽
I paid an average of $3,250 for each vehicle聽聽
[475]
and for my Hondas I paid $2,500 and you can聽
see on average how much I paid per vehicle.
[480]
So once again, what I do there, is I go to聽
value field settings, and I could change it.
[485]
You know sum, count, many different聽
options in this list here.
[489]
Now the next thing that I want to do is I聽
have my 24 cars in my inventory. I want to聽聽
[493]
know what percentage I have of each color,聽
so I want to know what percentage of my cars聽聽
[497]
are red versus black or silver. So what聽
I'm going to do is let's go back and I'm聽聽
[502]
going to drop color in the row field, so聽
we're going to drop that in and then I'm聽聽
[507]
going to pull color here and then I'm聽
going to get rid of the dollar sign.
[514]
So what you can see is I have 6 black cars. I聽聽
[518]
have 6 silver cars. I'm going to sort聽
this from largest to smallest again.
[522]
So here you can see I have 6 silver, 6 black聽
and then 3white, 3 blue, 3 red, and 3 green.
[527]
But let's say I want to know the聽
percent of silver cars that I have.
[531]
What I can do here is I'll right click on this and聽聽
[534]
I'll do show values as and I have all聽
these different options in this list.
[538]
What I want to know is I want to know聽
this silver. So in this column this six,聽聽
[543]
what percentage is that of the total?
[545]
So once again, I'm going to go back to show聽
values as and I'm going to say percent of聽聽
[549]
column total and so now what I could see is聽
my silver cars make up 25% of my inventory.
[555]
My black cars make up 25% of my inventory and聽
so on and so forth. So there you know I could,聽聽
[561]
I could show the values as percentages.
[563]
They have lots of different options that you聽
could do so you can play around with that. So聽聽
[567]
what I want to do now is when you look at your聽
data, seeing it in a table format. That's one聽聽
[572]
way to read the data, but sometimes it's nicer to聽
be able to see a graphical visualization of it.
[577]
So what I'm going to do now is I'm聽
going to click on analyze again,聽聽
[580]
and then there's an option that is a pivot chart.
[583]
I'm going to go ahead and insert a pivot chart.
[585]
I'm going to go with columns.
[586]
I can choose many different chart聽
types, but I'm going to go with columns.
[589]
And here what you can see is this is聽
a column chart of my car inventory.
[596]
So here I could see you know 6 silver, 6聽
black, and then I could see the rest of it.
[600]
So just a visual way of my table.
[602]
And the really interesting thing is, you聽
know here what I could do is I could,聽聽
[606]
I could drop in different values into my pivot聽
table and then I could see you know the chart will聽聽
[612]
just automatically update based on what fields聽
I drop into my pivot table. So it's a very nice聽聽
[618]
and easy way to pull together kind of a visual聽
view of your data as well with pivot tables.
[622]
One other thing that I want to聽
call out is you have this option聽聽
[625]
that says defer layout update on the bottom.
[628]
What does that mean?
[629]
Well, with defer layout update, as I聽
pull items in and out, you'll see that聽聽
[633]
it doesn't update my table and it doesn't聽
update the chart until I click on update.
[638]
So here if I pull the color out and then click聽聽
[640]
update now it'll update only聽
after I click that button.
[643]
Why would you ever use that?
[645]
Well, especially when you're聽
working with very large data sets.
[648]
So let's say you're working with a聽
million or two million rows of data.
[651]
Every time you drag and drop聽
something into a pivot table,聽聽
[654]
it's going to take your computer time to process,聽聽
[656]
because it's doing a lot of calculations聽
based on how you set up your pivot table.
[660]
And so this way you can make sure聽
that you have your set up good聽聽
[665]
before you make that update. So it just聽
helps speed up the process of editing.
[667]
Now I created this pivot table聽
and what I also want to show now聽聽
[672]
is not only is this available in聽
Excel that I have on my desktop,聽聽
[676]
but also in Excel online and one of the cool聽
things is Excel online is actually free to use.
[682]
I am in my Excel online. I'm in my office.com聽
so I've gone to office.com. I've logged in,聽聽
[687]
by the way, it's free to log in. If you're a聽
paid user or a free user, you have access to聽聽
[691]
this. And so here I see my recent document list聽
and my most recent spreadsheet is car inventory.
[697]
So I'm going to go ahead and click on that.
[699]
Now what it's doing is it's opening it in聽
Excel online and what's nice is I have this聽聽
[703]
file stored in OneDrive, so I edit it on聽
my desktop and it automatically saves to聽聽
[708]
OneDrive and now all my changes that I聽
just made are available in Excel online.
[711]
So I'm going to click on sheet one聽
because that's where the pivot table is.
[714]
But here you can see my car inventory. I have聽
that exact same data available here online.
[718]
I'm going to click in the sheet one and then聽
here you'll see I have my pivot table and I聽聽
[723]
have the chart that I inserted on desktop Excel聽
and you know here in the online version what I聽聽
[728]
could do is I could go to insert. I could just聽
as easily insert a pivot table and then here聽聽
[732]
I could just as easily manipulate my data聽
just like I could in Excel on the desktop.
[737]
So whether you want to use it on the web.聽
Whether you want to use it on the desktop.聽聽
[740]
Pivot tables are very accessible and聽
you could use them in either place.
[744]
That was a quick overview of pivot tables.
[746]
They're not nearly as intimidating聽
as you think they are, and really,聽聽
[749]
the best way to start playing around with聽
the pivot table is just to start dragging聽聽
[753]
and dropping things into columns, into rows,聽
into values, and just to play around with it.
[757]
It's a very powerful way to visualize聽
your data and to understand your data.
[763]
In fact, in Excel I very infrequently聽
now enter formulas, I very infrequently聽聽
[768]
enter functions because with pivot tables I聽
could already do most of my analysis there,聽聽
[772]
so there's less of a need to do all these聽
other formulas. And in terms of analyzing聽聽
[777]
complex data or even simple data, pivot聽
tables do a great job at doing that.
[781]
In my job at Microsoft, it's helped聽
me tremendously in terms of analyzing聽聽
[785]
data and understanding data and making聽
business decisions based on your data.
[789]
Anyway, I hope this tutorial is helpful聽
using pivot tables. Hopefully this helps聽聽
[795]
you creating your own pivot tables. If you聽
enjoy this content, please give it a thumbs up,聽聽
[800]
that always helps reaffirm that the content聽
that I'm creating is valuable. And if you want聽聽
[804]
to see future content like this, please聽
hit that subscribe button and that way聽聽
[808]
you'll get a notification anytime聽
new content like this comes out.
[811]
That's all I have. Thanks for tuning聽
in and I'll see you next time, bye.
Most Recent Videos:
You can go back to the homepage right here: Homepage





