Howdy folks. Jeff Weir here again. You may remember me from posts such as What would James Bond have in his Personal Macro Workbook and my now infamous music review. Today – and this truly will be music to some ears – we’re going to concentrate more on the former and less on the latter.
Today we’re going to talk about that mystical place where hard tasks just disappear into thin air. Where is that place, I hear you ask? (I have supernatural powers). In that famed triangle of folk-law, of course:

No, not that one. Stop jumping to conclusions and pay attention, will you! This one:
Suddenly not quite as intrigued? Well, sure…if you add these three things together, no compasses go haywire, no spooky fog will obscures all physical features, and no planes, ships, or movie budgets will go missing. But plenty of tedious mind-numbing pivot-table formatting will disappear. Because combining these three things together in the right way could quite possibly remove ship-loads of needless clicking from your day. Let me explain.
Turn the Tables on Excel
The problem with Excel is that it is so damn high-maintenance: if you add new data to a spreadsheet, you might have to adjust the references in dozens of formulas and charts that point to the original data, so that the new items show up in your calculations and charts.
That’s where Tables come in. Excel Tables – known as ListObjects to VBA developers – were introduced in Excel 2007, and if you’re not familiar with them then I strongly suggest you check out Chandoo’s Introduction to Structural References and this great video he did with MrExcel.
A large part of their appeal is that they spookily expand to accommodate anything you put in them. Even better, anything pointed at that table – Formulas, Charts, Data Validation lists – gets automatically updated at the same time. Here, let’s look at an image, shall we?
Here’s a table that also has a formula, some Data Validation, and a Chart pointed at it. As you can see, whatever is in that table shows up in that formula, validation, and chart too.
I’ve put a red box underneath the table above, to highlight where we’re shortly going to add some new data. At the moment, the table above has got our weekly diet plan in it: Vege, Fruit, and Meat. Hardly a balanced diet. Watch what happens when we add something new under the table where that red box was…because man cannot live on fruit, veges, and meat alone. Well, not this man anyhow.

