+ Reply to Thread
Results 1 to 16 of 16

Create a custom max value from pivot table

  1. #1
    Registered User
    Join Date
    06-24-2014
    Location
    Indonesia
    MS-Off Ver
    2016
    Posts
    8

    Create a custom max value from pivot table

    Hi,

    I have a data consist of rainfall value from day to day basis for 10 years in a row. For simple task i can create a maximum value of them using pivot table.
    My question is, what if i want to create a 2-day or 3-day maximum value using pivot table? I can make it easily by a standard manual table, but i don't now how to do it in pivot table (i attached the sample what i want).

    Appreciate for any help.

    Regards,
    Attached Files Attached Files

  2. #2
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,223

    Re: Create a custom max value from pivot table

    In sheet "what i want" : Try in "B45"
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    This calculate first large. You also use =Max(range)

    "B46" :
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    This calculate second large. 2 stand by second.
    "B47" :
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    This calculate Third large. 3 stand by thrid.


    atul


    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved".

  3. #3
    Registered User
    Join Date
    06-24-2014
    Location
    Indonesia
    MS-Off Ver
    2016
    Posts
    8

    Re: Create a custom max value from pivot table

    Thank you for your respond AVK,

    But after i tried that formula, the result is different from using Max(sum) formula. it tends to get lower value result.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    04-04-2017
    Location
    The Netherlands
    MS-Off Ver
    Office 2016
    Posts
    18

    Re: Create a custom max value from pivot table

    Dear Irpanch,

    if i understand correctly, you mean bij 2 and 3 day max, the SUM of the two/three highest rain days.

    E.g. when the highest two are 10 and 8, you want it to show 18?

  5. #5
    Registered User
    Join Date
    06-24-2014
    Location
    Indonesia
    MS-Off Ver
    2016
    Posts
    8

    Re: Create a custom max value from pivot table

    yes, just like that. for a simple table i can use a max(sum) formula. But i don't know how to do it in pivot table.

  6. #6
    Registered User
    Join Date
    04-04-2017
    Location
    The Netherlands
    MS-Off Ver
    Office 2016
    Posts
    18

    Re: Create a custom max value from pivot table

    how to say,

    according to your sample. when say, day one and day 4 have the two highest rainfalls.

    Do you wish the "2 day high" to SUM them? or do you want it to check the surrounding dates to find a maximum of the 2 days subsequently?

    I hope you understand my question.

    StefanD

  7. #7
    Valued Forum Contributor
    Join Date
    09-25-2015
    Location
    Nowy Tomysl, Poland
    MS-Off Ver
    2019, O365
    Posts
    398

    Re: Create a custom max value from pivot table

    The calculation field allows you to apply basic operations such as: addition, subtraction, division, multiplication and functions IF

  8. #8
    Registered User
    Join Date
    06-24-2014
    Location
    Indonesia
    MS-Off Ver
    2016
    Posts
    8

    Re: Create a custom max value from pivot table

    Quote Originally Posted by StefanD View Post
    how to say,

    according to your sample. when say, day one and day 4 have the two highest rainfalls.

    Do you wish the "2 day high" to SUM them? or do you want it to check the surrounding dates to find a maximum of the 2 days subsequently?

    I hope you understand my question.

    StefanD
    Okay, i just realized my mistake by reading your comment. So, here's right concept of 2-day max and 3-day max:
    e.g. I have 5 days data in a row just like this:

    1 3
    2 0
    3 5
    4 36
    5 27

    Where as column 1 is day and, column 2 is value.
    2 day max means, find the maximum sum value between 2 days in a row data. It can be: day 1 + day 2 (3), day 2 + day 3 (5), day 3 + day 4 (41), and day 4 + day 5 (63). The answer is 63. (as you can see, on my first example i'm not count an overlapping value and that was terrible mistake. Sorry )
    moreover, 3 day max can be find by: day 1 + day 2 + day 3 (8), day 2 + day 3 + day 4 (41), and day 3 + day 4 + day 5 (68). The answer is 68.

    Hope you get a better understanding about it.
    Attached Files Attached Files

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

    Re: Create a custom max value from pivot table

    This proposed solution employs helper columns (V:Y is attached file). The formula that populates all helper columns is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    In the formula V3 references the number of days.
    The MAX function is then referenced toward the appropriate helper column to display the values in G7:G8
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  10. #10
    Registered User
    Join Date
    06-24-2014
    Location
    Indonesia
    MS-Off Ver
    2016
    Posts
    8

    Re: Create a custom max value from pivot table

    Quote Originally Posted by JeteMc View Post
    This proposed solution employs helper columns (V:Y is attached file). The formula that populates all helper columns is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    In the formula V3 references the number of days.
    The MAX function is then referenced toward the appropriate helper column to display the values in G7:G8
    Let us know if you have any questions.
    Great! it works perfect.
    i'm really appreciate it.

    is it possible to use your formula on a pivot table?

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

    Re: Create a custom max value from pivot table

    Should work. If you'll upload a sample of the pivot table along with the data feeding into it, we could do a better job of attempting to show you how.
    Let us know if you have any questions.

  12. #12
    Registered User
    Join Date
    06-24-2014
    Location
    Indonesia
    MS-Off Ver
    2016
    Posts
    8

    Re: Create a custom max value from pivot table

    okay, here's the data. Thank you very much.
    Attached Files Attached Files

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

    Re: Create a custom max value from pivot table

    See if this does what you want.
    Let us know if you have any questions.
    Attached Files Attached Files

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

    Re: Create a custom max value from pivot table

    In the file attached to post #13, replace the formula in N19 with:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    After entering, drag/copy the formula down to N22 (or N27 if you would like to see the Maximums for all periods of time).
    Let us know if you have any questions.
    Last edited by JeteMc; 04-05-2017 at 07:11 PM. Reason: Correcting error in formula

  15. #15
    Registered User
    Join Date
    06-24-2014
    Location
    Indonesia
    MS-Off Ver
    2016
    Posts
    8

    Re: Create a custom max value from pivot table

    yes, this is what i want..
    thank you.

    i'll mark it solved.

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

    Re: Create a custom max value from pivot table

    You're Welcome. Thank You for the feedback and for marking the thread as 'Solved'. I hope that you have a blessed day.

+ 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. Replies: 6
    Last Post: 01-24-2017, 06:56 PM
  2. Custom Pivot table
    By jonespandrew in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 07-29-2016, 11:34 AM
  3. Create a custom sub-total in a pivot table
    By matthewdete in forum Excel General
    Replies: 1
    Last Post: 07-03-2014, 03:45 AM
  4. Replies: 2
    Last Post: 07-14-2010, 01:33 PM
  5. Replies: 1
    Last Post: 07-13-2010, 08:24 PM
  6. [SOLVED] Create Pivot Table: Cannot Open Pivot Table Source File
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 01-05-2010, 05:11 AM
  7. Create custom list from pivot table
    By Onestopfanshop in forum Excel General
    Replies: 1
    Last Post: 06-24-2009, 03:58 PM

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