Pivot Tables in Excel are one of the most powerful tools, and once you understand how they work, they’re actually quite easy to insert and modify. In this example we’re going to work with a small amount of data for illustration purposes, but Pivot Tables are in their element with huge amounts of data laid out in a columnar format.
Forget Filters and Subtotal, Pivot Tables can do both of these and more in a few seconds.
Note: if you’d prefer to watch a video tutorial on Pivot Tables that will teach you how to create Pivot Tables, choose fields, Pivot Table Design, filtering Pivot Tables, Modify Pivot Table data, and insert Pivot Charts sign up for our Microsoft Office Online Training
OK, looks like you’re happy to read the tutorial…..take the data below for example.
![]() |
Let’s say we wanted to SUM the number of viewers by program, going down the rows, then by Region going across the columns and only show Q1 (you can’t see it here but there is data in this table for Q1 through to Q4). The easiest solution is to insert a Pivot Table like this:
![]() |
Note: In the above example we summed the viewers, but instead of, or in addition to SUM, we can COUNT, AVERAGE, PRODUCT and more.
We can also change the formatting and customise the default ‘Row Labels’, ‘Column Labels’ and ‘Sum of Viewer’ headings to make the report more polished. We’ll get to that soon.
How to Insert a Pivot Table in Excel
Download the workbook and practice as you go.
1) Click anywhere in your data
2) On the ‘Insert’ tab click the ‘PivotTable’ button and select ‘PivotTable’.
![]() |
3) The Create PivotTable dialog box will open.
![]() |
a. Excel will automatically select the range of data, but you can change this here if you need to by modifying the range in the Table/Range field. You can even choose an external source but for most people using your own data will be all you want, so we’re not going to cover that here.
b. Tell Excel if you want your Pivot Table in a New Worksheet or in the Existing Worksheet. If you choose Existing Worksheet you will need to tell Excel the top left cell that you would like your Pivot Table to begin in. If you choose New Worksheet Excel will insert a new worksheet in your file and insert your Pivot Table there.
4) I’ve chosen to insert my Pivot Table in cell F2 on the sheet where my data is for this tutorial. Below is how your worksheet will look after step 3. In the right hand section of your screen the Pivot Table Field List window will open and a place holder will be entered beginning in the cell you’ve chosen to insert your Pivot Table, in my case F2:H19.
![]() |
5) The first thing you need to do is choose the fields you want included in your Pivot Table Report. We do this in the Pivot Table Field List window.
![]() |
a. By ticking the Fields from the list you can tell Excel which fields you want in your Pivot Table report.
b. By default it will add any labels to the ‘Row Labels’ area, and any columns it detects as values will go into the ‘Values‘ area. To move them, simply drag and drop the fields to the area you want.
c. If you’re inserting your Pivot Table on the existing sheet you will see it take shape as you make your selections in the PivotTable Field List.
6) To insert the Pivot Table shown in the above example, and below, my PivotTable Field List looks like this:
![]() |
You can see I’ve set the Period Q1 (cell G1) as a ‘Report Filter’, the programs are my Row Labels, the Regions are my column labels and the Sum of Viewers are my Values.
Ok, so now you’ve inserted your Pivot Table, let’s look at how we can customise it.
Pivot Table Styles
In Excel Pivot Table styles enable you to make your Pivot Table cool with very little effort.
You’ll notice you now have two new tabs in your Ribbon. Go to the Design tab and here you can choose from a huge range of predefined styles. You can even save your own in keeping with your corporate image.
![]() |
Just look at how much more professional mine looks with a few clicks of the mouse.
![]() |
I’ve also changed my ‘Row Labels’ and ‘Column Labels’ headings by typing new names directly into the cell.
Preserve PivotTable Formatting
You can also format your Pivot Table Report manually using the Fonts etc. on the Home tab of the Ribbon, plus you can resize columns and rows.
If you do this there are a few preferences you should set so that your formats aren’t lost on refresh.
1) Right click anywhere on the Pivot Table. Select ‘PivotTable Options’. The following dialog box will open. Make sure you tick the ‘Preserve cell formatting on update’ preference and ‘Autofit column widths on update’ is NOT ticked.
![]() |
Change Pivot Table Value Calculation from the default SUM
Remember at the beginning I said in the Values you aren’t limted to just SUM. You can also COUNT, AVERAGE, PRODUCT and a few more.
By clicking on the down arrows beside the Report Filter, Column Labels, Row Labels or Values areas you can access tools that will allow you to modify the settings. This is also where you can change whether the Values are SUM of, COUNT of, AVERAGE of and so on.
![]() |
To change the VALUES from the default, select ‘Value Field Settings’ from the list by clicking the down arrow beside, in our case, Sum of Viewers.
The ‘Value Field Settings’ dialog box will open and you can choose a different calculation from the list on the ‘Summarize by’ tab as shown below.
You can also give the field a custom name.
![]() |
Note: you can have more than one value in your Pivot Table. For example, you might want to SUM and COUNT the values. Simply drag the field you want from the ‘Choose Fields to add to report’ list in the Pivot Table Field List into the Values area and alter the Value Field Settings as listed above. (See the next section for instructions on how to add another value with screen shots.)
Insert a predefined calculated field to your Pivot Table
You can enhance your Pivot Table by inserting a calculated field. Excel has a list of predefined calculations you can select from. Note: You can also insert a custom calculated field, but we’re not going to cover that here as I think these are better added to your source data and brought into your Pivot Table as a field. It’s less prone to error with this approach.
To insert a calculated field from the predefined list available:
1) First you have to add another Value field to your Pivot Table by dragging, in our case, ‘Viewers’ from the ‘Choose fields to add to report’ section down to the ‘Values’ area. You’ll notice that Excel will put a Values field in the ‘Column Labels’ area as well as the Values areas. This is because it’s performing the calculation for each column of data. You can change it to calculate for each row by dragging it to the ‘Row Labels’ area.
2) Open the ‘Value Field Settings’ dialog box (click the down arrow and select it from the list) and select the ‘Show values as’ tab.
3) From the drop down list you can choose the type of calculation you want.
4) Give your calculation a custom name before clicking OK.
![]() |
In my example below I inserted a ‘% of total’ field and gave it the custom name ‘% of Viewers’.
![]() |
Filter Pivot Table Data
What say we wanted to only show data for a few of our programs? We can filter our row labels by clicking on the down arrow beside ‘Row Labels’ in our Pivot Table. And just like regular filters we can instruct Excel to only display the values we choose.
![]() |
Note: in this filter we can also sort our PivotTable row labels.
![]() |
Filters can also be applied to column labels.
Changing the Orientation of your Pivot Table
You can have more than one field in each area. For example, what if we wanted to see the data grouped by region down the rows? Our Pivot Table would look like this:
![]() |
Simply rearrange the fields in the Pivot Table Field List by dragging and dropping the fields to the area you want.
Pivot Table Tools
You will also notice you now have two new tabs in the Ribbon for Pivot Table Tools; Options and Design.
![]() |
There’s too much to work through all of the features here but free video tutorials are available. Simply sign up for our free Microsoft Office Online Training and watch the video tutorials on Pivot Tables to learn how to create Pivot Tables, choose fields, Pivot Table Design, filtering Pivot Tables, Modify Pivot Table data, and insert Pivot Charts.
Pivot Table Source Data Rules
1) No blank rows or columns.
2) Each column must have a heading. This heading will be carried over to label your Pivot Table rows and columns.
3) Make sure your source data is formatted correctly. That is if they’re dates, format them as dates and so on.
4) If the Pivot Table Field List disappears click anywhere on the Pivot Table and it will reappear.
Download the workbook and practice what you’ve learnt.
Did you find this useful, or did it open a can of worms? Let us know by leaving a comment.
Share the knowledge with your friends and colleagues on Twitter, Facebook etc. using the shortcuts below.
Want more? Sign up for our newsletter below and receive weekly tips & tricks to your inbox, plus you’ll get our 100 Excel Tips & Tricks e-book.




















