+ Reply to Thread
Results 1 to 8 of 8

If Statement - Max Value

  1. #1
    Registered User
    Join Date
    10-12-2009
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    32

    If Statement - Max Value

    I'm having trouble with writing an if statement to try and find the max value.

    =IF(G31:G3000=E19,IF(H31:H3000=B22,IF(D31:D3000=B3,MAX(Q:Q),"")))

    So the following will have a set value:

    E19, B22, B3

    And then Column Q will have all sorts of values. I want to find the max value of column Q if the previous 3 if statements are true.

    I'm receiving #Value! when I try the above statement though. Any suggestions?

    Thanks!

  2. #2
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: If Statement - Max Value

    That's an array formula.
    Enter with Ctrl+Shft+Ent.
    Hold down Control and Shift keys and hit enter.
    Excel will add {} brackets around the formula.
    You can't type in those brackets, you need to let Excel add them.
    modytrane.

  3. #3
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: If Statement - Max Value

    Change the formula to:

    Please Login or Register  to view this content.
    and enter with Ctrl+Shft+Ent.

    modytrane

  4. #4
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: If Statement - Max Value

    Sorry about that. Here's the correct formula.

    Please Login or Register  to view this content.
    Enter with Ctrl+Shft+Ent.

    modytrane.

  5. #5
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: If Statement - Max Value

    How about =IF(AND(Countif(G31:G34,E19),Countif(H31:H34,B22),Countif(D31:D34,B3)),Max(Q:Q),"") That doesn't have to be confirmed with CSE.

  6. #6
    Registered User
    Join Date
    10-12-2009
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: If Statement - Max Value

    I'm still having issues getting the correct number. I'm only receiving the highest number in the Q column, it's not qualifying it by the if statements...

    Hmm.

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

    Re: If Statement - Max Value

    It's not clear to me at least if you're looking to retrieve the Max associated Q value for all rows where prior conditions hold true... ie:

    Please Login or Register  to view this content.
    or if in fact you want MAX of all Q values if the above all hold true at least once (not nec. in same row) which is what darkyam has offered you...

  8. #8
    Registered User
    Join Date
    10-12-2009
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: If Statement - Max Value

    Perfect! That worked, thanks for the help!

+ 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