Create Custom Reports From Pivot Tables

If you’re a pivot table fan, like I am, you know how quick and easy it is to summarize a massive amount of data, with just a few clicks. You can show sums, counts, averages, and other totals, without using any fancy formulas.

In the screen shot below, the pivot table is summarizing income and expenses, and there is a Slicer at the top left, for quick filtering.

getpivotdatarg01

Formatting Restrictions

As wonderful as pivot tables are, they do have some limitations, and you might not be able to get the layout exactly the way you need it. In the screen shot below, you can see a P & L statement, based on the same data as the previous pivot table.

You’d never be able to get the pivot table in exactly this layout, with its blank rows, and formatting, and there are additional formulas at the right side too.

getpivotdatarg02

Create a Custom Report

Roger Govier is a pivot table fan too, and he has created a solution for building his own custom reports, like the P & L statement shown above. Roger creates a pivot table first, and then he uses the GetPivotData function, to pull specific data into his custom layout.

In the formulas, Roger uses cell references to the row and column headings, so he just has to create one GetPivotData formula, then copy it into all the data cells of the custom layout.

Another smart trick is that Roger adds headings at the top of the sheet too, and refers to those cells, instead of hard coding the field names into the formulas.

getpivotdatarg06

Use INDEX and MATCH Instead

If you don’t want to use the GetPivotData function, Roger also show how you can create named ranges, based on the pivot table. Then, use the INDEX and MATCH functions to extract the applicable data, and build the custom report.

He even has sample code that you can use, to automate building the named ranges.

Download the Sample File

To see the detailed instructions, and download Roger’s sample file (with or without the VBA code), please visit the Build Custom Reports With GetPivotData page, on my Contextures website.

________________

Excel Roundup 20141110

One Excel annoyance is that after you select a group of cells, you can’t unselect one of them. For example, you might want to format specific cells, or create a named range, and you accidentally include a cell that shouldn’t be in the group. You can’t click on that cell to unselect it – you have to start over, and select more carefully the next time.

To solve that problem, Doug Glancy has created a free tool that you can download — SelecTracker.

Next, we need a version that lets you unselect one cell within an large area, e.g. if you drag down from A2:A7, click on cell A5, to unselect it.

Continue reading “Excel Roundup 20141110”

Excel Numbers Do Not Sort or Add Correctly

Last week, I heard from someone who was having a problem sorting some numbers in Excel. He sent me a small sample file that showed a few of the dates and numbers that just wouldn’t sort correctly.

My first guess was that the data had been copied from a website – that can cause some strange behaviour, when you paste it into Excel. A quick check with the COUNT and COUNTA functions showed that none of the values in cells C3:C6 were real numbers – they were text.

numbertext01

Continue reading “Excel Numbers Do Not Sort or Add Correctly”

Excel Chart Compares High and Low Scores

Last weekend, I helped someone who needed a chart for a fantasy football league, to show the highest and lowest win/loss scores for each week. To help explain what it should look like, they posted a picture of a hand drawn chart, similar to the picture below.

By the way, I created the sketch in Excel, by using the Marker option, in the Artistic Effects. Who knew that Excel was so artistically talented?

Continue reading “Excel Chart Compares High and Low Scores”

Excel Report Diagnostic Display

Did you ever print and distribute pivot table reports in Excel, only to discover – too late – that they weren’t showing the correct information? To help save you from wasted time and paper, and possible embarrassment, AlexJ is sharing his Report Diagnostic Display technique today.

You might remember some of his other handy tips, such as

Continue reading “Excel Report Diagnostic Display”