Jul 24, 2009 at 7:02am ET by Josh Dreller
In the previous posts of this Excel series for Search Engine Marketers (Part 1, Part 2, Part 3, Part 4), I’ve shared various tips and tricks for the tool. However, today’s post is just going to cover pivot tables, as I feel they are such an important piece for online marketers to not just grasp, but master. Excel itself can be intimidating and pivot tables are doubly so. I hope this will be the definitive guide to pivot tables for anyone in this industry who has yet to feel one hundred percent comfortable with this crucial Excel feature.
By the time you finish this post, you will be a Pivot Table champ (or your money back! LOL.)
The first thing to understand is why you would need to put your data in a pivot table. Well, not all data needs to be pivoted. However, when you have a table of data that you’re trying to analyze, pivot tables allow you to quickly extract meaningful information by easily changing columns, rows, and filters to get those useful insights.
Here’s an example Google Adwords Placement/Keyword Performance Report for a fictitious company called MapWiseTech:

Ten questions you might want the data to answer could include:
These are all very common questions that any paid search professional has to answer in order to optimize their accounts. For those of you who aren’t consistently using pivot tables to collect this data, how long would you say it would take you to answer these questions for your accounts? Let me tell you, with pivot tables, these ten questions will take you less than five minutes to answer. That’s right. Less than five minutes.
Are you ready to be a pivot table convert now?
Building a pivot table
Converting a regular data table into a pivot table is much easier than you think. Simply highlight your table, then go to the INSERT ribbon and choose Pivot Table. A Create PivotTable dialogue box will open to confirm your data source and where you want the Pivot Table generated. The default option is in a New Worksheet, but you can choose the Existing Worksheet option and pick a cell to begin the insertion.
That’s it. You now have a pivot table from that source data. From here, you just have to choose your columns, rows, and values from the Field List. Notice you now have two extra ribbons for PivotTable tools, Options and Design as well.
Drag/Drop fields to build reports you want to see
The first question was, “What Keywords get the most impressions?”. This is child’s play in a pivot table. Drag the Placement/Keyword field into the Row Labels box and the Impressions field into the Values box. Then, drag the Ad Distribution field into the Report Filter box. The pivot table is built. The last thing to do is to choose Search Only from the report filter (so you see keywords, not placements) and click on the first impression value listed and click the ZA down arrow to sort from largest to smallest.

I know you can say that you could have done the same thing by filtering the source table and sorting the impression column. However, let’s go to the next level. What if you wanted to find out which ad groups had the most impressions? An account with even just 10-30 campaigns might easily have 100-200 ad groups. You could tell me that you could go back to Adwords and pull an ad group report and then filter and sort. But that would take time. With the current pivot table, just drag the Ad Group field into the Row Labels box and you have the data you need.
It’s important that you understand there is always a lot of experimentation in pivot tables. Even for advanced users, trying out new ways to drag and drop fields into the various row, column, filter, and value boxes provide infinite ways to look at the data. It’s important for you not to get frustrated while experimenting with your pivot table. It will take time to learn, but you may actually uncover interesting ways of looking at the data that you’ve may have never considered. So, go ahead, drag and drop fields until you find the data you need.
Collapse/Expand fields
When you have multiple fields in the Row Labels box, they will be grouped in the order which they appear. So, in the example below, I now have both the Ad Groups and Keywords showing. If I just want to see everything at the ad group level, I just select one of the ad group cells and click Collapse Entire Field from the Options ribbon.


Normally, I may have a Row Label configuration such as: Engine -> Campaign -> Ad Group -> Keyword. By using Collapse and Expand, you can quickly go in and out of granularity. Each time you do, the Grand Totals will change based on what’s selected.
Why you should use the most granular data you can find
Understand that Pivot Tables will aggregate values if there’s a common connection between the data you’re looking at. For example, the pivot table knows that these 100 keywords are all in the “Branded Terms” ad group. So, even though the source table is at the keyword level, they all have “Branded Terms” listed as the ad group. The pivot table will recognize that and aggregate them together. Therefore, a best practice is always to get the most granular data into a pivot table as it will be able to calculate the higher level groups as long as these connections exist. You can even pull the source data at the day level and group them into weeks, months, and years so you can see that information quickly in your pivot table.
Calculated Fields
There’s an inherent problem when you have calculated metrics already in a source table. For SEM, the two big ones are CPC and Click Thru Rate. You can’t sum up these metrics together in a pivot table, right? So, you have to use Excel’s CalculatedFields feature.
HOW TO: Options ribbon -> Formulas -> Calculated Fields. A dialogue box opens up where you can name a new field and then create the formula to generate this new calculated field. In the example below, I’ve created a new CTR field with the formula Clicks/Impressions. You can type the formula in or just double click each field to add it to the formula box. Now you’ve got a CTR field that’s being generated at every level of the pivot table.

