I have a data Excel sheet in the below format:
Name Fruits Condition of Fruits
===== ====== ====================
Ram Apple Good
Jadu Apple Bad
Tina Orange Good
Ram Orange Good
Tina Apple Bad
Ram Apple Bad
Output of the Pivot program in the other sheet of the same excel, say in sheet(2) should be
like this:
Name Fruits Condition of Fruits
==== ====== ===================
Good Bad Total
==== ===== ======
Ram Apple 1 1 2
Ram Orange 1 0 1
Tina Apple 0 1 1
Tina Orange 1 0 1
jadu Apple 0 1 1
===================================
Grand Total 3 3 6
===================================
The above format needs to be present in the Excel in the sheet(2), whenever sheet(1) will be having source data within it as shown in the first table.
I want Macro program to create using Excel pivot table concept.
If you insert a pivot table on your data, drag these columns into the Row Labels:
Then drag this column into the Column Labels:
Drag the same column into Values:
The pivot table looks almost the same as yours (except the fruit comes under the name, instead of repeating the name for each fruit).
Whenever you update the data in sheet 1, you may have the pivot table reflect this by right-clicking on the table and choosing Refresh.