Wow, will you take a look at that: the table expanded automatically to hold our new category of ‘Beer’ (just like my stomach does). And wow…those three things we had pointed at that table all got updated automatically, before we could say ‘Prost’. Spooky!
So how do Tables help with PivotTables?
First, let’s look at life without tables. Let’s say we make a PivotTable out of this ‘traditional’ block of data, and we make it display Total Sales by Region:
*BING!*
Later on we scroll to the bottom and add a new record for a whole new region:
…and then we refresh our Pivot:
*BING!*
Ahh, that’s right…when we initially set up our PivotTable, that Create PivotTable dialog box had a hard-coded range in it:
…which means we need to click this puppy:
…and then change the hard-coded reference accordingly so that it includes the new data:
…and we need to do that each and every time we add new data. Maybe monthly. Maybe weekly. Maybe daily. Maybe for multiple pivot tables. Tedious.
Take two, with Tables
This time, we’ll turn our source data into an Excel Table first. There’s a couple of icons in the ribbon you can click to create a table – and bizarrely those icons are different – but I like to use the keyboard shortcut of Ctrl + T, which is easy to remember, as T stands for Terrific Table.
*BING!*
And now let’s create a PivotTable out of it:
*BING!*
Now watch what happens when we scroll to the bottom and add the new date for our new record:
Well that in itself is pretty nifty. Yep, folks…tables have some smart functionality that in themselves can save you significant faffing around. Now let’s put in the rest of the data for that new record:
And here’s the punch-line: look what happens when you refresh that Pivot:
*BING!*
…and I can tell from here just how excited you are by that from the look on your face (you left your web-cam on again), because…
Let’s throw some Macros into the mix
I promised you I was going to save you a ship-load of clicks. So far I’ve saved you…let me see…exactly one. What about them others I promised?
Well, given we’ve just established that Pivots love Tables more than I love this album, let’s whip up a macro that will not only create a PivotTable but also automatically turn the source data range into an Excel Table. Then we can assign it to a handy shortcut key – something like Ctrl + Shift + P (“P” for Pivots…I know what you’re memory is like) – so that all you have to do is select a cell in your raw data and in one keyboard shortcut do two things that otherwise would require several clicks. Now that would be worth reading this far, wouldn’t it!
And while we’re at it, let’s code it up so that if you run it on an existing PivotTable, it will retrospectively turn the source data into a Table if needed, and then re-point the Pivot at that Table. That would be handy too.
But why stop there? How ’bout we get it to do a whole bunch of other tiresome things that we routinely do manually in order to set our Pivots up just the way we like ’em. Because if there’s one thing I just can’t stand about pivots, it’s the huge number of things I have to do every single time when I whip one up in order to get it looking just how I like it.
So – as Prince once said, “Let’s go crazy“:
- Let’s make it put the PivotTable that we just created at the edge of the used part of the sheet that we’re working in – which is usually right by our data, and usually exactly where I actually want it – rather than having to uncheck that pesky “In New Worksheet” button and then having to manually select the range where I want my new pivot to go;
- Let’s have it cut that PivotTable with a Ctrl + C, so that if we choose to, we can then navigate to any cell we want and simply hit Ctrl + V to paste it into it’s new home. (And if we choose not to move it, we simply do nothing, because it actually stays where it is unless we actually paste it somewhere else;
- Let’s change the Report Layout to “Show in Tabular Form” instead of the default “Show in Compact Form” setting that I never use;
- Let’s turn on the “Repeat All Item Labels” option that I practically always want;
- Let’s turn off Subtotals, because I almost never need them on any field, let alone all of them;
- Let’s turn off Grand Totals, because those totals don’t always make sense in the context of my Pivots, and they’re simple enough to turn back on if I do need them;
- Let’s turn off that really annoying “Autofit Column Width on Update” setting, so that my pivot doesn’t stupidly screw up all my carefully set up column widths each time I refresh it;
- Let’s turn off the “Save Source Data with file” option. No point saving the PivotCache along with the source data, given it only takes an instant to recreate the PivotCache from scratch in the event that we need to. (More on this here).
Wait a minute Jeff…you missed a really annoying thing…
Oh yeah, so I did. Let’s make the Pivot automatically adopt the same source formatting as the original data has – like Mike does over at the Bacon Bits blog – because if there’s one thing guaranteed to make an Excel user do this:
…it’s either an off-topic post, or (more likely) this:
Here’s the code that will free you from this Pivot Hell:
Just cut the below code, and paste it into your Personal Macro Workbook. Don’t know what that means? Think I’m speaking gibberish? Head over to my earlier post What would James Bond have in his Personal Macro Workbook to find out just how easy this is, and you’ll be a ninja plus in no time!
Sub InstantPivot()
' InstantPivot: Just Add Water
' Assign this to Ctrl + Shift + P or something like that.
' Description: * Turns selection into Excel ListObject
' * Makes a Pivottable out of it at the edge of the used range
' * Applies my preferred default settings
' * Selects the Pivot and cuts it, so that
' you can then use arrow keys
' and Control + V to paste it where you wants
' without having to touch that unclean dusty rodent
' you keeps at the edge of your Desk.Usedrange
'
'Here's the settings it applies.
' 1. Changes the Report Layout to "Show in Tabular Form"
' 2. Turns on "Repeat All Item Labels" option
' 3. Turn off Subtotals
' 4. Turn off Grand Totals
' 5. De-selects the Row Headers option from the Design tab.
' 6. Turns off 'Autofit Column Width on Update'
' 7. Turns off 'Save Source Data with file' option.
' 6. Adopts the source formatting
' Programmer: Jeff Weir
' Contact: weir.jeff@gmail.com or jeff.weir@HeavyDutyDecisions.co.nz
' Name/Version: Date: Ini: Modification:
' InstantPivot 20140213 JSW Initial programming
' InstantPivotV2 20140216 JSW Added error handler and check for multiple cells
' InstantPivotV3 20140216 JSW Adopted SNB's approach of setting numberformat while turning subtotals off
' InstantPivotV4 20140216 JSW If run on existing pivot that is not based on ListObject, turns source into ListObject
' InstantPivotV5 20140216 JSW Now ignores Values fields and doesn't apply format if pf.function = xlCount
' InstantPivotV7 20140216 JSW Now ignores Values fields and doesn't apply format if pf.function = xlCount
' Inputs: None
' Outputs: PivotTable is formatted accordingly. World recognizes my genius and forgives me my occasional off-topic post.
Dim pc As PivotCache
Dim pf As PivotField
Dim pt As PivotTable
Dim lo As ListObject
Dim rng As Range
Dim strLabel As String
Dim strFormat As String
Dim i As Long
Dim wksSource As Worksheet
'Check that we're dealing with a version of Excel that supports ListObjects
' In fact, play it safe, and ignore Excel 2007.
If Application.Version >= 14 Then
On Error Resume Next
Set pt = ActiveCell.PivotTable
On Error GoTo errhandler
If pt Is Nothing Then
Set lo = ActiveCell.ListObject
If lo Is Nothing Then Set lo = ActiveSheet.ListObjects.Add(xlSrcRange, Selection.CurrentRegion, , xlYes)
Set rng = Cells(ActiveSheet.UsedRange.Row, ActiveSheet.UsedRange.Columns.Count + ActiveSheet.UsedRange.Column + 1)
Set pc = ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:=lo)
Set pt = pc.CreatePivotTable(TableDestination:=rng)
Else:
'Check if pt is based on a ListObject.
' * If so, set lo equal to that ListObject
' * If not, turn that source data into a ListObject
On Error Resume Next
Set lo = Range(pt.SourceData).ListObject
On Error GoTo errhandler
If lo Is Nothing Then
Set rng = Application.Evaluate(Application.ConvertFormula(pt.SourceData, xlR1C1, xlA1))
Set wksSource = rng.Parent
Set lo = wksSource.ListObjects.Add(xlSrcRange, rng, , xlYes)
pt.ChangePivotCache ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:=lo.Name)
End If
End If
With pt
.ColumnGrand = False
.RowGrand = False
.RowAxisLayout xlTabularRow
.RepeatAllLabels xlRepeatLabels
.ShowTableStyleRowHeaders = False
.ShowDrillIndicators = False
.HasAutoFormat = False
.SaveData = False
.ManualUpdate = True
If ActiveCell.CurrentRegion.Cells.Count > 1 Then
For i = 1 To .PivotFields.Count - .DataFields.Count 'The .DataField.Count bit is just in case the pivot already exists
Set pf = .PivotFields(i)
With pf
If pf.Name <> "Values" Then
.Subtotals = Array(False, False, False, False, False, False, False, False, False, False, False, False)
On Error Resume Next
.NumberFormat = lo.DataBodyRange.Cells(1, i).NumberFormat
On Error GoTo errhandler
End If
End With
Next i
End If
End With
' Get DataFields to match the formatting of the source field
' Note that this will only be neccessariy in the case that we're
' running this code on an existing pivot
On Error GoTo errhandler
If pt.DataFields.Count > 0 Then
For Each pf In pt.DataFields
If pf.Function <> xlCount Then pf.NumberFormat = pt.PivotFields(pf.SourceName).NumberFormat
' Do away with 'Sum of' or 'Count of' prefix etc if possible
On Error Resume Next
pf.Caption = pf.SourceName & " "
On Error GoTo errhandler
Next pf
End If
'This needs to go before the .Cut bit, otherwise the .Cut stack gets wiped
With Application
.ScreenUpdating = True
.EnableEvents = True
.Calculation = xlAutomatic
End With
With pt
.ManualUpdate = False
.TableRange2.Select
.TableRange2.Cut
End With
Err.Clear
errhandler:
If Err.Number > 0 Then
With Application
.ScreenUpdating = True
.EnableEvents = True
.Calculation = xlAutomatic
End With
MsgBox "Whoops, there was an error: Error#" & Err.Number & vbCrLf & Err.Description _
, vbCritical, "Error", Err.HelpFile, Err.HelpContext
End If
End If
End Sub
What will you do with all your new spare time?
I’m glad you asked. Why, you’ll have PLENTY of extra free time now in which to give my new favorite album a listen:

