Hi,
I have a dataset that I made up (analogous to some confidential client data I actually have), and I need to make a table to put in a report. The dataset is at the bottom of the post, if it'd be helpful to replicate my results.
I am able to get all the calculations I want, but it'd be nice if it came out the way my company's formatting standards require.
Here's what I'm getting:
<tbody>
</tbody><colgroup><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col></colgroup>
And here's more what I'm looking for:
<tbody>
</tbody><colgroup><col><col><col><col><col><col><col><col></colgroup>
The main difference is that the head count and average number of marbles per club member in the respective age and years of member bands are in the same column, instead of two different columns.
I can write a macro that can change the formatting, but I'm wondering whether there's a way to adapt the pivot table properties to save me that effort.
If this isn't clear, please let me know and I'll list more details.
Thanks, in advance, for any help.
Peter
Here's the dataset
<colgroup><col style="width: 48pt;" span="4" width="64">
<tbody>
</tbody>
I have a dataset that I made up (analogous to some confidential client data I actually have), and I need to make a table to put in a report. The dataset is at the bottom of the post, if it'd be helpful to replicate my results.
I am able to get all the calculations I want, but it'd be nice if it came out the way my company's formatting standards require.
Here's what I'm getting:
Column Labels | ||||||||||||||||
0-4 | 5-9 | 10-14 | 15-19 | 20-24 | 25-29 | 30-35 | Total Count of Age | Total Average of Marbles | ||||||||
Row Labels | Count of Age | Average of Marbles | Count of Age | Average of Marbles | Count of Age | Average of Marbles | Count of Age | Average of Marbles | Count of Age | Average of Marbles | Count of Age | Average of Marbles | Count of Age | Average of Marbles | ||
15-19 | 1 | 7442 | 1 | 7442 | ||||||||||||
20-24 | 5 | 6010.4 | 5 | 6010.4 | ||||||||||||
25-29 | 3 | 8230.666667 | 3 | 8230.666667 | ||||||||||||
30-34 | 8 | 9382.875 | 8 | 9382.875 | ||||||||||||
35-39 | 2 | 11997.5 | 1 | 11424 | 3 | 11806.33333 | ||||||||||
40-44 | 2 | 12345.5 | 2 | 12434.5 | 4 | 12390 | ||||||||||
45-49 | 1 | 13732 | 2 | 12717 | 2 | 14198 | 5 | 13512.4 | ||||||||
50-54 | 1 | 14593 | 2 | 15527 | 1 | 16433 | 4 | 15520 | ||||||||
55-59 | 3 | 17306.33333 | 3 | 17715.66667 | 2 | 17931.5 | 8 | 17616.125 | ||||||||
60-65 | 1 | 19632 | 4 | 18681.75 | 2 | 18521 | 2 | 19004.5 | 9 | 18823.33333 | ||||||
Grand Total | 20 | 8748.8 | 5 | 12309.8 | 5 | 13571.6 | 6 | 17100.83333 | 8 | 18038.375 | 4 | 18226.25 | 2 | 19004.5 | 50 | 13244.18 |
<tbody>
</tbody><colgroup><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col></colgroup>
And here's more what I'm looking for:
Years in club | |||||||
Age | 0-4 | 5-9 | 10-14 | 15-19 | 20-24 | 25-29 | 30-35 |
15-19 | 1 | ||||||
7442 | |||||||
20-24 | 5 | ||||||
6010.4 | |||||||
25-29 | 3 | ||||||
8230.666667 | |||||||
30-34 | 8 | ||||||
9382.875 | |||||||
35-39 | 2 | 1 | |||||
11997.5 | 11424 | ||||||
40-44 | 2 | 2 | |||||
12345.5 | 12434.5 | ||||||
45-49 | 1 | 2 | 2 | ||||
13732 | 12717 | 14198 | |||||
50-54 | 1 | 2 | 1 | ||||
14593 | 15527 | 16433 | |||||
55-59 | 3 | 3 | 2 | ||||
17306.33333 | 17715.66667 | 17931.5 | |||||
60-65 | 1 | 4 | 2 | 2 | |||
19632 | 18681.75 | 18521 | 19004.5 | ||||
Grand Total | 20 | 5 | 5 | 6 | 8 | 4 | 2 |
<tbody>
</tbody><colgroup><col><col><col><col><col><col><col><col></colgroup>
The main difference is that the head count and average number of marbles per club member in the respective age and years of member bands are in the same column, instead of two different columns.
I can write a macro that can change the formatting, but I'm wondering whether there's a way to adapt the pivot table properties to save me that effort.
If this isn't clear, please let me know and I'll list more details.
Thanks, in advance, for any help.
Peter
Here's the dataset
ID | Age | Years in club | Marbles |
AA | 25 | 0 | 7859 |
AB | 32 | 0 | 10170 |
AC | 59 | 29 | 18885 |
AD | 40 | 8 | 11629 |
AE | 59 | 24 | 17333 |
AF | 50 | 11 | 14593 |
AG | 22 | 3 | 7786 |
AH | 61 | 22 | 17552 |
AI | 45 | 14 | 14375 |
AJ | 31 | 0 | 8292 |
AK | 33 | 3 | 11611 |
AL | 19 | 0 | 7442 |
AM | 21 | 2 | 5600 |
AN | 56 | 28 | 16978 |
AO | 21 | 0 | 6077 |
AP | 44 | 6 | 13062 |
AQ | 45 | 5 | 12446 |
AR | 63 | 23 | 18973 |
AS | 29 | 4 | 9176 |
AT | 47 | 13 | 14021 |
AU | 49 | 3 | 13732 |
AV | 58 | 17 | 17052 |
AW | 60 | 20 | 18996 |
AX | 22 | 3 | 5928 |
AY | 45 | 7 | 12988 |
AZ | 57 | 19 | 17381 |
BA | 41 | 10 | 12461 |
BB | 33 | 0 | 10554 |
BC | 43 | 11 | 12408 |
BD | 61 | 19 | 19632 |
BE | 37 | 7 | 11424 |
BF | 65 | 30 | 18238 |
BG | 31 | 2 | 8257 |
BH | 32 | 0 | 9320 |
BI | 61 | 21 | 19206 |
BJ | 53 | 24 | 16433 |
BK | 65 | 33 | 19771 |
BL | 65 | 27 | 19381 |
BM | 59 | 22 | 18513 |
BN | 51 | 19 | 15936 |
BO | 62 | 27 | 17661 |
BP | 58 | 19 | 17486 |
BQ | 50 | 16 | 15118 |
BR | 27 | 0 | 7657 |
BS | 37 | 2 | 11050 |
BT | 39 | 0 | 12945 |
BU | 59 | 20 | 17301 |
BV | 20 | 0 | 4661 |
BW | 30 | 0 | 7503 |
BX | 34 | 0 | 9356 |
<colgroup><col style="width: 48pt;" span="4" width="64">
<tbody>
</tbody>