dcbaaa1960
New Member
- Joined
- Sep 18, 2014
- Messages
- 1
Hello,
I have a database like this
<tbody>
</tbody>
and would like to use it to create a summary table (using pivot table?) like the below
[TABLE="width: 845"]
<tbody>[TR]
[TD="class: xl64, width: 65"][/TD]
[TD="class: xl65, width: 65"]A[/TD]
[TD="class: xl64, width: 65"][/TD]
[TD="class: xl64, width: 65"][/TD]
[TD="class: xl65, width: 65"]B[/TD]
[TD="class: xl64, width: 65"][/TD]
[TD="class: xl64, width: 65"][/TD]
[TD="class: xl65, width: 65"]C[/TD]
[TD="class: xl64, width: 65"][/TD]
[TD="class: xl64, width: 65"][/TD]
[TD="class: xl65, width: 65"]Total[/TD]
[TD="class: xl64, width: 65"][/TD]
[TD="class: xl64, width: 65"][/TD]
[/TR]
[TR]
[TD="class: xl64"][/TD]
[TD="class: xl64"]Apple[/TD]
[TD="class: xl64"]Banana[/TD]
[TD="class: xl64"]Orange[/TD]
[TD="class: xl64"]Apple[/TD]
[TD="class: xl64"]Banana[/TD]
[TD="class: xl64"]Orange[/TD]
[TD="class: xl64"]Apple[/TD]
[TD="class: xl64"]Banana[/TD]
[TD="class: xl64"]Orange[/TD]
[TD="class: xl64"]Apple[/TD]
[TD="class: xl64"]Banana[/TD]
[TD="class: xl64"]Orange[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]1-Jan-14[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]5-Jan-14[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]13[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]5-Feb-14[/TD]
[TD="align: right"]14[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]8-Feb-14[/TD]
[TD="align: right"]14[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]11[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]18[/TD]
[TD="align: right"]7[/TD]
[/TR]
</tbody>[/TABLE]
The summary table should show the running total of orders by customer (A, B, C, etc.) and then by type (orange, apple, etc.). It should also show the running total of order by all customers by type.
There are a few constraints:
1) I cannot change the format of the database.
2) New rows (and potentially columns) will be added to the database over time.
3) I would like the summary table to adjust itself as the database changes. At the moment, I have defined the range of the database using an OFFSET function and create a pivot table that refers to the defined range. The reason I am using the pivot table function is because it is the only way I know to make sure that the table would refresh itself with the database. Please let me know if there are better ways.
I am facing these problems:
1) I cannot get Excel to aggregate the data under the columns "Item 1", "Item 2", etc. and reorganise it into a summary grouped by type (Apple, Orange, etc.) In other words, ideally Excel should sum the numbers under the columns "Quantity 1" and "Quantity 2" if the corresponding entries under "Item 1" and "Item 2" are the same (let's say they are both "Apple"). Instead, the pivot table would add the Apples under "Item 1"/"Quantity 1" separately from the Apples under "Item 2"/"Quantity 2".
2) I cannot get Excel to split the total order from all customers by "Apple", "Orange", etc. I can get the total number of fruit or total number of Quantity 1, but not a total number of Apples.
The below is what my pivot table currently looks like, which is very different from what I want.
[TABLE="width: 1476"]
<tbody>[TR]
[TD][/TD]
[TD]Column Labels[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]A[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]B[/TD]
[TD][/TD]
[TD]C[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Total Sum of Quantity 1[/TD]
[TD]Total Sum of Quantity 2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]apple[/TD]
[TD][/TD]
[TD]banana[/TD]
[TD][/TD]
[TD]orange[/TD]
[TD][/TD]
[TD]apple[/TD]
[TD][/TD]
[TD]banana[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD](blank)[/TD]
[TD][/TD]
[TD]orange[/TD]
[TD][/TD]
[TD]apple[/TD]
[TD][/TD]
[TD](blank)[/TD]
[TD][/TD]
[TD]apple[/TD]
[TD][/TD]
[TD](blank)[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Row Labels[/TD]
[TD]Sum of Quantity 1[/TD]
[TD]Sum of Quantity 2[/TD]
[TD]Sum of Quantity 1[/TD]
[TD]Sum of Quantity 2[/TD]
[TD]Sum of Quantity 1[/TD]
[TD]Sum of Quantity 2[/TD]
[TD]Sum of Quantity 1[/TD]
[TD]Sum of Quantity 2[/TD]
[TD]Sum of Quantity 1[/TD]
[TD]Sum of Quantity 2[/TD]
[TD]Sum of Quantity 1[/TD]
[TD]Sum of Quantity 2[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1-Jan-14[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD]5-Jan-14[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]12[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD]5-Feb-14[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]18[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD]8-Feb-14[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]29[/TD]
[TD="align: right"]12[/TD]
[/TR]
[TR]
[TD]Grand Total[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Any advice on how to solve this is much appreciated. Thank you very much.
Regards,
Puzzled excel user
I have a database like this
Date | Customer | Item 1 | Quantity 1 | Item 2 | Quantity 2 | Item 3 | Quantity 3 |
1-Jan-14 | A | orange | 5 | apple | 8 | banana | 3 |
5-Jan-14 | B | apple | 3 | ||||
5-Jan-14 | C | banana | 4 | apple | 2 | ||
5-Feb-14 | A | apple | 6 | ||||
8-Feb-14 | A | banana | 4 | orange | 2 | ||
8-Feb-14 | C | banana | 7 |
<tbody>
</tbody>
and would like to use it to create a summary table (using pivot table?) like the below
[TABLE="width: 845"]
<tbody>[TR]
[TD="class: xl64, width: 65"][/TD]
[TD="class: xl65, width: 65"]A[/TD]
[TD="class: xl64, width: 65"][/TD]
[TD="class: xl64, width: 65"][/TD]
[TD="class: xl65, width: 65"]B[/TD]
[TD="class: xl64, width: 65"][/TD]
[TD="class: xl64, width: 65"][/TD]
[TD="class: xl65, width: 65"]C[/TD]
[TD="class: xl64, width: 65"][/TD]
[TD="class: xl64, width: 65"][/TD]
[TD="class: xl65, width: 65"]Total[/TD]
[TD="class: xl64, width: 65"][/TD]
[TD="class: xl64, width: 65"][/TD]
[/TR]
[TR]
[TD="class: xl64"][/TD]
[TD="class: xl64"]Apple[/TD]
[TD="class: xl64"]Banana[/TD]
[TD="class: xl64"]Orange[/TD]
[TD="class: xl64"]Apple[/TD]
[TD="class: xl64"]Banana[/TD]
[TD="class: xl64"]Orange[/TD]
[TD="class: xl64"]Apple[/TD]
[TD="class: xl64"]Banana[/TD]
[TD="class: xl64"]Orange[/TD]
[TD="class: xl64"]Apple[/TD]
[TD="class: xl64"]Banana[/TD]
[TD="class: xl64"]Orange[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]1-Jan-14[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]5-Jan-14[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]13[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]5-Feb-14[/TD]
[TD="align: right"]14[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]8-Feb-14[/TD]
[TD="align: right"]14[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]11[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]18[/TD]
[TD="align: right"]7[/TD]
[/TR]
</tbody>[/TABLE]
The summary table should show the running total of orders by customer (A, B, C, etc.) and then by type (orange, apple, etc.). It should also show the running total of order by all customers by type.
There are a few constraints:
1) I cannot change the format of the database.
2) New rows (and potentially columns) will be added to the database over time.
3) I would like the summary table to adjust itself as the database changes. At the moment, I have defined the range of the database using an OFFSET function and create a pivot table that refers to the defined range. The reason I am using the pivot table function is because it is the only way I know to make sure that the table would refresh itself with the database. Please let me know if there are better ways.
I am facing these problems:
1) I cannot get Excel to aggregate the data under the columns "Item 1", "Item 2", etc. and reorganise it into a summary grouped by type (Apple, Orange, etc.) In other words, ideally Excel should sum the numbers under the columns "Quantity 1" and "Quantity 2" if the corresponding entries under "Item 1" and "Item 2" are the same (let's say they are both "Apple"). Instead, the pivot table would add the Apples under "Item 1"/"Quantity 1" separately from the Apples under "Item 2"/"Quantity 2".
2) I cannot get Excel to split the total order from all customers by "Apple", "Orange", etc. I can get the total number of fruit or total number of Quantity 1, but not a total number of Apples.
The below is what my pivot table currently looks like, which is very different from what I want.
[TABLE="width: 1476"]
<tbody>[TR]
[TD][/TD]
[TD]Column Labels[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]A[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]B[/TD]
[TD][/TD]
[TD]C[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Total Sum of Quantity 1[/TD]
[TD]Total Sum of Quantity 2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]apple[/TD]
[TD][/TD]
[TD]banana[/TD]
[TD][/TD]
[TD]orange[/TD]
[TD][/TD]
[TD]apple[/TD]
[TD][/TD]
[TD]banana[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD](blank)[/TD]
[TD][/TD]
[TD]orange[/TD]
[TD][/TD]
[TD]apple[/TD]
[TD][/TD]
[TD](blank)[/TD]
[TD][/TD]
[TD]apple[/TD]
[TD][/TD]
[TD](blank)[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Row Labels[/TD]
[TD]Sum of Quantity 1[/TD]
[TD]Sum of Quantity 2[/TD]
[TD]Sum of Quantity 1[/TD]
[TD]Sum of Quantity 2[/TD]
[TD]Sum of Quantity 1[/TD]
[TD]Sum of Quantity 2[/TD]
[TD]Sum of Quantity 1[/TD]
[TD]Sum of Quantity 2[/TD]
[TD]Sum of Quantity 1[/TD]
[TD]Sum of Quantity 2[/TD]
[TD]Sum of Quantity 1[/TD]
[TD]Sum of Quantity 2[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1-Jan-14[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD]5-Jan-14[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]12[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD]5-Feb-14[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]18[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD]8-Feb-14[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]29[/TD]
[TD="align: right"]12[/TD]
[/TR]
[TR]
[TD]Grand Total[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Any advice on how to solve this is much appreciated. Thank you very much.
Regards,
Puzzled excel user
Last edited: