+ Reply to Thread
Results 1 to 5 of 5

Need result from Column A based on MAXIFS result from Column B

  1. #1
    Registered User
    Join Date
    01-23-2014
    Location
    United States
    MS-Off Ver
    Excel 2016 - Windows
    Posts
    20

    Need result from Column A based on MAXIFS result from Column B

    Hello.

    I'm having trouble with writing a formula that will give the, for instance, corresponding value in Column A based on the result of a MAXIFS formula that finds the Max value in Column C, if it first matches a Value in Column B.

    I've used the below code to find the Max Value in Column C, based on first matching a criteria found in Column B.

    Please Login or Register  to view this content.
    Yet, if I use OFFSET(MATCH) to try and retrieve the value I need from Column A, it gets tripped up with any duplicates. I've used the following:

    Please Login or Register  to view this content.
    I know the problem is that the code is finding the first instance of the matching value found from the MAXIFS formula, so what I need help with is forcing the formula to find the find the answer in Column C (based on matching a criteria in Column B) and then outputting the value in Column A based on finding what Row the answer to the previous MAXIFS was found in...

    My apology for not being able to explain more concisely. I've attached a workbook where i've tried to dumb it down to its simplest parts.

    Thanks in advance.
    Attached Files Attached Files
    Last edited by cchase22; 09-22-2016 at 06:15 PM.

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Need result from Column A based on MAXIFS result from Column B

    Use these normal formula

    In E5
    =MAX(INDEX(('Sheet 2'!$B$2:$B$202=E$4)*'Sheet 2'!$C$2:$C$202,0),0)
    Copy across

    In E10
    =INDEX('Sheet 2'!$A$2:$A$202,MATCH(1,INDEX(('Sheet 2'!$B$2:$B$202=E4)*('Sheet 2'!$C$2:$C$202=E5),0),0))
    Copy across
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Registered User
    Join Date
    01-23-2014
    Location
    United States
    MS-Off Ver
    Excel 2016 - Windows
    Posts
    20

    Re: Need result from Column A based on MAXIFS result from Column B

    Ace_XL - Thank you very much for taking the time to answer.

    In the sample workbook I sent, it worked perfectly for both formulas.
    Oddly though, when using it in the larger workbook I have - the 2nd formula works but the first formula #VALUE! 's out and I can't figure out why.
    I've seen the solution you used before and totally forgot about that technique. Any chance you could see why this is happening?

    Cell E7 is using the formula you gave me, but it's not working. In cell F7, I used the (bad) formula I was using before to get the right answer.

    In Cell F14, the formula you provided is working, since there is a value for it to use in cell F7... Do you see what's happening?

    Thanks in advance again, much appreciated.
    Attached Files Attached Files

  4. #4
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Need result from Column A based on MAXIFS result from Column B

    Well, your data in Col L of the 'office' sheet has text in it which is causing the value error. Instead of 0 you have --
    Replace those with zero and use the formula
    =MAX(INDEX((Office!$E$3:$E$3918=E$4)*Office!$L$3:$L$3918,0),0)
    Notice the range starts at Row 3

    The other option is to use this array formula. This will work even with text
    =MAX(IF(Office!$E$3:$E$3918=E$4,Office!$L$3:$L$3918,0))
    Confirm with Ctrl+Shift+Enter and not just Enter

  5. #5
    Registered User
    Join Date
    01-23-2014
    Location
    United States
    MS-Off Ver
    Excel 2016 - Windows
    Posts
    20

    Re: Need result from Column A based on MAXIFS result from Column B

    Wow, never considered the non-values. Damn. Thank you very much for your quick responses and helpful explanations. I'll take some time to breakdown how you created those formulas.

    Thanks for all of your help!

+ 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. [SOLVED] Conditional formatting in one column based on the result of another
    By mra1984 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-05-2013, 09:41 AM
  2. [SOLVED] Help with counting a column based on the result of another column
    By spiders in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-26-2013, 11:50 PM
  3. Ping Host Name Column A IP address Result column B Response time Column c
    By NickMac in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-13-2012, 03:23 AM
  4. Rank based on result of another column
    By cadge in forum Excel General
    Replies: 2
    Last Post: 01-20-2012, 08:36 AM
  5. Looking for calculating result based on two column values
    By dchaturvediaf in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 01-04-2012, 02:08 PM
  6. Return result based of column name
    By MathiasH in forum Excel General
    Replies: 1
    Last Post: 10-09-2011, 02:43 AM
  7. Add hours from one column based on a result in another column
    By nickorfanella in forum Excel General
    Replies: 5
    Last Post: 08-20-2009, 05:59 PM
  8. Hiding column based on formula result.
    By Casey in forum Excel General
    Replies: 1
    Last Post: 04-13-2005, 11:36 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