Share via

Sorting a column and adjoining pivot table at same time

Anonymous
2020-04-07T21:13:46+00:00

I have some code that creates a pivot table and then adds a column to the outside of the table that calculates a percentage of two of the columns within the table. I would like to sort that outside column, largest to smallest, but keep the pivot table aligned with the numbers. 

So columns A,B,C and D are the pivot table. Column E has the formula from B and D. 

Is there a way to link column E to the pivot table to allow me to do the sort?

Microsoft 365 and Office | Excel | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

5 answers

Sort by: Most helpful
  1. Anonymous
    2020-04-12T21:34:23+00:00

    Hi darrend7,

    Regarding the query, do you still need assistance? If so, you can follow Ashish's suggestion to upload a sample file with no confidential/ sensitive data to OneDrive, then share the link here.

    Best regards,

    Madoc

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2020-04-09T02:56:12+00:00

    Was this answer helpful?

    0 comments No comments
  3. Ashish Mathur 101.8K Reputation points Volunteer Moderator
    2020-04-09T00:07:10+00:00

    Hi,

    I can try to perform the calculation within the Pivot Table itself.  Please share the link from where I can download your workbook.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2020-04-08T15:10:53+00:00

    Hi Madoc,

    I am trying this, but I don't think it works for my situation. The field I am using is broken into two columns with a Grand Total. In the image below. Column F shows the value of B3/D3. You can see "Overdue Tasks" is the field and "On Time" as well as "Overdue" are values of that one field. and the numbers below are the "Count of Task_Responsible"

    Hope that makes sense.

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2020-04-08T09:16:27+00:00

    Hi darrend7,

    You can create formulas in the PivotTable to meet your requirement.

    As showing in the image, select a cell in PivotTable and click Fields, Items & Sets > Calculated Field under PivotTable Analysis, put a formula in the box, a column would be added to the right. Then you can sort the column according to your needs like from large to small.

    Best regards,

    Madoc

    Was this answer helpful?

    0 comments No comments