This is a guest post by Yogesh, a chartered accountant and excel blogger.
With this post we are starting a new series on how to do basic accounting in Microsoft Excel.
In this and next 5 posts, we will aim to setup Profit & Loss account reporting for multi-location retail company.
During this series we will learn how to make P&L reports on various criteria with just few clicks.
Many users find it difficult to manage their P&L reporting for Multi Location organization.
We will be using Pivot Tables for our reporting purpose and will take example of a Retails chain with multiple locations divided into various regions. It is recommended that you be familiar with the concept of pivot tables and also familiar with basic accounting terms.
Topics covered in this series:
Data sheet structure for Preparing P&L using Pivot Tables
Preparing Pivot Table P&L using Data sheet
Adding Calculated Fields to Pivot Table P&L
Exploring Pivot Table P&L Reports
Quarterly and Half yearly Profit Loss Reports in Excel
Budget V/s Actual Profit Loss Report using Pivot Tables
Do not think that series is not only about the Profit and Loss Account. This is also about Pivot Tables. We will cover many Pivot Table tricks during our series. I hope you will be able to use those tricks elsewhere too.
Data sheet structure for Preparing P&L using Pivot Tables
Data is most important part of the entire reporting requirements. You should plan your reporting needs in advance and collect data accordingly. Initial investments in organizing data properly will help you in long run for your reporting requirements.
Data needs to be in table format on separate sheet. First row of the data should be table headers and following rows to contain the data.

You need to have all the possible dimensions in your data. This will help you to quickly change your P&L report on different dimensions.
A dimension is defined as “…a data element that categorizes each item in a data set into non-overlapping regions” according to Wikipedia.
The above data structure will give us flexibility to prepare P&L report by,
- Geography-wise
- State-wise
- City-wise
- Store-wise
- Month-wise – This can be further grouped on Quarterly / Six Monthly / Yearly reporting
Calendar related data points should be entered as date. You can see that the month column in the data is showing Jan.2009 but it is actually entered as date January 31, 2009 then formatted as MMM.YYYY
This gives you flexibility to group data by quarterly / Six Monthly / Yearly for reporting. [learn more about grouping dates in pivot reports]
It is advisable to have it as last date of the month; this gives you further flexibility to do calculations based on number of days during the month.
There is no need to have calculated data in your data table, you may notice that I do not have calculated figures in the data sheet. Data points like Gross Margins, Margin % , Operating Profit and Operating Profit % will be calculated in Pivot Table using calculated field option.
During this series we will cover how to make P&L report on these dimensions using sample data. You can download sample data for practice along with our posts.
Download this Data:
Click here to download this data file in .xls format. We will use this data in next part to prepare our initial pivot table.
This data is prepared using RANDBETWEEN function of Excel for usage in this series.
What Next?
In the next part of this series, learn how to make a pivot table for Profit Loss Reporting using this data.
Added by PHD:
- I know as much about accounting as a cow knows about pie charts. So I asked Yogesh, a CA with vast experience and passion for excel, to write for us. I am very thankful to him for accepting this offer and sharing his knowledge.
- Please share your feedback and ideas for this series using comments. Yogesh and I will reply to your questions. Also, say thanks if you like the idea and want to learn more.
- Sign-up for PHD E-mail newsletter so that you don’t miss any new posts
Yogesh is an accountant with 13 years of experience in India and abroad. His specialties are budgeting and costing, supplier accounting, negotiation of contracts, cost benefit analysis, MIS reporting, employees accounting. He writes about excel at http://www.yogeshguptaonline.com/