TRANSMISSION ENDS
—Redux—
It’s just gone 22 minutes past Midnight here in New Zealand, and I’ve just got back from Tami Neilson’s album release party for her album Dynamite. It certainly was. I’d say sparks were flying off guitarist and co-producer Delaney Davidson’ guitar but that would be poor poetic license. Because in actual fact, blazing chunks of molten steel were flying off of that beast’s bridge.
I’d say that Tami was twice the woman live than she is recorded. And that’s not too far from the truth, because she is 6 months pregnant, and counting. Not that that was any hindrance whatsoever to her belting out an incredible lyric. That baby of hers is going to have one hell of a set of lungs, if genetic predisposition is anything to go by.
And if we focus on the nurture side of the nurture/nature argument, then that baby is going to have one hell-of-a sense of rhythm too, because it had front-row seats to the craftiest drummer I have ever heard. Why at one stage that drummer threw down his sticks and wrestled beats out of that kit with his bare hands like he would wrestle a live bear. And the bear definately came off second best.
And then there’s the bass-player. Not only was he a damn fine singer, but he also had the longest g-string on stage by far. (Explanation: one of the strings on a Bass guitar is tuned to ‘G’, as is one of the strings on a Guitar. And because a Bass Guitar has a longer neck than an electric rhythm/lead guitar, that G-string is longer. I know, it’s a bad joke.) Eligible Bachelor Number Two was his name. Fastest fingers in the west.
Don’t even get me started on Eligible Bachelor Number Three, the rhythm acoustic and fiddle player. Ye-haw and yes-siree does not even begin to cut it as a compliment to this dude. If I still had a soul and a willing buyer for it, I’d only end up with half the riffs this guy can pull off in exchange for it.
What a night.
🙂
Here’s what you missed:







































