Pivot Table - Averages Puzzle

Lister00

New Member
Joined
Mar 12, 2018
Messages
4
Hi All

I have a spreadsheet with 10,000s of Theatre Box Office records. Each record is a count of the number of tickets sold by Show, Date, and Ticket Type. For example some records may look like this:

[TABLE="class: grid, width: 800"]
<tbody>[TR]
[TD]Show Type[/TD]
[TD]Show Name[/TD]
[TD]Performance Date[/TD]
[TD]Day[/TD]
[TD]Ticket Type[/TD]
[TD]Tickets Sold[/TD]
[/TR]
[TR]
[TD]Christmas Show[/TD]
[TD]A Christmas Carol[/TD]
[TD]1/1/2018[/TD]
[TD]Mon[/TD]
[TD]Full Price[/TD]
[TD]50[/TD]
[/TR]
[TR]
[TD]Christmas Show[/TD]
[TD]A Christmas Carol[/TD]
[TD]1/1/2018[/TD]
[TD]Mon[/TD]
[TD]Full Price[/TD]
[TD]65[/TD]
[/TR]
[TR]
[TD]Christmas Show[/TD]
[TD]A Christmas Carol[/TD]
[TD]1/1/2018[/TD]
[TD]Mon[/TD]
[TD]Discount[/TD]
[TD]25[/TD]
[/TR]
[TR]
[TD]Christmas Show[/TD]
[TD]A Christmas Carol[/TD]
[TD]8/1/2018[/TD]
[TD]Mon[/TD]
[TD]Full Price[/TD]
[TD]100[/TD]
[/TR]
</tbody>[/TABLE]

I would like to summarise in a pivot table the AVERAGE sales on a Monday for a Christmas Show. This should be fairly simple. I would make AVERAGE "Tickets Sold" the Value in the Pivot Table, "Day" the Column and "Show Type" the Row, and "Ticket Type" a sub-row. Such a pivot table may look like this:

[TABLE="class: grid, width: 600"]
<tbody>[TR]
[TD][/TD]
[TD]Day[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Christmas Show[/TD]
[TD]Mon[/TD]
[TD]Tue[/TD]
[TD]Wed[/TD]
[/TR]
[TR]
[TD]
  • Full Price
[/TD]
[TD]71[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
  • Discount
[/TD]
[TD]25[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Lets look at that Full Price average of 71. That is calculated by summing the "tickets sold" of all records matching the criteria "Christmas Show", "Full Price" and "Mon" and dividing by the number of records that match those criteria.

In this case (50 + 65 + 100) / 3 = 71

However!

Annoyingly some records relate to the same performance and ticket type. For example the top two records in the table.

We actually sold 115 Full Price tickets for the performance on 1/1/2018. However it is split into two records as they had different sale points. To get a correct average the Pivot table actually needs to add these two records together before calculating the average.

The Correct maths would be ((50+60)+100) / 2 = 105

My first instinct was to group the records by adding another column with a "Performance Code" calculation. So the new table looks like:

[TABLE="class: grid, width: 800"]
<tbody>[TR]
[TD]Show Type[/TD]
[TD]Show Name[/TD]
[TD]Performance Date[/TD]
[TD]Day[/TD]
[TD]Ticket Type[/TD]
[TD]Tickets Sold[/TD]
[TD]Performance Code[/TD]
[/TR]
[TR]
[TD]Christmas Show[/TD]
[TD]A Christmas Carol[/TD]
[TD]1/1/2018[/TD]
[TD]Mon[/TD]
[TD]Full Price[/TD]
[TD]50[/TD]
[TD]Performance 1[/TD]
[/TR]
[TR]
[TD]Christmas Show[/TD]
[TD]A Christmas Carol[/TD]
[TD]1/1/2018[/TD]
[TD]Mon[/TD]
[TD]Full Price[/TD]
[TD]65[/TD]
[TD]Performance 1[/TD]
[/TR]
[TR]
[TD]Christmas Show[/TD]
[TD]A Christmas Carol[/TD]
[TD]1/1/2018[/TD]
[TD]Mon[/TD]
[TD]Discount[/TD]
[TD]25[/TD]
[TD]Performance 2[/TD]
[/TR]
[TR]
[TD]Christmas Show[/TD]
[TD]A Christmas Carol[/TD]
[TD]8/1/2018[/TD]
[TD]Mon[/TD]
[TD]Full Price[/TD]
[TD]100[/TD]
[TD]Performance 3[/TD]
[/TR]
</tbody>[/TABLE]

But how I translate this into a working Pivot table... I have no idea. I am stumped. I feel like there needs to be a middle table that summarise the records into 1 record per performance. But not sure how best to do that.

Any advice, greatly appreciated.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Forum statistics

Threads
1,224,820
Messages
6,181,155
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top