Pivot tables are a robust instrument in Excel that can be utilized to summarize and analyze knowledge. One of many many issues that pivot tables can do is subtract counterparts. This may be helpful for duties similar to discovering the distinction between two units of numbers, or for calculating the web earnings or loss for a enterprise. Whenever you create a pivot desk, you possibly can specify which fields you need to use as rows, columns, and values. To ensure that the pivot desk to subtract counterparts, you could use a numeric discipline because the values discipline. For instance, you probably have an information set that features gross sales figures for various merchandise, you would create a pivot desk that exhibits the whole gross sales for every product. Within the values discipline, you would choose the gross sales figures discipline. After getting created the pivot desk, you should utilize the Summarize Values By choice to specify how the values needs to be summarized.
The Summarize Values By choice lets you select from a wide range of abstract features, together with sum, common, and rely. If you wish to subtract counterparts, you must choose the sum perform. After getting chosen the sum perform, you possibly can click on on the OK button to create the pivot desk. The pivot desk will show the whole gross sales for every product. If there are any unfavorable gross sales figures, they are going to be subtracted from the whole. For instance, if one of many merchandise had whole gross sales of $100 and one other product had whole gross sales of -$50, the pivot desk would show the web gross sales as $50. You should use the pivot desk to investigate the info and determine developments and patterns. The pivot desk can be used to create charts and graphs that may assist you visualize the info.
Pivot tables are a flexible instrument that can be utilized for a wide range of duties. By understanding the best way to use the Summarize Values By choice, you should utilize pivot tables to subtract counterparts and carry out different calculations. This may be helpful for a wide range of duties, similar to analyzing monetary knowledge, calculating averages, and discovering variations between two units of numbers. With slightly observe, you should utilize pivot tables to effectively and successfully analyze your knowledge.
Understanding Pivot Tables
Pivot tables are highly effective instruments in Microsoft Excel and Google Sheets that permit you to summarize and analyze knowledge effectively. They allow you to create interactive tables that may be reconfigured by dragging and dropping fields, offering a complete view of your knowledge from varied views.
At their core, pivot tables consist of 4 important elements: rows, columns, values, and filters. Rows and columns signify the classes or teams of information you need to analyze, whereas values present the numerical knowledge related to these teams. Filters permit you to slim down the info to particular subsets, specializing in the facets which might be most related to your evaluation.
Pivot tables provide a flexible platform for knowledge manipulation and exploration. They permit you to carry out calculations, similar to sums, averages, and counts, on the info and create clear, concise reviews that spotlight the important thing insights and patterns inside your dataset.
Subtracting Numbers
Subtracting numbers in a pivot desk is an easy course of that lets you evaluate totally different values and determine deltas or variations. To subtract numbers in a pivot desk, observe these steps:
- Click on on the cell the place you need to show the subtraction outcome.
- Go to the “System Bar” on the high of the window.
- Enter a formulation that subtracts the values of two cells. For instance, to subtract the worth in cell A2 from the worth in cell B2, enter the formulation “=B2-A2”.
- Press “Enter” and the outcome will likely be displayed within the cell.
You too can use the “Calculated Discipline” function in pivot tables to create a brand new discipline that represents the distinction between two values. This lets you save the ensuing calculation and reuse it in different components of the pivot desk or in different calculations.
Step 1: Set Up the Pivot Desk Supply Knowledge
2. Specify the Knowledge Vary
Exactly choosing the info vary is essential for an correct pivot desk. To do that, make sure you spotlight all of the pertinent cells inside your dataset. Keep away from leaving out any obligatory columns or rows, as this might lead to incorrect knowledge or lacking values within the generated pivot desk. For readability, it is beneficial to make use of named ranges or particular cell references throughout the knowledge supply when defining the info vary.
When defining the info vary, meticulous consideration needs to be paid to the inclusion of header rows and columns. In case your dataset comprises headers, be sure they’re included throughout the chosen vary. Nonetheless, if the headers will not be current, guarantee they’re excluded to keep away from potential errors within the pivot desk creation course of.
Contemplate the next desk for example:
Month | Gross sales | Returns |
---|---|---|
January | $10,000 | $1,000 |
February | $12,000 | $800 |
March | $15,000 | $900 |
To outline the info vary for this instance, you’d spotlight cells A1:C4, making certain that each the header row and the info rows are included within the choice.
Step 2: Insert the Pivot Desk
Set Up the Pivot Desk
Now, let’s create the pivot desk itself. Comply with these steps:
- Choose the Knowledge: Spotlight the vary of cells containing the info you need to analyze.
- Insert the Pivot Desk: Go to the "Insert" tab and click on on "PivotTable."
- Select the Vacation spot: A pop-up window will seem. Choose the placement the place you need the pivot desk to be positioned. You possibly can select an current worksheet or create a brand new one.
Add Fields to the Pivot Desk
As soon as the pivot desk is inserted, you have to add fields to it for additional evaluation. Here is how:
- Drag and Drop Fields: From the "PivotTable Fields" pane on the proper, drag fields into the "Rows," "Columns," or "Values" areas of the pivot desk.
- Select Fields: Choose the fields which might be related to your evaluation. For instance, drag the "Class" discipline to "Rows" and the "Quantity" discipline to "Values."
Configure Pivot Desk Settings
After including fields, you possibly can regulate varied settings within the pivot desk to customise its look and conduct:
- Discipline Settings: Proper-click on a discipline within the "Rows," "Columns," or "Values" space to entry discipline settings. You possibly can change the kind order, grouping, and different choices.
- PivotTable Choices: Click on on the "PivotTable Choices" button within the "PivotTable Analyze" tab to regulate varied settings, similar to present gridlines, allow drill-down, and apply filters.
Step 3: Place Fields within the Pivot Desk
Drag Worth Discipline to “Values” Space
To indicate the variations between numbers, you have to add the sector that comprises the numerical values to the “Values” space of the Pivot Desk. This space is usually situated on the backside proper nook of the Pivot Desk. Merely drag and drop the worth discipline into the “Values” space.
Drag Row Label Discipline to “Rows” Space
The Row Labels space determines the rows in your Pivot Desk. Drag and drop the sector that you just need to use as row labels into the “Rows” space. This discipline sometimes gives a selected class or group for every row.
Drag Column Label Discipline to “Columns” Space
Much like the Row Labels, the Column Labels space determines the columns in your Pivot Desk. Drag and drop the sector that you just need to use as column labels into the “Columns” space. This discipline sometimes represents a special class or group for every column.
Configure Worth Discipline Settings
After getting positioned the fields, right-click on the worth discipline within the “Values” space. Within the context menu, choose “Worth Discipline Settings”. This may open a dialog field the place you possibly can configure how the values are displayed.
Within the “Summarize worth discipline by” drop-down record, choose “Subtract” to show the variations between the numbers.
Further Ideas
- You possibly can drag a number of fields into the “Rows” or “Columns” areas to create a extra detailed Pivot Desk.
- You should use the “Kind & Filter” choices within the Pivot Desk toolbar to customise the order and filtering of the info.
- You too can use Slicers, that are interactive filters, to dynamically filter the info within the Pivot Desk.
Step 4: Create Calculated Discipline for Subtraction
5. Outline the Calculation
Now, let’s outline the calculation to subtract the alternative numbers. Click on on the “Insert” tab within the PivotTable Instruments part, then choose “Calculated Discipline”. Within the “Title” discipline, enter a descriptive title to your calculated discipline, similar to “Subtracted Values.”
Within the “System” discipline, use the next syntax:
“`
=FieldName1 – FieldName2
“`
Change “FieldName1” with the title of the sector containing the constructive numbers and “FieldName2” with the title of the sector containing the unfavorable numbers. In our instance, the constructive numbers are within the “Gross sales” discipline and the unfavorable numbers are within the “Returns” discipline, so the formulation could be:
“`
=Gross sales – Returns
“`
As soon as you have entered the formulation, click on “OK” so as to add the calculated discipline to your pivot desk. The calculated discipline will now be displayed within the “Fields” record and will be added to the Rows, Columns, or Values sections of the pivot desk.
Instance:
As an instance you’ve gotten the next knowledge desk:
Month | Gross sales | Returns |
---|---|---|
January | $100,000 | $10,000 |
February | $120,000 | $12,000 |
March | $140,000 | $14,000 |
After making a calculated discipline utilizing the “Gross sales – Returns” formulation, the pivot desk would present the next values:
Month | Gross sales | Returns | Subtracted Values |
---|---|---|---|
January | $100,000 | $10,000 | $90,000 |
February | $120,000 | $12,000 | $108,000 |
March | $140,000 | $14,000 | $126,000 |
Step 5: Subtract Corresponding Values
To subtract corresponding values in a pivot desk, you have to to make use of the CALCULATE perform. The CALCULATE perform lets you carry out calculations on knowledge in a pivot desk, and it may be used to subtract values from totally different rows or columns.
To make use of the CALCULATE perform to subtract corresponding values, you have to to specify the next arguments:
1. Expression: The expression that you just need to calculate. On this case, you’ll want to specify the distinction between two values.
2. Filter1: The filter that you just need to apply to the primary worth.
3. Filter2: The filter that you just need to apply to the second worth.
For instance, the next formulation would subtract the worth within the “Gross sales” column for the “East” area from the worth within the “Gross sales” column for the “West” area:
“`
=CALCULATE([Sales], [Region] = “East”) – CALCULATE([Sales], [Region] = “West”)
“`
You too can use the CALCULATE perform to subtract corresponding values from totally different rows. For instance, the next formulation would subtract the worth within the “Gross sales” column for the primary row from the worth within the “Gross sales” column for the second row:
“`
=CALCULATE([Sales], ROW() = 1) – CALCULATE([Sales], ROW() = 2)
“`
The CALCULATE perform is a robust instrument that can be utilized to carry out a wide range of calculations on knowledge in a pivot desk. By understanding the best way to use the CALCULATE perform, you possibly can create pivot tables that offer you the data you have to make knowledgeable selections.
Subtracting Corresponding Values from Completely different Tables
In some instances, you might need to subtract corresponding values from totally different tables. For instance, you might need to subtract the gross sales from one desk from the gross sales from one other desk. To do that, you have to to make use of the RELATED perform. The RELATED perform lets you retrieve knowledge from a associated desk.
To make use of the RELATED perform to subtract corresponding values from totally different tables, you have to to specify the next arguments:
1. Expression: The expression that you just need to calculate. On this case, you’ll want to specify the distinction between two values.
2. Desk: The desk that you just need to retrieve knowledge from.
3. Filter: The filter that you just need to apply to the info.
For instance, the next formulation would subtract the worth within the “Gross sales” column from the “Gross sales” desk from the worth within the “Gross sales” column from the “Orders” desk:
“`
=CALCULATE([Sales], RELATED([Sales Table])) – CALCULATE([Sales], RELATED([Orders Table]))
“`
The RELATED perform is a robust instrument that can be utilized to carry out a wide range of calculations on knowledge from totally different tables. By understanding the best way to use the RELATED perform, you possibly can create pivot tables that offer you the data you have to make knowledgeable selections.
Step 6: Regulate Pivot Desk Formatting
Cell Formatting
Customise the looks of cells by choosing them and making use of formatting choices from the “Dwelling” tab. You possibly can change font, dimension, colour, and background colour. For unfavorable numbers, right-click on the chosen cells, choose “Format Cells”, and set the “Quantity” format to a customized format with unfavorable numbers displayed in a special colour or brackets.
Column Width and Row Peak
Regulate the width of columns and the peak of rows to make the desk simpler to learn. Choose a column or row header and drag its border to the specified dimension. You too can double-click on the border to robotically match the content material.
Disguise or Present Grand Totals
Grand totals will be hidden or proven as wanted. Proper-click on the grand whole cell and choose “Disguise Grand Complete” or “Present Grand Complete”.
Add Calculated Fields
Calculated fields permit you to carry out calculations on the info within the pivot desk. Choose the “Analyze” tab and click on on “Calculated Discipline”. Enter a reputation and formulation for the calculated discipline, similar to “(Value1) – (Value2)” to subtract two values.
Freeze Panes
Freeze panes to maintain sure rows or columns in place whereas scrolling. Choose the rows or columns you need to freeze and go to the “View” tab. Click on on “Freeze Panes” and choose the specified choice, similar to “Freeze Prime Row” or “Freeze First Column”.
Create a Calculated Discipline to Subtract Reverse Numbers
To create a calculated discipline that subtracts counterparts, observe these steps:
- Choose the “Analyze” tab and click on on “Calculated Discipline”.
- Enter a reputation for the sector, similar to “Distinction”.
- Within the formulation discipline, enter the formulation “IF([Value] < 0, [Value] * -1, [Value])”.
- Click on “OK” to create the calculated discipline.
Worth | Distinction |
---|---|
10 | 10 |
-5 | 5 |
0 | 0 |
Step 7: Use Filters and Slicers for Refinement
To additional refine your pivot desk, you possibly can apply filters and slicers to particular knowledge fields, permitting you to concentrate on related subsets of knowledge. For example:
8. Make the most of Slicers for Interactive Filtering
Slicers present an interactive approach to filter your knowledge. By clicking on particular values in a slicer, you possibly can immediately filter the pivot desk to show solely the info that meets the chosen standards. This lets you rapidly isolate particular developments or patterns in your knowledge.
So as to add a slicer, choose the sector you need to filter by from the PivotTable Fields record. Drag it to the Slicer part of the Discipline Listing. A number of slicers will be added, enabling you to filter by a number of standards concurrently.
Here is an instance of utilizing a slicer to filter a pivot desk that summarizes gross sales knowledge by area and product:
Area | Gross sales |
---|---|
Central | $10,000 |
East | $12,000 |
West | $15,000 |
By clicking on the “Central” worth within the Area slicer, you possibly can isolate the gross sales knowledge for the Central area:
Product | Gross sales |
---|---|
A | $3,000 |
B | $4,000 |
C | $3,000 |
Step 8: Customise Pivot Desk Design
After getting created your pivot desk, you possibly can customise its design to make it extra visually interesting and simpler to learn. To do that, choose the pivot desk and click on on the “Design” tab within the ribbon. Right here you possibly can change the font, colour, and dimension of the textual content, in addition to the borders and shading of the cells.
Customizing Quantity Codecs
One vital facet of customizing your pivot desk is to format the numbers appropriately. By default, pivot tables will show numbers in a common format, however you possibly can change this to a extra particular format, similar to foreign money, share, or date.
To vary the quantity format, choose the column or cell that you just need to format and click on on the “Quantity Format” drop-down menu within the “Quantity” group on the “Dwelling” tab. Right here you possibly can select from a wide range of pre-defined codecs, or you possibly can create your individual customized format.
Pre-defined Codecs | Description |
---|---|
Forex | Shows numbers as foreign money, with a foreign money image and 1000’s separator. |
Proportion | Shows numbers as percentages, with a % signal. |
Date | Shows numbers as dates, with a date format that you just specify. |
Customized | Lets you create your individual customized quantity format, utilizing a wide range of placeholders and symbols. |
By customizing the quantity codecs in your pivot desk, you may make it simpler to learn and interpret the info.
Greatest Practices for Pivot Desk Subtraction
10. Deal with Detrimental Values Fastidiously
Pivot tables robotically subtract constructive and unfavorable values, however unfavorable values can generally result in deceptive outcomes. To stop this, observe these greatest practices:
- Use absolute values. Convert unfavorable values to their absolute values (e.g., -5 to five) earlier than performing subtraction to make sure that the result’s all the time constructive.
- Use the SUMIFS perform. The SUMIFS perform lets you specify a number of standards, together with whether or not a price is constructive or unfavorable. This lets you exclude unfavorable values from the calculation.
- Create a separate discipline for unfavorable values. If you have to show each constructive and unfavorable values in your pivot desk, create a separate discipline for unfavorable values and use the SUM perform to calculate the sum.
Technique | Professionals | Cons |
---|---|---|
Absolute values | Ensures constructive outcomes | Can distort the underlying knowledge |
SUMIFS perform | Permits for exact filtering | Could be advanced to implement |
Separate discipline for unfavorable values | Preserves the unique knowledge | Requires further setup |
The right way to Create a Pivot Desk that Subtracts Reverse Numbers
Making a pivot desk is a good way to summarize and analyze your knowledge. You should use pivot tables to calculate sums, averages, counts, and different statistical measures. You too can use pivot tables to create charts and graphs. One widespread process that you just may must carry out in a pivot desk is to subtract counterparts.
For instance, you may need a dataset that tracks gross sales and refunds. You may need to create a pivot desk to summarize the whole gross sales and refunds by product. You could possibly then use the pivot desk to calculate the web gross sales for every product by subtracting the refunds from the gross sales.
To create a pivot desk that subtracts counterparts, you have to to make use of the next steps:
1. Choose the info that you just need to summarize.
2. Click on the Insert tab.
3. Click on the PivotTable button.
4. Within the Create PivotTable dialog field, choose the vacation spot for the pivot desk.
5. Click on the OK button.
6. Drag the fields that you just need to use as rows, columns, and values into the PivotTable Fields pane.
7. Proper-click on the worth discipline that you just need to subtract.
8. Choose the Summarize Values By choice.
9. Choose the Distinction choice.
10. Click on the OK button.
Your pivot desk will now be up to date to point out the distinction between the 2 values.
Folks Additionally Ask
How do I create a pivot desk in Excel?
To create a pivot desk in Excel, you have to to observe these steps:
1. Choose the info that you just need to summarize.
2. Click on the Insert tab.
3. Click on the PivotTable button.
4. Within the Create PivotTable dialog field, choose the vacation spot for the pivot desk.
5. Click on the OK button.
6. Drag the fields that you just need to use as rows, columns, and values into the PivotTable Fields pane.
How do I subtract two values in a pivot desk?
To subtract two values in a pivot desk, you have to to observe these steps:
1. Proper-click on the worth discipline that you just need to subtract.
2. Choose the Summarize Values By choice.
3. Choose the Distinction choice.
4. Click on the OK button.
How do I create a pivot desk that exhibits the distinction between two values?
To create a pivot desk that exhibits the distinction between two values, you have to to observe these steps:
1. Choose the info that you just need to summarize.
2. Click on the Insert tab.
3. Click on the PivotTable button.
4. Within the Create PivotTable dialog field, choose the vacation spot for the pivot desk.
5. Click on the OK button.
6. Drag the fields that you just need to use as rows, columns, and values into the PivotTable Fields pane.
7. Proper-click on the worth discipline that you just need to subtract.
8. Choose the Summarize Values By choice.
9. Choose the Distinction choice.
10. Click on the OK button.