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/













11 Responses to “Who is the most consistent seller? [BYOD]”
The Date column in the sample file is Text not Dates
[…] http://chandoo.org/wp/2015/02/18/calculating-consistency-in-excel/?utm_source=feedburner&utm_med… […]
Great Chandoo. Keep it up, Looking forward more from BYOD..
Thanks
With Excel 2013 the pivot table could be connected to the data model which provides a distinct count.
This will do for invoice count
=COUNTIF(F:F,H12)
Instead of
=COUNTIFS(sales[SELLER],$H12)
Excellent document. How did you make the last graphic? Witch app. Thanks for answer.
Can someone tell me what =countif(sales[date],sales[date]) is counting? The value is 19. Its found in the =SUMPRODUCT(IF(sales[SELLER]=H12,1/COUNTIFS(sales[SELLER],H12,sales[date],sales[date]),0))
Hi Chris,
=countif(sales [date],sales[date]) function is counting the unique dates in the table.
Vândalo
Excellent document!
Can you explain more about the calculation on Weighted consistency? More specific the small number is 0,00001 ?
How come the number should be smaller if there is more sellers?
Hi,
Not understood this formula: {=SUMPRODUCT(IF(sales[SELLER]=H12,1/COUNTIFS(sales[SELLER],H12,sales[date],sales[date]),0))}
Please explain.
Thanks.