+ Reply to Thread
Results 1 to 8 of 8

Max and Min Calculation with Array

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    02-14-2017
    Location
    India
    MS-Off Ver
    2013
    Posts
    128

    Max and Min Calculation with Array

    Hi All,

    I need formula to find Max and Min Value when criteria matches in array. I don't know the way to explain. Attached the file for your reference.

    Any help would be appreciated.
    Attached Files Attached Files
    Manikandan Arumugam
    Excel Learner

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,030

    Re: Max and Min Calculation with Array

    In D2:

    =IF(B2=B1,"","$"&MIN(IF($B$2:$B$18=B2,IF($C$2:$C$18<>0,$C$2:$C$18)))&"-$"&MAX(IF($B$2:$B$18=B2,IF($C$2:$C$18<>0,$C$2:$C$18))))

    ... confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Once entered, drag copy down.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,941

    Re: Max and Min Calculation with Array

    d2=IF($A2="Variable",MIN(IF(($B$2:$B$18=$B2)*($A$2:$A$18<>"Variable"),$C$2:$C$18))&"-"&MAX(IF(($B$2:$B$18=$B2)*($A$2:$A$18<>"Variable"),$C$2:$C$18)),"")
    Try this array (Confirm with Ctrl+Shift+Enter) formula and copy towards down
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Max and Min Calculation with Array

    Use this array formula in D2, copied down:

    =IF(COUNTIF($B$2:B2,B2)=1,"$ "&MIN(IF($B$2:$B$18=B2,IF($C$2:$C$18>0,$C$2:$C$18)))&" - $ "&MAX(IF($B$2:$B$18=B2,IF($C$2:$C$18>0,$C$2:$C$18))),"")

    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,941

    Re: Max and Min Calculation with Array

    Try this array formula in C2
    =LARGE(IF($B3:$B$18=$B2,C3:$C$18),COUNTIF($B3:$B$18,$B2))&"-"&LARGE(IF($B3:$B$18=$B2,$C3:$C$18),1)
    copy and paste in c7 and c13

  6. #6
    Forum Contributor
    Join Date
    02-14-2017
    Location
    India
    MS-Off Ver
    2013
    Posts
    128

    Re: Max and Min Calculation with Array

    Thank You AliGw, Glenn, Nflsales.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,030

    Re: Max and Min Calculation with Array

    You're welcome!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Max and Min Calculation with Array

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ 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. Index Match array equation with sub-array calculation
    By glebbo in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-04-2012, 03:04 AM
  2. Calculation with non zero array values
    By PleaseExcelHelp in forum Excel General
    Replies: 2
    Last Post: 11-07-2011, 06:13 PM
  3. reading in array to use in calculation
    By gryffin13 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-01-2011, 09:42 AM
  4. array calculation and percentile
    By ianbec in forum Excel General
    Replies: 2
    Last Post: 06-16-2011, 01:50 AM
  5. calculation using array
    By Edward Masoya in forum Excel General
    Replies: 4
    Last Post: 05-01-2011, 04:07 AM
  6. Sum Array calculation error
    By AaronMS in forum Excel General
    Replies: 5
    Last Post: 05-07-2010, 11:48 AM
  7. Automatic Calculation on an Array
    By jerseyguy1996 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-23-2009, 04:31 PM
  8. Array Calculation Error
    By Tobro88 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 12-05-2005, 11:55 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