66 Responses to “Budget vs. Actual Charts – 14 Charting Ideas You can Use”
[...] Update: Check out the results at Budget vs. Actual Charts [...]
Hi there:
I'm interested in understanding exactly how contestants #'s 1, 8 got their surplus or shortfall to show up at the top of the bar (is this overlapped or stacked somehow) and change colour? I hope this makes sense. I've tried to find samples and I can see contestant 8 (cuboo) may have used something called graphomate but I can't use this.
I need to create a bar chart that shows budget, and actual variance whether it be a surplus or a shortfall and I would like make it look like option 1 or 8 above but haven't a clear idea how to do it...any help would be greatly appreciated!
Regards..Linwe
[...] heute können alle Beiträge auf “Pointy Haired Dilbert” gesichtet und bis zum 12.04. bewertet werden. Falls mein Vorschlag - Nr. 8 - gefällt, freue ich [...]
Danken Sie Excel friend!
#6 is the best here. Simple, no extraneous visual effects.
I was all set to vote for #9...until I noticed its lack of y-axis labels. So I have to go with #6 also.
I think #6,#9 is enough .
#9 is my favorite
Nice data/ink ratio 😉
I agree with Jon - #6 for me.
8 & 14
I go for # 9 (simple) and #14 (complete)
I go for cuboo #8
cheers
#6 for overview at a glance / top management
#8 for deeper analysis / those who need more detailed information
#14 although I think you only need the bottom panel and I then would stack the Center charts vertically to make Center comparisons easier.
#10 gets my vote.
If there is a second place, then #14
denise
Hi, if I was not wrong, Samples 3,4 and 5 were created using Tableau software and not Excel. For more information on Tableau you might want to visit http://www.tableausoftware.com/. It was initially designed by Prof. Pat Hanrahan and his PhD students. I am not their salesperson but I thought someone might want to know more about this particular technology.
Hi Tin Seong Kam:
Thanks - I have looked at Tableau before. I have also found the means to reproduce something similar to chart 8 without using graphomate, and also chart 7. I proposed chart 9 as well but the overlap is confusing to some.
I am really not too concerned about showing actual budget figures but the variance in $ and % is important for my particular use. That is why I gravitate to the charts that seem to easily tell us that we have a surplus or a shortfall.
Thanks!
Linwe
11, 6, 9 (presque pareil)
7 pour la clarté
cuboo #8 ist my favorite
best regards...
8
8 is fantastic
I prefer N#8 - N# 1,7 & 8 use the settings of Rolf Hichert...
6 : The GURU (read "Jon Peltier ") has spoken,
SOO easy on eyes!
Hi Chandoo,
I liked Cuboo's submission. So #8 gets my vote.
Regards,
Sumit
Number 8 by far. Even though it's not part of the data display, the comments feature sells me. Variance explanations are as important as the actual variances.
I visually prefer #8, but #3 is really easier to understand, even if it lacks a lot of information (inverting budget/actual), legend, etc...
[...] All in all there are several great entries suggesting a good variety to present budget vs. actual performance. Go check them out. [...]
[...] reshape, zoo by learnr A reader of a Pointy Haired Dilbert blog enquired about best ways to visualise budget vs. actual performance. In response PHD challenged his blog readers to contribute their visualisations made using Excel or [...]
anyone willing to post their xls for these? Some really excellent exmaples.
To avoid the summary execution of the person presenting these to an executive team these charts must handle overspending as well as underspending, be comprehensible in 5 seconds and show the key fact clearly. The key fact isn't budget or actual - it's the magnitude of the gap!
Therefore:
#14 for nailing the key fact and being able to handle overspending. The winner therefore.
#6 for nailing speed-reading and being able to handle overspending, but somewhat obscuring the key fact. Second place.
#8 for nailing information depth and aesthetics. Third place.
I really wanted #8 to win, but that's the technician's view not the end-user's.
[...] Todas as contribuições podem ser vistas no seguinte endereço: Budget vs. Actual Charts – 14 Options You can Use Posted on April 5th, 2009 http://chandoo.org/wp/2009/04/05/budget-vs-actual-charts/ [...]
Social comments and analytics for this post...
This post was mentioned on Twitter by NancyJHess: I like to explore fav tweets of those I follow. Here is one from DutchDriver http://twurl.nl/17eiap Creative visual charts: Budget vs Actual...
number 8
clean, full of info, qualitative as well as quantitative
Hi,
I Like 4 chart in above as per the following ratings:-
no 1# -> 14***
no 2# -> 7***
no 3 # -> 8**
no 4# -> 1.3**
I will be greateful if someone can send me the process of making all above 4 charts.
Virender
[...] Budget vs. Actual Values in Charts – 14 more options [...]
[...] Budget vs. Actual – 14 charting options [...]
Does anyone know what type of chart #6 is (chart name?)? Also, how do I create this is Excel 2007?
@Shazbot
I'd call it a Column and Bar chart, but don't get hungup on names
To make it try this:
Setup the chart as a Clustered Column Chart
Change the Series so there is 100% overlap, ie: One column is in front of the other
Change the Budget series to a line chart
Set the line color to none
Set the marker style to a Flat Line
Change the marker width to make it the same width as the bar
Change colors and other chart properties to suit
Does anyone have an idea on how to create chart #1?
Thanks
Caroline, please see the german page: http://www.hichert.com/de/software/exceldiagramme/55
there you can find the original example for nr1.
best regards,
stefan
Caroline
This is a Clustered Stacked Column Chart
Which has the column under the Shortfall/Excess colored the same as the Budget
Have a look here
http://chandoo.org/forums/topic/question-about-budget-v-actual
&
http://peltiertech.com/WordPress/clustered-stacked-column-charts/
Hi,
Is it possible to get the source files like the other visualisation challenge (on sales).
Thanks,
Vijay
Dear Chandoo,
I discovered your site by pure chance and I am really thrilled about it and I am learning a lot.
Is it possible to post the source file for this visualisation challenge?
Thanks,
Vijay
[...] Budget vs. Actual Charts in Excel [...]
Dear Chandoo,
How do I create Chart #10 (comparing Budget vs Actual Performaces) by cost center by quarter without the cumulative performance. Do you have an actual example that I could use?
Thanks,
Greg
HI
Does anyone can help me to a to create chart #7? I'm beginer in excel , I started to work two weeks ago and my boss ask me to follow the budget/actual until the end of the year.
SO I really need your help.
Thanks in advance
p.s Sorry for my english ( i'm french)
@OKI, Greg
I have made a mockup of #7 and #10
It is available at:
http://chandoo.org/wp/wp-content/uploads/2009/04/Bud-Act-visualizaion-challenge-7+10..xlsx
#10 is a straight, Pivot Chart/Table but the data has been rearranged to get it into the pivot table
#7 is 2 charts, being a simple Bar Chart and a Scatter Chart with 100% Error Bars
I have used Named Formulas for the two charts.
HELLO Hui
Thanks you very much for your hepl , i really appreciate
Have I nice week
Hi,
I was wondering how can you replicated chart 1.3? The bars looked like there overlapped on two different axis?
Tony
I think 1 & 3 are good.
Hi Chandoo,
Please can you provide a link of the excel sheet for 1. Chart "3 colors and everything is clear"
I would like to drill into the spreadsheet and learn the secrets as how the chart was made.
Many thanks,
Sawan
@Sawan
It is probably 12 seperate charts, I will assume snapped to the underlying cells to ensure they are the same size
The left 3 Charts have a vertical Axis
The bottom 4 Charts have a horizontal Axis
The remainder have no axis
The remaining text maynot be part of the charts but is probably cell content
Saludos,
Como puedo descargar estos maravillosos ejemplos para estudiarlos y analizarlos deseo aprender a realizar este tipo de graficas en Excel.
Gracias,
Dear Chandoo and Hui,
Please would you help me (step by step if possible) to create Chart #8?
Many thanks in advance!
Dear Chandoo,
I think chart #8 is really great. Would really appreciate if you can show basic step to create it.
Thanks 🙂
Hi all,
Is there any step by step tutorial to recreate the the chart #1 please?
Would really appreciate if someone could show me how it done.
Regards
Sawan
Can someone tell me how do you create chart number 2? Thanks!
Am I the only one that can not display any of the images? Would love to take a look at these. This is the ONLY page on the whole website I have had this issue with. 🙁
Dear All,
how can i create chart # 7? is there any link where i can subscribe to your website by paying a certain amount. i want to learn some good excel techniques.
please let me know.
Cant see the images 🙁
Where can I find the link to download some of the above charts?? these are extremely usefull chart and would like to utilize the same.
Waiting for the reply.
Thanks..
I am interested for # 1,6,7,8,9,10,11 its very exciting for me .
Hi,
Just wanted to check, is there any possibility that pivot table or drop down work in power point?
Regards
Satyapal
@Satyapal... you can only use static images or slide animations in Power Point. Not features like pivot tables or drop downs. However, you can embed the entire workbook (or sheet) in a presentation. When clicked this will just open Excel so your users can play with the data.
Is there any instalment kind of facility available for joining the online course of Rs.12000/-.
Regards
Ramesh N
Hi,
I badly want to replicate #10. Can someone help me.. I've checked google to help but I can't figure out how to add the total 🙁
Regards,
Tim