+ Reply to Thread
Results 1 to 8 of 8

Return the Max value from Pivot Table Totals

Hybrid View

  1. #1
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Return the Max value from Pivot Table Totals

    im not too hot at pivot tables but if you construct another as in attached then use array formulas in yellow cells then that might work, but........ it may be possible just to use the pivot itself to do this!!!!!!!!!
    Attached Files Attached Files
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Return the Max value from Pivot Table Totals

    If you're not going to be applying sub filters on resulting PT then it would make most sense to calculate against the raw data.

    Using your sample:

    K23: =MAX(IF(($I$4:$I$13=$I$20)*($M$4:$M$13<>0),$M$4:$M$13))
    confirmed with CTRL + SHIFT + ENTER

    K24: =MIN(IF(($I$4:$I$13=$I$20)*($M$4:$M$13<>0),$M$4:$M$13))
    confirmed with CTRL + SHIFT + ENTER

    (if you don't have negative values in K you can obviously modify the above - part. the MAX)

    Returning name associated with those values is invariably a little trickier:

    J23: =INDEX($K$4:$K$13,MATCH(1,INDEX(($I$4:$I$13=$I$20)*($M$4:$M$13=$K23),0),0))
    confirmed with Enter as normal
    copied to J24

    If your raw data is always sorted by Date you can make the above more efficient by determining appropriate range based on data first hand if so desired.


    If it is your intention to filter the PT and have the results update accordingly (eg exclude Supv2 would change results) then let us know. Calculating from the PT is possible but more complicated (obviously) and if you don't need to I wouldn't.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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