+ Reply to Thread
Results 1 to 8 of 8

Maximum value by distinctive year

  1. #1
    Registered User
    Join Date
    06-02-2009
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    75

    Maximum value by distinctive year

    I have a table contains "year" & "value" columns. (example attached)

    I need to create summary table to show the maximum value within each year.

    I appreciate if somebody advices with formula to use.. Thanks
    Attached Files Attached Files

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Maximum value by distinctive year

    Try this

    In G7
    Please Login or Register  to view this content.
    Confirmed by pressing Ctrl+Shift+Enter

    Drag/Fill Down

    and for Minimum
    Please Login or Register  to view this content.
    Confirmed by pressing Ctrl+Shift+Enter

    Hope this helps
    Attached Files Attached Files
    Last edited by Marcol; 07-15-2010 at 01:08 PM. Reason: Added minimum as an extra
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

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

    Re: Maximum value by distinctive year

    Have you considered using a Pivot Table ?

    On an aside - re: the Array, though:

    =MAX(($A$3:$A$14=$F7)*($B$3:$B$14))

    will work without issue I confess I often prefer to split the conditional test from the resulting values, ie:

    =MAX(IF($A$3:$A$14=$F7),$B$3:$B$14))
    CSE

    I think this is cleaner but also it has the added advantage of being more "flexible" should you decide latterly you wish to revert to a MIN test - ie all you need do is adjust the MAX to MIN using the above method (resetting the array).

    In the first example you can not adjust to MIN in this manner as the MIN would always be 0 (unless all values met the pre-emptive condition)

    (same holds true for AVERAGE also)

  4. #4
    Registered User
    Join Date
    06-02-2009
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    75

    Re: Maximum value by distinctive year

    Thanks everybody, it works!

  5. #5
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Maximum value by distinctive year

    Hi DonkeyOte

    After I added the minimum "extra" to the demo workbook
    Please Login or Register  to view this content.

    This fell in place
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Confirmed by pressing Ctrl+Shift+Enter

    Is that approach better? or are there disadvantages that I don't know of ?

    I would really like to get a grip on this formula business.

    I also hope that adelkam will benefit, and that I am not poaching his thread.

    I have updated the demo with your formula added.
    Attached Files Attached Files

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

    Re: Maximum value by distinctive year

    "Better" is subjective of course but IMO, yes - when conducting MIN or AVERAGE calcs the approach is invariably a necessity rather than a choice so for me it makes sense to apply the same logic to MAX even though "technically" it can be avoided.

    There is one other benefit of separating test from associated values and that is you're removing the explicit coercion of associated values.

    Consider A1:B5

    a 1
    b 2
    a 3
    a b
    b 2

    The initial MAX approach would generate an Error (#VALUE!) given the explicit coercion of B1:B5

    =MAX((A1:A5="a")*B1:B5)
    CSE

    whereas the split approach avoids the coercion and thus does not generate an error

    =MAX(IF(A1:A5="a",B1:B5))
    CSE

    The Nulls added to the MIN/MAX/AVERAGE Arrays aren't technically required though they do no harm and perhaps makes the formula more intuitive.

    Where the conditional test fails a Boolean FALSE will be added to the resulting Array of values (by default), these Logical results will be ignored in the subsequent MIN/MAX/AVERAGE calculation.

  7. #7
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Maximum value by distinctive year

    I must be having a bad hair day...
    The formula I came up with for minimum when editing Post #2 is what you were suggesting in Post #3.

    Thank you for the clear explaination.

    If any more pennies drop today I'll feel like a one-armed-bandit with diarrhea ...

    I'm of to the pub before I've none left to spend ......... ... beer yum yum!!!

    Thanks again
    Alistair

  8. #8
    Registered User
    Join Date
    06-02-2009
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    75

    Re: Maximum value by distinctive year

    Thanks a lot for your help. Now I have another question (I'm attaching the file with Problem #2 in it)

    Using the same table example, I need to extract values from the original table, which are equal to or greater than a given threshold value.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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