| Product Name | Category | Price | Quantity | Sales Date |
|--------------|-------------|-------|----------|------------|
| Laptop | Electronics | 1000 | 5 | 2023-01-01 |
| T-shirt | Clothing | 20 | 10 | 2023-01-05 |
| Smartphone | Electronics | 500 | 8 | 2023-01-10 |
Task :
- Create a PivotTable to summarize total sales by Category.
- Add a calculated field to the PivotTable to calculate profit margin (Sales - Total Cost).
- Insert a PivotChart based on the PivotTable created.
- Filter the PivotTable to show only Electronics category products.
- Group the Sales Date field in the PivotTable by month and year.
To perform the tasks outlined in Assignment using Excel, follow these step-by-step instructions:
Step 1: Creating PivotTable
· Steps:
- Select the data range (assuming A1 to E4).
- Go to Insert > PivotTable.
- In the Create PivotTable dialog box, ensure the range is correct and choose where to place the PivotTable.
- Drag "Category" to Rows and "Quantity" (or "Price" if considering revenue) to Values.
- Rename "Sum of Quantity" to "Total Sales" (or "Total Revenue").
- Your PivotTable should now show total sales by category.
Step 2: Adding Calculated Field
· Steps:
- With the PivotTable selected, go to PivotTable Analyze > Fields, Items & Sets > Calculated Field.
- Name the calculated field (e.g., Profit Margin).
- Enter the formula to calculate profit margin:
= 'Sales' - 'Total Cost'
Adjust the field names as per your PivotTable setup.
- Click OK. The calculated field will now appear in your PivotTable.
Step 3: Inserting PivotChart
· Steps:
- With the PivotTable selected, go to PivotTable Analyze > PivotChart.
- Choose the chart type you want to create (e.g., Column chart, Bar chart).
- Customize the PivotChart layout and formatting as needed.
- The PivotChart will now be linked to the PivotTable and update dynamically.
Step 4: Filtering Data in PivotTable
· Steps:
- Click on the drop-down arrow next to "Category" in the PivotTable.
- Uncheck the box for categories you want to hide (e.g., Clothing).
- Click OK or Apply to filter the data.
- The PivotTable will now display data only for the Electronics category.
Step 5: Grouping Dates in PivotTable
· Steps:
- Right-click on any date in the Sales Date field in the PivotTable.
- Select "Group..."
- In the Grouping dialog box, select "Months" and "Years".
- Click OK. The Sales Date field will now be grouped by month and year in the PivotTable.