1. Skip to navigation
  2. Skip to content
  3. Skip to sidebar

PivotTables seem like a great tool to use to build reports—except once you start building the report you get a huge stack of metrics like the one shown below.

PivotTables looking bad

This doesn’t help people pick out natural groups of metrics and doesn’t match the formatting people expect. We’re going to show a simple PivotTable hack today that lets you create blank lines between metrics. This allows a report using PivotTables to look a lot more professional.

To get started, find the PivotTable menu, and add a calculated field.

Adding a calculated field to a PivotTable

Call the Calculated Field “Blank Line” and make the formula 1/0.

Creating the Blank Line formula

Now drop the “Blank Line” formula in to the data area of your PivotTable. You can drop it in multiple times to create several blank lines.

PivotTables looking bad

Go to PivotTable Options (right click on the PivotTable and choose Table Options…”). Turn on the “For error values, show:” check box. This will display an empty cell instead of all the alarming #DIV/0! messages.

PivotTable settings to hide errors

After a little more prettification, the table looks like this.

Final PivotTable

A total of 5 blank lines were added. Three were given titles and bolded: “Revenue and Cost”, “Warranty Details”, and “Profit.” Two are blank. To make a completely empty row, change the title from “Sum of Blank Line” to a single space key ” “. Every title in the PivotTable must be unique, so the title of the other empty row is two spacebar keys.

Topics:
  • http://www.dbmforum.nl Robin

    Hey thanks for this tip! I already made use of it in one of our reports.

    Actually i am a bit jalous that i did not think of this….i regularly invoke errors on purpose to invoke a certain program flow.

    Do you also have tips about using those dreadful pivot charts? I hope that they will improve those in excel 2007. I am currently using normal charts (often i.c.m. with getpivot data functions)

  • Chris

    Great.

    PivotCharts are an abomination. My tip: avoid them. But you already knew that.

    I don’t know if they improve with Excel 2007. They basic charting styles are better in Excel 2007 but I still don’t expect them to be usable.

  • http://peltiertech.com Jon Peltier

    Robin -

    Pivot charts are hideous in their current (Excel 2000-2003) incarnation. There are some improvements to pivot charts in Excel 2007, but I haven’t explored them in depth.

    Here is an article I’ve written about the topic:

    Pivot Tables, Pivot Charts, and Real Charts
    http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=553

    (I assume html tags work here…)

    - Jon
    ——-
    Jon Peltier, Microsoft Excel MVP
    Tutorials and Custom Solutions
    http://PeltierTech.com
    _______

  • http://www.dbmforum.nl Robin

    It would really be a shame if they do not improve the pivot charts. It COULD be so beautiful…

    Thanks for the link Jon. I see that you have made a lot of excel tutorials. This should come in handy.

  • http://dbmforum.nl/?p=67 DBM Forum » Blog Archive » Tweak je Pivot Tables

    [...] Excel: Using PivotTables for reporting [...]

  • Geetha Boggarapu

    I need to find the sum of a calculated field and use this sum in another calculated field in pivot table using excel 2007. Can any one help me in find the sum of calculated field and how to use this value in another calculated field in pivot table. Pls mail me to geetab123@yahoo.com

  • Flogsta

    So useful!

    How do you change formatting of titles etc. (i.e. bolded)?

    Using Excel 2003.

    Thanks.

  • http://juiceanalytics.com Chris Gemignani

    Formatting the titles is easy. There is a PivotTable option called “Preserve formatting”. Make sure this is checked–it should be checked by default. Then just format the cell bold as normal and it will stay bold.

  • Flogsta

    Thanks. II used it but I won’t keep the formatting. Every time I refresh the formatting disappears.

    What can be the reason? I even checked/unchecked AutoFormatTable. Can be a conditional formatting which I have all over the worksheet (i.e. if Cell XY = “Total of..” then YELLOW/BOLD etc.).

  • http://www.idevlop.com Patrick

    instead of inserting blank lines for headers, you could also select the first 4 items, then right click, and select ‘Group’.
    Excel would then create an extra column at left of pivot, and you can rename that one.
    Maybe it’s not optimal aesthetically at first, but it is very functional.

  • http://www.seomagnate.com seomagnate

    Thanks for sharing . It helps to me to set up.

  • http://www.cogniview.com/pdf2xl.php pdf to excel

    Hi, 

    Thanks guys for sharing this post. Its really very informative post guys. 

    Thanks 

blog comments powered by Disqus