Home > Topics > excel > body text

4 ways to learn sorting and insert formulas in Excel pivot tables

青灯夜游
Release: 2022-09-01 10:45:28
forward
12860 people have browsed it

In the previous article "How to deal with common complications in learning Excel pivot tables", we learned how to deal with common complications in pivot tables. Today we continue to learn pivot tables. . Pivot table is one of the very important tools in Excel. It saves us a lot of time. Many times you work overtime, maybe because you don't know how to use it. Today I will share with you the third tutorial on pivot tables. It mainly explains how to sort Excel pivot tables and how to insert excel pivot table formulas. Take a look below!

4 ways to learn sorting and insert formulas in Excel pivot tables

I have previously posted two tutorials on excel pivot tables. I believe everyone already has a general understanding of pivot tables, right? Usually we use pivot tables to summarize data. As soon as we drag and drop the fields, 80% of the work of summarizing the data is completed. It is so convenient! So today we will deal with the remaining 20% ​​of the work~

1. Sort the pivot table

As shown in the figure In the table, the data needs to be statistically calculated to calculate the proportion of the quantity and amount received by each person in each department, and it can be filtered by month. I believe that friends who have read the first two tutorials will be able to operate it.

4 ways to learn sorting and insert formulas in Excel pivot tables

I won’t go into details here. The results of the pivot table are as follows. In this article, we will continue to learn how to sort Excel pivot tables.

4 ways to learn sorting and insert formulas in Excel pivot tables

1. Sorting by single key field

Now you need to arrange the collection quantity in order from high to low. Right-click any cell in the collection quantity column and click "Sort" - "Descending".

4 ways to learn sorting and insert formulas in Excel pivot tables

You can see that the summary quantity of each department is arranged in descending order, but the number of people in each department is not arranged in descending order.

4 ways to learn sorting and insert formulas in Excel pivot tables

Right-click any cell in the position column and select "Sort" - "Other Sorting Options".

4 ways to learn sorting and insert formulas in Excel pivot tables

In the pop-up dialog box, click "Sort Descending" - "Receive Quantity". Click OK.

4 ways to learn sorting and insert formulas in Excel pivot tables

#You can see at this point that the number of people in each department has also been sorted in descending order.

4 ways to learn sorting and insert formulas in Excel pivot tables

2. Sorting by multiple key fields

Our previous requirement is just to sort the quantity received, then if When the quantities are the same, what about the descending order of amounts?

In order to show you more intuitively, we first cancel the classification and summary. Click on the pivot table and click "Design" - "Subtotals" - "Do not show subtotals" in the floating tab. Then delete the "Department" and "Position" fields. The results are as follows.

4 ways to learn sorting and insert formulas in Excel pivot tables

Right-click in the collection quantity column and click "Sort" - "Descending Order". The results are as follows.

4 ways to learn sorting and insert formulas in Excel pivot tables

When the received quantities are the same, sort them in descending order by amount. Right-click in the amount column and select descending order. The results are as follows.

4 ways to learn sorting and insert formulas in Excel pivot tables

#You will find that the amount is sorted in descending order, but the collection amount column is disrupted again. Because the pivot table is refreshed every time it is sorted, the results of the last sort will not be saved.

Right-click in the name column and select "Sort" - "Other Sorting Options". Click "Other Options" in the pop-up dialog box.

14 ways to learn sorting and insert formulas in Excel pivot tables

Uncheck "Automatically sort every time the report is updated". Click OK.

14 ways to learn sorting and insert formulas in Excel pivot tables

At this time, set the amount and received quantity in descending order to get the correct result. As shown below, the received quantities are arranged in descending order. When the received quantities are the same, they are arranged in descending order according to the amount.

14 ways to learn sorting and insert formulas in Excel pivot tables

3. Manually enter the sorting

table as shown below. We first create a pivot table.

14 ways to learn sorting and insert formulas in Excel pivot tables

The pivot table is as shown below, we need to sort the department column.

14 ways to learn sorting and insert formulas in Excel pivot tables

#If you directly right-click to sort in ascending order, the result is as follows. The Chinese characters are sorted in ascending order of pinyin, which is not the result we want.

14 ways to learn sorting and insert formulas in Excel pivot tables

In fact, we directly click on the first cell, enter "Market 1" and press Enter, and the department columns will be sorted. As follows.

14 ways to learn sorting and insert formulas in Excel pivot tables

4. Set custom sorting

In the first three methods, we first create a pivot table and then sort the data. To sort, we can actually set the sorting rules in advance.

Click "File"-"Options" and the dialog box shown below will pop up.

14 ways to learn sorting and insert formulas in Excel pivot tables

Click "Advanced" - "General" - "Edit Custom List".

14 ways to learn sorting and insert formulas in Excel pivot tables

Enter the sequence on the right, press Enter and line feed.

4 ways to learn sorting and insert formulas in Excel pivot tables

Click Add and you can see it in the custom sequence on the left. Click OK.

24 ways to learn sorting and insert formulas in Excel pivot tables

At this time, we select the data area of ​​the previous case, insert the pivot table, drag in the fields, and you will see that the first column of the pivot table has been automatically sorted. .

24 ways to learn sorting and insert formulas in Excel pivot tables

2. Insert formulas into the Pivot Table

It is also very convenient to use formulas in the Pivot Table , we still use the first case data as a demonstration.

24 ways to learn sorting and insert formulas in Excel pivot tables

The company stipulates that 0.3% of the total amount of materials received by each person within a year must be deducted from each person's salary.

Click on the pivot table and click "Options" - "Fields, Items, and Sets" - "Calculated Fields" in the floating tab.

24 ways to learn sorting and insert formulas in Excel pivot tables

Enter "deduction amount" after the name.

24 ways to learn sorting and insert formulas in Excel pivot tables

Then enter the equal sign after the formula, click the field "Amount" below, and click "Insert Field", then "Amount" will appear after the formula.

24 ways to learn sorting and insert formulas in Excel pivot tables

After entering the complete formula, click OK.

24 ways to learn sorting and insert formulas in Excel pivot tables

#You will see a column automatically inserted behind the pivot table, and the amount that each person needs to deduct has been calculated.

24 ways to learn sorting and insert formulas in Excel pivot tables

After reading today’s tutorial, you are no longer as unfamiliar with pivot tables as you were at first, right? Being proficient in using the pivot table and giving full play to the role of each tool can bring great convenience to our work. We must follow the instructions again!

Related learning recommendations: excel tutorial

The above is the detailed content of 4 ways to learn sorting and insert formulas in Excel pivot tables. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:itblw.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template