+ Reply to Thread
Results 1 to 7 of 7

Finding max value from group of variables

  1. #1
    Registered User
    Join Date
    09-16-2015
    Location
    London, England
    MS-Off Ver
    2011
    Posts
    3

    Finding max value from group of variables

    Hi,

    first time post

    I have data that looks like this:

    A B C D E F

    1 2 3 4 5 6

    2 3 4 5 8 1

    3 5 5 3 4 7

    I want to define the max value on each row, ideally giving the name of the variable not just the max value. So it would look like this:

    A B C D E F G

    1 2 3 4 5 6 F

    2 3 4 5 8 1 E

    3 5 5 3 4 7 F

    Ive tried unsuccessfully to do so. Is this even possible?

    Thanks in advance

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Finding max value from group of variables

    Try

    =INDEX($A$1:$F$1,MATCH(MAX($A2:$F2),$A2:$F2,0))

    Where A1:F1 is the headers (the row containing the 'names' you want the result to be)
    A2:F2 is the row with the numbers you want to find the max value of.

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,872

    Re: Finding max value from group of variables

    Try in G2

    =INDEX($A$1:$F$1,MATCH(MAX($A2:$F2),$A2:$F2,0))


    data in A1 to F4 (row 1 Headings)

  4. #4
    Registered User
    Join Date
    09-16-2015
    Location
    London, England
    MS-Off Ver
    2011
    Posts
    3

    Re: Finding max value from group of variables

    Hi,

    thanks that worked a treat.

    just another quick question, when there are two 'winners' this formula arbitrarily selects the first value as the 'winner'. Is there any way of remedying this so that it shows as a draw?

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,941

    Re: Finding max value from group of variables

    =IF(COUNTIF($A2:$F2,MAX($A2:$F2))>1,"Draw",LOOKUP(2,1/($A2:$F2=MAX($A2:$F2)),$A$1:$F$1))
    Please Login or Register  to view this content.
    Try this and copy towards down
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  6. #6
    Registered User
    Join Date
    09-16-2015
    Location
    London, England
    MS-Off Ver
    2011
    Posts
    3

    Re: Finding max value from group of variables

    this works as well but there is an issue with dividing by 0 given that some of the responses are 0. dont mean to keep asking more questions, its just the formula is a bit above my excel capabilities to modify

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,872

    Re: Finding max value from group of variables

    I tried the response fom Nflsales and had no problem with either a line of Os or o in the data, Can you post a sample file showing the problem you are encountering.

    Click "Go advanced" then Paper Clip Icon or Manage Attachments to upload a file,

+ 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] Finding the value that is different in a group
    By ExcellentM in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-04-2014, 01:39 AM
  2. [SOLVED] finding an output from 5 variables in an array using exterior input user variables
    By Allsort in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-09-2013, 11:16 AM
  3. [SOLVED] Counting total quantity for a group of variables.
    By Ekspulsio in forum Excel General
    Replies: 3
    Last Post: 06-08-2012, 04:02 AM
  4. Excel 2007 : Finding a Max value with two variables
    By Manassasralph in forum Excel General
    Replies: 3
    Last Post: 01-16-2011, 06:01 PM
  5. calculating true false from group of variables
    By tammy25 in forum Excel General
    Replies: 5
    Last Post: 11-28-2010, 11:01 PM
  6. VBA for finding variables
    By redpanda in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-06-2010, 12:23 AM
  7. Counting data by age group, gender, and other variables
    By Biomedical in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-26-2010, 04:46 PM
  8. Finding the minimum for each group
    By caco4 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-07-2007, 10:03 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