13 Responses to “Gantt Box Chart Tutorial & Template – Download and Try today”
Hi Chandoo
As one of your students I have followed your detailed example through with great success. However, Excel is acting in an unexpected way and I wonder if you could take a look?
http://cid-95d070c79aef808e.office.live.com/self.aspx/.Public/Gantt%20Box%20Chart.xlsm
On my version, I have to type 40239 (Which equates to 2 Mar 2010) to get the chart to display 31 May 2010 (which should be 40329)!!??
Have I done something wrong or is Excel acting up?
Thx
Oli
PS Your example file in 2007 displays correctly.
Hi,
I like this idea a lot, but I agree the name is a little drab.
As an American I may just be seeing things, but to me the combination of lines and bars on your chart looks like a bunch of cricket bats.
Maybe you could work that into a catchier name. 🙂
Cheers!
Here is some code I use to keep the axis synched.
It may be useful to some of your readers
It is based on a comment I saw on Daily Dose of Excel.
Function SynchGanttAxis(Cname, lower, upper)
'Sets the X min and X max for Category axis
Application.Volatile
On Error Resume Next
'
'Top Horizontal Axis
With ActiveSheet.Shapes(Cname).Chart.Axes(xlCategory, 1)
.MinimumScale = lower
.MaximumScale = upper
End With
'Bottom Horizontal Axis
With ActiveSheet.Shapes(Cname).Chart.Axes(xlValue, 2)
.MinimumScale = lower
.MaximumScale = upper
End With
End Function
Function SynchVerticalAxis(Cname, lower, upper)
Application.Volatile
On Error Resume Next
' Excel 2007 only
'Right hand vertical axis
With ActiveSheet.Shapes(Cname).Chart.Axes(xlValue, 1)
.MinimumScale = 0
.MaximumScale = upper
End With
End Function
@Oli.. Can you check your file again.. I see 40329...
@Dave: Even I saw things.. the bars actually looked like lollipops. How about calling this lollipop chart - now that would be yummy and goes along the tradition of naming charts after eatables (bar, pie, donut...)
@Bob: Superb stuff... thanks for sharing 🙂
Hi Chandoo
This looks really good and I think it can also be applied to show project phases / milestones.
Question: Thinking further could this be amended to display a project lifecycle (Idea through to Implementation say 7 phases) on one bar / row? Just imagine 20 projects within a programme all on one chart one bar each showing their respective lifecycle stages i.e. on one page.
Idea: As the Gantt Box Chart this is quite intensive to set up re formatting etc how about the added extra of once you have completed this to "Save as template" i.e. saves the formatting and layout of the chart as a template so you can apply to future charts. Simple to do and will save the time formatting etc again and again and again.
Therefore tip: Click on your chart demo and then click on Save As template icon (2007) - edit file name and click on save. Ready to use / apply via Templates in Change Chart Type window.
Thanks and be very interested if the lifecycle question can be resolved
Mike
How embarrassing.
I was obviously suffering from numerical dyslexia. I was one of those days.
@Mike H: You can easily make this chart to work like a generic project lifecycle plan chart. All you have to do is,
1. in a separate sheet define the steps of lifecycle and various dates in a table (with 5 columns for each of the projects you have).
2. now use a control cell to input the project name you want to show in the chart
3. based on the input, use OFFSET Formulas to get the correct data
4. Rest is same as the tutorial above
For more info on the dynamic charting visit http://chandoo.org/wp/tag/dynamic-charts/ and http://chandoo.org/wp?s=OFFSET
Your solution is really smart but in the en Excel isn't meant to do stuff like this. I, as a former PM, always thought is was frustrating that you had to do stuff like this for something simple like a Gantt chart. So I built Tom's Planner. And would like to plug it here. I think it really solves the problem you are trying to solve in the most efficient way. Check out http://www.tomsplanner.com for a free account or play around with the demo.
Hi there,
Chandoo - this is really a very nice and helpfull chart - I adopted it, so I can report a forecast or the delay of a certain task (coming from my role as an auditor for projects).
One topic I´m currently struggeling with: I do have a project lasting for lets say 12 month. For a management reporting, I want to have kind of snapshot, lets say one month back and 2 month in the future. I tried with the offset formula, but failed. Any idea?
Thx
Lopi
[...] Ein viel geliebter Klassiker ist die Erstellung von GANTT-Diagrammen mit Excel. Wir hatten das Thema wiederholt schon hier. Chandoo.org hat sich mal wieder mit einer neuen Variante hervorgetan: Das GANTT-Box-Chart. [...]
[...] [...]
Hi Chandoo - fantastic xls. One thing I can't figure out how to do is adjust the alignment of the vertical axis. I would like to left align so that I could indent to represent sub tasks. Can that be done? Or is there a better way?
I've been trying to work out if there's a way to show weekends on the graph. The closest thing I've got is to add them on a secondary axis, but then I haven't been able to keep both axis lined up together! Any ideas?
Following on from this - is it possible to show things like holidays?