+ Reply to Thread
Results 1 to 2 of 2

Sorting, Ranking doesn't work with multi-row pivot table

  1. #1
    Registered User
    Join Date
    12-28-2018
    Location
    Pennsylvania, US
    MS-Off Ver
    Excel 2016-Windows 10
    Posts
    35

    Sorting, Ranking doesn't work with multi-row pivot table

    I have a pivot table of customers that I use to show revenue totals. In this table, I have columns showing where the customer ranks and the % of total for the year. I also would like to show the country and classification of the country so that it shows up like the following in the pivot table:

    Customer Country Class Revenue Rank % of Total

    Staples US Retail $100.00 1 3.20%

    BoA US Finance $50.00 2 1.60%

    The way I have learned to display this is by adding the fields 'country' and 'classification' below the customer in the rows section of the pivot table. Then I switch the report layout to tabular layout and turn off grand totals and subtotals.

    The problem is that when I do this it screws up the rankings so that it is ranking them from largest to smallest by customer but it's grouped by class so that since BoA is in a different class, it's ranking also shows 1 and if there was a 2nd retail after BoA it would show 2 despite actually being 3rd. I've checked the base field of the rank column and it says customer still despite grouping by class. Also if I try right clicking the table and resorting it by smallest to largest or anything else it does not sort. If I collapse the fields all the way back to the customer level so that the country and class don't show anything but are still there then the rankings and sorting work fine. But I want the data there.

    Is there a way to show the country and class in this format without screwing up all my rankings and still being able to properly sort?

    Thanks for any help.

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,578

    Re: Sorting, Ranking doesn't work with multi-row pivot table

    I believe that the easiest solution will be to add a rank column to the source data using a function like RANK.EQ
    We may be able to provide more specific help if we could see a sample of the data (utilize the instructions in the banner at the top of the page).
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Sorting VBA doesn't work - Need advice
    By kenken1987 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-05-2018, 11:11 AM
  2. Updating a pivot table with VBA from Drop down list (1st item doesn't work)
    By tray262 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-25-2013, 02:32 PM
  3. Conditional formatting applied to a pivot table doesn't work as it should
    By Pichingualas in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-14-2012, 07:43 AM
  4. Sorting Rows Doesn't Work, Please Help
    By binar in forum Excel General
    Replies: 30
    Last Post: 08-09-2006, 04:39 PM
  5. [SOLVED] Sorting numbers doesn't work correctly
    By GrammyEmmy in forum Excel - New Users/Basics
    Replies: 8
    Last Post: 06-25-2006, 06:50 PM
  6. "Show Field List" in Pivot Table Toolbar doesn't work
    By Flyer27 in forum Excel General
    Replies: 0
    Last Post: 04-11-2006, 07:10 PM
  7. Replies: 0
    Last Post: 02-24-2006, 07:50 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1