+ Reply to Thread
Results 1 to 8 of 8

Maxif

  1. #1
    Forum Contributor
    Join Date
    05-28-2010
    Location
    Antwerp, Belgium
    MS-Off Ver
    Office 365
    Posts
    170

    Maxif

    Hello all,

    I am trying to do something like MAX IF, based on three conditions, I read some guides but still doesn't work out

    Here is the SUMIFS that does work:
    SUMIFS(Data!I:I,Data!A:A,Report!$B$1,Data!B:B,Report!A4,Data!E:E,2012)

    So it has to take the MAX from column Data!I:I based on these 3 criteria: Data!A:A,Report!$B$1,Data!B:B,Report!A4,Data!E:E,2012.

    Thanks.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Maxif

    =MAX(IF( (Data!A:A =Report!$B$1) * (Data!B:B=Report!A4) * (Data!E:E=2012), Data!I:I))

    ... confirmed with ctrl+shift+Enter

    I would change that to eliminate full-column references.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor
    Join Date
    05-28-2010
    Location
    Antwerp, Belgium
    MS-Off Ver
    Office 365
    Posts
    170

    Re: Maxif

    Thanks, it works. However, it's very laggy.
    What does the { do?
    And I didn't get the comment about full-column references..

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,504

    Re: Maxif

    Try to multiply the 3 criteria together, returns 1 if TRUE, 0 if FALSE, then multiply with I:I to get list of value of I:I that is TRUE, then MAX:
    Something like:
    Please Login or Register  to view this content.
    confirmed with Ctrl-shift-enter
    Quang PT

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Maxif

    What does the { do?
    http://office.microsoft.com/en-us/ex...001087290.aspx

    And I didn't get the comment about full-column references.
    Use only the range you need:

    =MAX(IF( (Data!A1:A100 =Report!$B$1) * (Data!B1:B100=Report!A4) * (Data!E1:E100=2012), Data!I1:I100))

    @bebo: If all the values in col I are negative, your formula will return 0 as the maximum.

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Maxif

    The reason it's laggy is because you are looking at the entire column. Choose a range that you know your data will fit into, i.e
    =MAX(IF( (Data!A2:A100 =Report!$B$1) * (Data!B2:B100=Report!A4) * (Data!E2:E100=2012), Data!I2:I100))

    The {} signifies you've set the function up as an Array function (when you hit CNTRL SHFT ENTER) which means excel will set aside memory for intermediate calculations. See;
    http://office.microsoft.com/en-us/ex...001087290.aspx

    EDIT: Too slow for shg! LOL. We even gave the same examples and link. I might need medical help.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  7. #7
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: Maxif

    Hi whatever61

    Or may be using the aggregate!

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Regards Kevin


    Merged Cells (They are the work of the devil!!!)

  8. #8
    Forum Contributor
    Join Date
    05-28-2010
    Location
    Antwerp, Belgium
    MS-Off Ver
    Office 365
    Posts
    170

    Re: Maxif

    Limiting it to a range helped.
    Thanks guys!

+ 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