+ Reply to Thread
Results 1 to 9 of 9

Find the row of the maximum value based on one condition

  1. #1
    Forum Contributor
    Join Date
    04-21-2009
    Location
    England
    MS-Off Ver
    Excel 2016
    Posts
    710

    Find the row of the maximum value based on one condition

    Hi everyone, I posted a similar conundrum a few days back which was kindly solved, I can't work out how to replicate the formula for what I need here so am looking for some help.


    I have an attached an example file. What I am trying to do is find the row number with the highest value in column C where the value in column A is 1

    The formula I have used is

    Please Login or Register  to view this content.
    but it is giving row number 95 - this can be seen in cell I3 where the formula is stored. It should be returning row 143, which I have manually typed into cell I4.

    Can someone help with this formula?
    Attached Files Attached Files

  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
    90,762

    Re: Find the row of the maximum value based on one condition

    This did NOT need a new thread, however a simple tweak of the formula I gave you, which you told me worked but you now appear to have abandoned, will do the job:

    =MATCH(1,(C:C=MAXIFS(C:C,A:A,1))*(A:A=1),0)

    For the reason I explained in your other thread, this will find the first instance of the MAXIFS value, NOT the one you wnat:

    =MATCH((MAXIFS(C:C,A:A,1)),C:C,0)

    You have to define the criterion in the MAXIFS and then again in the MATCH section.
    Attached Files Attached Files
    Last edited by AliGW; 08-11-2022 at 03:42 AM. Reason: Extra detail added.
    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 Contributor
    Join Date
    04-21-2009
    Location
    England
    MS-Off Ver
    Excel 2016
    Posts
    710

    Re: Find the row of the maximum value based on one condition

    I do not know why you need to be so rude in your reply? I marked the other thread as solved, hence why I did not want to re-open it.

    Also, I have not abandoned your previous formula, this is a separate file to that one, and as I said - I was not able to modify your previous formula (for which I am grateful and still using) into the one I needed here.

    Anyway, thank you for this proposal, I hadn't been able to figure it out for myself hence why I asked for some help

  4. #4
    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
    90,762

    Re: Find the row of the maximum value based on one condition

    Sorry - I had no intention of being rude. Indeed, there was nothing rude about my observations.

    As this was a simple follow-on question, it could have been asked in the original thread (solved tags can be removed and then reapplied as necessary).

    The formula you said you had tried here did not deal with the issue of defining the criterion twice - my point was that you had not used it, therefore the formula you were trying was never going to work. If you still don't understand why the criterion has to be defined twice, then please ask me to explain. If you don't, you'll keep making the same mistake.
    Last edited by AliGW; 08-11-2022 at 03:58 AM.

  5. #5
    Forum Expert
    Join Date
    12-09-2014
    Location
    Trakai, Lithuania
    MS-Off Ver
    2016
    Posts
    1,417

    Re: Find the row of the maximum value based on one condition

    Formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    China Shanghai
    MS-Off Ver
    365 V2503 and WPS V2024(12.1.0.18543)
    Posts
    3,920

    Re: Find the row of the maximum value based on one condition

    Cell I3 array formula , Drag down

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

  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
    90,762

    Re: Find the row of the maximum value based on one condition

    Why drag down? This is a one-cell requirment.

  8. #8
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    China Shanghai
    MS-Off Ver
    365 V2503 and WPS V2024(12.1.0.18543)
    Posts
    3,920

    Re: Find the row of the maximum value based on one condition

    2016 OFFICE need cooperates with VBA custom user define function with one-cell requirment

    Go home first, come back to the forum later

    Cell I3 formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Please Login or Register  to view this content.
    Last edited by wk9128; 08-11-2022 at 09:40 AM.

  9. #9
    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
    90,762

    Re: Find the row of the maximum value based on one condition

    No idea what you mean, sorry - please explain more clearly what you are trying to say.

+ 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] Find the row of the minimum value based on one condition
    By cmb80 in forum Excel General
    Replies: 8
    Last Post: 08-09-2022, 06:20 AM
  2. [SOLVED] Find maximum based on right 4 digits
    By Barieq in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 12-05-2021, 04:49 AM
  3. [SOLVED] Find specified value's possible combination in a row based on condition
    By haxor in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-24-2020, 03:30 AM
  4. [SOLVED] Find text based on condition
    By ganeshkumar in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-24-2016, 12:00 PM
  5. [SOLVED] Maximum and Minimum value based on certain condition
    By MAHMUZ in forum Excel General
    Replies: 3
    Last Post: 10-31-2015, 09:51 AM
  6. [SOLVED] Find Highest Value Based on Condition
    By FallingDown in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-06-2015, 11:05 AM
  7. Maximum & Minimum Dates based on Condition
    By figs in forum Excel General
    Replies: 3
    Last Post: 08-20-2008, 09:43 PM

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