... I would highly recommend My Online Training Hub for all your Microsoft Office needs .... Geniuses



{ 66 comments… read them below or add one }
great diagrams, makes it v clear. thanks
oww. my head hurts. I knew about pivot tables but have never really used them, but will read through this again and do some test scenarios.
thanks
J
is it possible to delete certain cells from a column of a pivot table and insert your own formula?
The short answer is no. You can however add a custom calculation column with your own formula, or you can add a column to your source data that contains the custom calculation you want to include.
can pivot tables count the times names/words appear in cells of rows or columns rather than count or sum numbers
Hi Karen,
Thanks for your question.
PivotTables can count the instances of the same text string. A text string can contain one word or many. However they can’t single out a word from a text string and count it.
For example:
Cell A1: The quick brown fox jumped over the log
Cell A2: The quick brown fox jumped over the log
Cell A3: The quick brown fox jumped over the big log
A PivotTable would count 2 instances of “The quick brown fox jumped over the log” and one instance of “The quick brown fox jumped over the big log” but it couldn’t count how many times the word “brown” appeared.
Formula solution:
To count the instances of “brown” you could use the following array formula (where cell B2 contains the word “brown”):
=COUNT(IF(FIND(B2,A1:A3)),1,”"))
Remember: because it’s an array formula you need to enter it with CTRL+SHIFT+ENTER for Excel to calculate the result correctly.
Kind regards,
Mynda.
I found the website very productive and supportive. I can’t stay without appreciating the site.
Helpful tutorial – thanks
Thanks Lori
Glad you liked it.
Kind regards,
Mynda.
thnnx
Pivot table sorts the row labels in alphabetical order. How can I customise this eg. show
wiggles
bat man
night garden etc
Thanks
Hi lc,
You can manually customise the order of your row labels:
1. select the cell containing the row label you want to move
2. move your mouse to the bottom edge of the cell until your mouse pointer changes to a 4 sided arrow.
3. left click your mouse and drag your row label to the new position.
Now when you refresh your PivotTable it will keep your order.
Kind regards,
Mynda.
thanx, its realy help us too co op up in the copreate world
1. I am collapsing rows but this feature automatically collapses rows that contain the same information. Can this feature be turned off.
2. For some reason when I save my pivot table and reopen all my filters change to all and information is lost.
Hi Sara,
I’d say there are some settings in your PivotTable Options that are the reason for these issues. To edit your PivotTable Options right click anywhere on the PivotTable and select PivotTable Options.
Otherwise without seeing your file I can’t tell what the cause is.
I hope that gives you some direction.
Kind regards,
Phil.
I would really appreciate if i will be able to learn pivot table with the assistance of this site.thanks.
When I try to download the workbook from the lessons, I’m only getting the the XML language, not the actual Excel file.
Can you give me some help. I don’t know how to work in the XML format nor I’m I a programer.
Thank you
Peter
Hi Peter,
Your browser is changing the file extension. The file is an Excel workbook so the file extension is .xlsx
Make sure when you choose ‘save file as’ (or similar depending on your browser) that you ensure the file extension is .xlsx and all should be fine. If not let me know via the Contact Us page and I’ll email it to you.
Kind regards,
Mynda.
When I create a pivot table with multiple Entries under Row Labels (for example Item Number and description), I can get them to be together by choosing field settings / Layout & Print / Show item labels in tabular form. The problem is that it does not replicate the first item (in this example Item Number on every line but leaves the line blank if it’s a duplicate. How can I get the table to fill in every line even if it’s a duplicate?
Thanks,
Joe
Hi Joe,
This is one of the limitations of PivotTables pre Excel 2010. If you’ve got Excel 2010 then you can edit the Field Settings > Layout & Print tab > Repeat item labels.
If you don’t have Excel 2010 then your only option (aside from buying it) is to copy and paste the PivotTable as a value, so that what you’re left with is no longer a PivotTable.
> hightlight the range you want the labels repeated in
> CTRL+G to open the Go To dialog box
> Press the ‘Special ..’ button at the bottom of the Go To dialog box
> Select ‘Blanks’ OK
> Press = then press the up arrow, and then press CTRL+ENTER.
This will populate your blank cells with the data from the cells above.
I hope one of those options is suitable.
Kind regards,
Mynda.
Thanks very much for your help. I’ll look forward to getting 2010 but in the meantime try what you have suggested.
Hi I am wondering whether you know if the data source for a pivot table can have 2 HEADER ROWS? I am desperately trying to work out how to do this.
Thanks
Hi Susan,
As far as I’m aware you can’t have 2 header rows. PivotTables use the header row to create the list of fields. The second row in your table is interpreted as part of your data.
Kind regards,
Mynda.
this is good, but in pivot table we raise any iformation then format. if you show tips pivot table with dashboard report
Hi Abdul,
I don’t like to use PivotTables in a Dashboard report as I find them too inflexible and chunky most of the time. I prefer to use them for my analysis and then link to the PivotTable results from my Dashboard. You can see some examples of my dashboards in our Dashboard Course.
Kind regards,
Mynda.
I downloaded the zip file but I am not sure which fo,lder or file I am supposed to click on or open to get the sample workbook. Al the files in the zip folder have an .xml extension.
Hi Jennifer,
The file that you download is not a zip file, it’s an Excel file with a .xlsx file extension. If you hover your mouse over the link you can see in the bottom right/left corner of your browser that the file extension is .xlsx
Some browsers, including Internet Explorer, change the file extension to a .zip when you save the file. All you need to do is download the file again except at the ‘save file as’ window (or similar depending on your browser), change the file extension by deleting the .zip and inserting .xlsx
Once downloaded you should be able to open the Excel file as you would any other Excel file.
Kind regards,
Mynda.
Hi! I would like to know why the fields of a pivot table I create show up as rows beneath another row instead of columns.
My fields are dates, proposal numbers (5 digits), name of the salesmaner, the proposal amount and the description of what was sold. Instead of having 5 columns, rows show up. I would prefer 5 column headings not 5 rows which show up in hierarchy.
Thanks.
Lita
Hi Lita,
If you want fields to show up as columns then you need to drag the field into the Column Label area. If you click the check box to choose your fields Excel will insert them where it thinks they fit best. I like to click and drag them into the area I want them in.
I hope that helps.
Kind regards,
Mynda.
Hi
Excellent presentation. Very Very useful. Thanks a lot.
You’re welcome, Srini.
great site, easy to follow and very easy to understand.
Hello. I just came accross this website and I am finding it very helpful!! Great tips and all are explained really well. I have a question which I hope you can help me with – my apologies if this has been asked and answered before. If you receive a list which has the information that you want to filter by only listed at the very top and not on each row is there any way of getting this information on every row without copying and pasting the information to each row?
I have an example included below which I hope shows up correctly. So I want to be able to filter by the title ‘ABB001, CustomerA’ but that only appears in one row and all of the sales invoices details for this customer and in the rows after it. Is there any quick way of getting ABB001,Customer A on each row without copying and pasting it down? And is it possible that whatever formula might help with this would also be able to work the whole way down through a list – so would put ABB001,Customer A beside the first 3 rows and then recognise the break to customer ABB002, Customer B and change to pasting ABB002, Customer B to the next rows that relate to Customer B? The lists I am dealing with usually have thousands of line items with hundreds of customers and it would be great if there was someway to do this quickly.
Our Ref Your Ref Trans. Date Total
ABB001, Customer A
SI001 1 12/09/2012 100.00
SI002 2 12/09/2012 100.00
SI003 3 12/09/2012 100.00
ABB002, Customer B
SI009 21 12/09/2012 100.00
SI010 22 13/09/2012 100.00
SI011 23 14/09/2012 100.00
SI012 24 15/09/2012 100.00
SI013 25 16/09/2012 100.00
I hope this query makes sense and any help you might be able to provide would be greatly appreciated!!! Thank you
Hi Ruth,
Thanks for your kind words.
Let’s say your data starts in cell B1 with your headers. In column A, which is blank, you can enter the following formula starting in cell A3:
=IF(ISBLANK(C2),B2,A2)
Copy it down > paste column A as values > sort data to group blanks and customer numbers in column B together and delete them.
I hope that helps.
Kind regards,
That worked!!! Thank you so so much
You have just saved me hours of work
I know how to pivot, but now I need to filter and pivot the same data source between a set of dates and a set of values. For instance. date – anything less than 9/01/12 and values, price – anything less than $5000.00. I have been stuck on this database for quite some time and would greatly appreciate any help you can give me.
Hi Gina,
You can use the filter buttons on the PivotTable to filter the dates and then the values. If you’re stuck you can send it to me and I’ll take a look.
Kind regards,
Mynda.
I couldn’t download the workbooks. Was really looking forward to practicing with them. I like the way you explain the pivot table process. Good job!
Cheers, Erick.
Sorry you couldn’t download the workbooks. This problem usually occurs with Internet Explorer. It changes the file extension to a .zip file but the actual file extension is .xlsx
Perhaps you can try to download them again and at the ‘save as’ screen make sure the file extension is .xlsx before saving.
Kind regards,
Mynda.
Why use pivot tables when information could simply be copied and pasted to a new list?
Hi Michelle,
PivotTables summarize the data. They aren’t simply a duplication of the original underlying data therefore copying and pasting source data wouldn’t achieve the same as a PivotTable.
Kind regards,
Mynda.
Hello,
The example charts are missing beginning at #5 and below. Once you put the examples on the screen, the information will be even more helpful.
Thank you!
Hi Erika,
I’m not sure what you mean by ‘example charts’. This is about PivotTables not charts. Do you mean images? If so I can see several images below point #5. Can you please be more specific about where information is missing for you.
Thanks,
Mynda.
Hi Mynda… GREAT SITE!!
i’ve been working with large data set and using pivot tables… one thing that would really help is to do other calcs on these data sets. specifically, i’m trying to get median value from a specific subset (filtered).
for example, I filter out all entries that are <1mi distance, and from those results of the filter, i want to determine median value of a specific column (i.e., sale price).
is there a way to calculate median based on criteria without recreating the data table and doing the manual calc of =median() for a column of that data table?
thanks!
Hi Quel,
I tried but when in times like this one, I usually suggest VBA.
So why don’t you send that file to me through HELP DESK and I’ll solve
your problem.
Cheers.
CarloE
I’ve used pivot tables to analyze large amounts of data. However, I am wondering if there is any way to use something similar to a pivot table or formulas to add repetitive data to a table so I don’t have to manually copy it. I have approximately 19,300 rows of data and I am trying to organize by groups of similar data based on the NAIC code. The fields I want to populate are: [a]Segment number (2-digit number to identify the segment), [b]Segment description, [c]NAIC code (this is a 2 to 6 digit number which identifies a product or service) and [d]NAIC description. Columns [c] and [d] are provided. I want to groupd these columns and add the repeating data in columns [a] segment number and [b] segment description. I started with an IF formula as follows: =IF(C49<119999,"11"," ") which retuned the segment number "11" for everything with a code from 11-119999. However, there are hundreds of rows that fall in this range. There are also thousands of rows with codes from 11 through 922180. The first two digits represent the segment. Is there any way to apply the formula to the entire column and pull out the specific 2-digit segment number to place in column [a] other than repeating the formula for each group of numbers and copying the formula over the many rows which isn't very automated. HELP!!!!
Thanks,
Cheryl
Hi Cheryl,
Maybe you need to use LEFT function.
Try this one.
However, I really did not quite get what you were asking here.
So I suggest you send your file via HELP DESK if you have further clarifications.
Cheers.
Carlo
excellent presentation!
Thanks, Karen
That was very useful! it does not however help me. I need to show the values as they are rather that a count or a sum. I have a list of dates and names with a score (1 – 4) i need to show in date order that score each name got – some names have more than 1 score per day! Can anyone help me with this?
D
Hi Daniel,
I have here a not so elegant solution. In your source data/table, you should add one more column.
The column is for creating a uniqueness to each of your score within the day. You may do this
by adding 1 to the first entry in that column then in the second entry of that column
add a formula like =D2+1 then get the handle and drag it down to the last entry– I think you know
this already.lol
To illustrate using our given example: I added the column ‘Index’.
Now, you add the Period to the Report Filter, The Region to the Columns,
Add Index(As Count) and Program to Row Labels, and Viewers to Values.
PT would look like this.
It’s not elegant but It will give you the results. Be sure to sort your tables properly before
putting that unique index.
Cheers.
CarloE
PS: In your case, you might want to add Names and the Index as Count to the row Labels. Dates to your Report Filter perhaps.
Very useful website, explain in clear concise terms. One minor area which I encounter is the control of the Value field when I want it to go across as a series of sum of’s… but it seems to insist on going down the column leaving only a single total column. Maybe others have asked about it too.
Regards
John
Hi Jack,
I suspect you don’t have column labels.
To avoid this, you must put your column label ahead
of your values when setting up pivot tables.
Cheers.
CarloE
It’s such a great help. Thanks a lot.
Hi Susan,
On behalf of Mynda, You’re welcome.
Cheers.
CarloE
gosh. These were very good examples. I am looking forward to your Pivot Tables explanation. Microsoft should hire you! Thank you very much!
Hi Madalene,
On behalf of Mynda,
You’re welcome!
Cheers.
CarloE
Thank you very much!
Hi Nguyen,
You’re welcome on behalf of Mynda.
Cheers.
CarloE
Hi
This was really useful and in the main, pretty clear. I’m sure if I practiced it would all seem very obvious very quickly but I never seem to have a working example when I need one and then when I do have an example, I’m not sure it’s a pivot table I need to solve the problem. My main issue is terminology – I still think I’d struggle with a “cold” exercise (nothing to copy) with deciding what to put in each “Field”. Also, in this example I went with the table range that it auto selected but I’d really like to know how to choose this.
However, overall, very grateful for the course and I will store the link somewhere for future reference and practice!!
Hi Nicola,
On behalf of Mynda,
You’re welcome!
Cheers,
CarloE
Hi,
Could you please help me how we can use Getpivotdata and its uses . I have a standard download for sales.
Thanks
Nishal
Hi Nishal,
The GETPIVOTDATA function extracts data stored in a PivotTable. Unfortunately I don’t have any free tutorials I can point you to at this stage but here is some information from Microsoft.
I hope that helps.
Kind regards,
Mynda.
Very useful and so accessible. Thanks a lot
You’re welcome, Elkhan