+ Reply to Thread
Results 1 to 6 of 6

Determing if max value in a range of cells equals any of the other cells in that range

  1. #1
    Registered User
    Join Date
    02-25-2019
    Location
    Florida
    MS-Off Ver
    2010
    Posts
    3

    Determing if max value in a range of cells equals any of the other cells in that range

    I am trying to figure out how to determine if there are at least two cells in a range of cells that both have the max value in that range. For example, if A1=13, B1=18, C1=21, and D1=13, the cell with the maximum value is C1=21 and it doesn't match any other value even through A1 and D1 both have a value of 12. Thus, the function should return a "False" response. However, if the example was A1=21, B1=18, C1=21, and D1=13, then the max value is 21 and there are two cells with this value, so the function needs to return a "True".

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: Determing if max value in a range of cells equals any of the other cells in that range

    =COUNTIF({range to check},MAX({range to check}))
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    02-25-2019
    Location
    Florida
    MS-Off Ver
    2010
    Posts
    3

    Re: Determing if max value in a range of cells equals any of the other cells in that range

    Hi Ben,
    I tried your suggestion and the function returned a 1 for every case except one in my data set even when there weren't any cells with the same value or when two cells had the same value but they weren't the max value. It did correctly identify the condition when three out of the four cells all had the same max value (returned a value of 3). For the count equation to work correctly for the example A1=13, B1=18, C1=21, and D1=13, it needs to return 0, but for A1=21, B1=18, C1=21, and D1=13, it should return 2. Thanks for getting me one step closer as I think the solution will involve the MAX function somehow.
    Brian

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,563

    Re: Determing if max value in a range of cells equals any of the other cells in that range

    Try the following modification of Ben's formula: =IF(COUNTIF(A1:D1,MAX(A1:D1))=1,0,COUNTIF(A1:D1,MAX(A1:D1)))
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  5. #5
    Registered User
    Join Date
    02-25-2019
    Location
    Florida
    MS-Off Ver
    2010
    Posts
    3

    Re: Determing if max value in a range of cells equals any of the other cells in that range

    Thanks JeteMc, your formula worked perfectly!

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,563

    Re: Determing if max value in a range of cells equals any of the other cells in that range

    Thank You for the feedback. Please take a moment to mark the thread as 'Solved' using the thread tools menu above your first post. I hope that you have a blessed day.

+ 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. Replies: 6
    Last Post: 09-16-2016, 03:52 PM
  2. [SOLVED] If Value in a range of cells equals X, then echo value (name) in another range of cell
    By tonytorero in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-03-2013, 06:23 PM
  3. [SOLVED] If cell dropdown equals no, then make a range of cells uneditable?
    By jager in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-10-2013, 12:47 AM
  4. [SOLVED] Return value if any of cells in range equals a specific value (cell)
    By G.Bregvadze in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-30-2013, 07:59 AM
  5. Format cells if PC time equals defined range
    By IvarZhukovsky in forum Excel General
    Replies: 5
    Last Post: 12-23-2011, 05:21 AM
  6. If Range of Cells Equals Value
    By dreicer_Jarr in forum Excel General
    Replies: 1
    Last Post: 04-18-2010, 03:01 PM
  7. Replies: 3
    Last Post: 05-29-2009, 05:42 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