+ Reply to Thread
Results 1 to 17 of 17

Return maximum value, provided two conditions are met.

Hybrid View

  1. #1
    Registered User
    Join Date
    10-25-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    15

    Return maximum value, provided two conditions are met.

    Hi All,

    I have come undone in trying to solve this one, I need to return the maxium value of DDH1234, DDH1235 (etc..) from column C, provided that column D = "NO". See the attached image, may make it a little clearer.

    Thanks in advance.

    Chan

    Excel.png
    Attached Files Attached Files
    Last edited by chan069; 11-21-2012 at 06:28 AM.

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: LOOKUP, IF, INDEX? Help!

    MAX(IF(A1:A100="DDH1235";IF(D1:D100="NO";CI:C1000)))

    Array formula.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: LOOKUP, IF, INDEX? Help!

    Formula: copy to clipboard
    =SUMPRODUCT(--MAX(--(A1:A500=DDH1234)*--(D1:D500="No")*--C1:C500))

    Adapt the ranges if required.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  4. #4
    Registered User
    Join Date
    10-25-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: LOOKUP, IF, INDEX? Help!

    Hi Sixthsence,

    I adapted your formula, however with no success as it returned a value of "0" whereas it needs to return "64", as shown in the attached image in the original post. Any help would be appreciated.

    Thanks,

    Chan

  5. #5
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: LOOKUP, IF, INDEX? Help!

    Quote Originally Posted by chan069 View Post
    Hi Sixthsence,
    Try this..
    Formula: copy to clipboard
    =SUMPRODUCT(--MAX(--(A1:A500=DDH1234)*--(D1:D500="No"),C1:C500))

  6. #6
    Registered User
    Join Date
    10-25-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: LOOKUP, IF, INDEX? Help!

    Hi Sixthsence,

    Seems to return the maximum value of column C, and therefore not accounting for whether it is yes or no. Thoughts?

    Regards,

    Chan

  7. #7
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: LOOKUP, IF, INDEX? Help!

    Hm.. Please ignore my post 11 it's just junk.

    I just missed to quote the DDH1234 inside the quotes like this "DDH1234".
    Formula: copy to clipboard
    =SUMPRODUCT(MAX(--(A1:A500="DDH1234")*--(D1:D500="No")*--(C1:C500)))

  8. #8
    Registered User
    Join Date
    10-25-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: LOOKUP, IF, INDEX? Help!

    Hi Fotis,

    Thank you for the post, however when testing the above formula it doesn't seem to work? It does not recognize DDH1235, despite the quotations (""). To rectify this I attempted just linking directly to a cell which had DDH1235, however this still failed. Amy thoughts?

    Thanks,

    Chan

  9. #9
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,028

    Re: LOOKUP, IF, INDEX? Help!

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    Never use Merged Cells in Excel

  10. #10
    Registered User
    Join Date
    10-25-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: LOOKUP, IF, INDEX? Help!

    Thanks for the friendly reminder.

    Regards,

    Chan

  11. #11
    Forum Contributor
    Join Date
    11-07-2012
    Location
    .
    MS-Off Ver
    2003 - 2013 for Windows
    Posts
    121

    Re: LOOKUP, IF, INDEX? Help!

    Hello,

    create a pivot table with the codes in the row labels, the value of column B in the Value pane, set "max" as the value field settings and filter the data by the desired value in column D.
    regards, LMP

  12. #12
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: LOOKUP, IF, INDEX? Help!

    Multiply ideas, if.

    1) Do what Moderator asked for you.

    2) Upload a sample workbook and not a picture. Can you work on a picture?

  13. #13
    Registered User
    Join Date
    10-25-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: LOOKUP, IF, INDEX? Help!

    No problems, see above.

    Regards,

    Chan

  14. #14
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Return maximum value, provided two conditions are met.

    =MAX(IF(A2:A1000="DDH1235",IF(D2:D1000="NO",C2:C1000)))

    Array formula. cONFIRM USING cONTROL+sHIFT+eNTER-nOT JUST ENTER.

  15. #15
    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: Return maximum value, provided two conditions are met.

    See this workbook.

    It generates a unique list of your codes, and the max if yes or no.

    Grag H2 Across then Down.
    Attached Files Attached Files
    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.

  16. #16
    Registered User
    Join Date
    10-25-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Return maximum value, provided two conditions are met.

    Thank you to you all for your help. Both the above formula and pivot tables worked a treat.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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