Naming trick: You cannot duplicate names in a pivot table. Since “CTR” already exists, my trick is to just add a single “invisible” space after each name. That way, it fools the system into thinking it’s a unique name.
Filtering
If you know how to use filters already in Excel, you can apply the same techniques to pivot tables. Click the little box with the filter icon in any row or report filter cell and you can filter the following four ways:
Formatting the table
You can format each field as you would with any column in Excel. The easiest way to choose the column and click Field Settings in the right click menu or the Options ribbon. From there you can choose whether you want the data to be summed, Counted, Averaged, etc. You can change the number format to percentage, dollar, include decimal levels or commas, as well. You can also explore the Design ribbon for setting a color scheme, banded rows/columns, when you want subtotals to appear, etc. Basically, all of the same style options you have for regular tables in Excel can be applied to pivot tables.
Pivot Charts
Pivot charts are just charts based on pivot tables. If you begin with the source data, you can choose to insert a PivotChart instead of a PivotTable. All this does is build a pivot table next to your chart. Pivot around the table to affect the chart. As well, you can simply create a chart from an existing pivot table (as you would with any data table in Excel).
Quick Tip: Select any cell in a pivot table and click F11. It will instantly create a column chart for you.
Miscellaneous Pivot Table stuff
Final Pivot Table trick: the Average Position calculated field
Unlike CTR or CPC, you can’t create a simple formula for the Average Position calculated field. Since each keyword has its own Average Position value, if you were to simple create an average to see it at a higher level such as the Ad Group or Campaign level, your numbers would be skewed. Why? Because you have to take into account the weight that each keyword has on it’s grouping level. In a simple example, if you had two keywords, one with Avg Pos of 1 and the other at 3, a simple formula would tell you their average position overall was 2. However, what if I was to tell you the first keyword had 100 impressions and the second keyword had 1,000,000? The average position for that group would be more like 2.99 than 2, right? So, how do you do get around this in a pivot table?
The actual formula is (keyword 1 Avg Pos x impressions)+(keyword 2 Avg Pos x impression) etc / Total Impressions. So, to start, you have to create a new column in the source table called AvgPosXImpsFormula. Then, create the formula of Avg Position x Impressions. Drag that formula down for the entire report. Then, copy and paste values that same column so you have a column of just the values, not the formulas. I call this column just AvgPosXImps. Then, when you convert this source table into a pivot table, you can create a calculated field with AvgPosxImps/Impressions. That will create the proper metric for any level you want to see the average position (i.e. campaign level, engine level, ad group level, etc).
I’ll be wrapping up this Excel series in my next post with some final tips/tricks and a Online Marketer Excel Skills test–20 questions to see just how good you and your crew are at the tool.
Opinions expressed in the article are those of the guest author and not necessarily Search Engine Land.
Share, Bookmark & Discuss This Article
More:
Keep Updated: News Via Email | News Via RSS Feed | News Via Twitter
See more stories like this in the Members Library! Check out the In The Trenches sections of the Members Library where this story is filed. Members also get access to exclusive video content, a members-only weekly & monthly newsletter, plus more. Check out all the benefits!
TOP STORIES
SEARCH NEWS BRIEFS
FEATURES & ANALYSIS
RECENT COMMENTS
Stay on top of all the search news with our daily summary, the SearchCap newsletter. View a sample ›
Search Engine Land produces SMX, the Search Marketing Expo conference series. SMX events deliver the most comprehensive educational and networking experiences - whether you're just starting in search marketing or you're a seasoned expert.
SMX Web Site » | SMX Difference » | SMX News »
Join us at an upcoming SMX event:
Learn more about search marketing with our free online webcasts and webinars from our sister site, Search Marketing Now. Upcoming online events include:
Featured sites from our Blogroll
Become a premium member today and receive:
Thank you – I’ve been struggling with pivot tables. I’ll definitely try them again with these guidelines.
Premium member since 01/2009
Anyone who can help me with some excel macros let me know. Happy to pay.
Eric
Premium member since 07/2009
Eric, Henry Walker can help here. I’ll send you his email address since I don’t have it on me.