+ Reply to Thread
Results 1 to 6 of 6

Returning Column Headers for Max Values with Ties

  1. #1
    Registered User
    Join Date
    01-11-2017
    Location
    Cincinnati, Ohio
    MS-Off Ver
    2013
    Posts
    2

    Returning Column Headers for Max Values with Ties

    Hello, first thread here. If more information is needed, please let me know.

    I would like to pull the highest month of sales in a particular row, which I believe I can manage. The kicker is that some months match others. In this case, I would like to pull all the months that match the highest value (in adjacent cells). I was using an INDEX function with a LARGE function within it, but when there are ties, it pulls the same month's column header twice.

    Can someone please take a look and let me know if there is a "simple" way to do this?

    Thank you!
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,176

    Re: Returning Column Headers for Max Values with Ties

    Try this ...

    =INDEX($B$1:$M$1,MATCH(LARGE($B2:$M2-0.0000001*COLUMN($B2:$M2),COLUMNS($O$1:O$1)),
    $B2:$M2-0.0000001*COLUMN($B2:$M2),0))

    Enter with Ctrl+Shift+Enter.

  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,791

    Re: Returning Column Headers for Max Values with Ties

    Try

    =IFERROR(INDEX($B$1:$M$1,SMALL(IF($B2:$M2=MAX($B2:$M2),COLUMN($B$1:$M$1)-COLUMN($B$1)+1,""),COLUMNS($B1:B1))),"")

    Enter with Ctrl+Shift+Enter

    copy across and down

  4. #4
    Registered User
    Join Date
    01-11-2017
    Location
    Cincinnati, Ohio
    MS-Off Ver
    2013
    Posts
    2

    Re: Returning Column Headers for Max Values with Ties

    Both of these worked, thank you both for the help!

  5. #5
    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,791

    Re: Returning Column Headers for Max Values with Ties

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Returning Column Headers for Max Values with Ties

    Hi,

    If you're prepared to hold the data in a slightly different way then a Pivoot Table will avoid the need for formulae and arguably be far more flexible and useful.

    See attached where I've also added a couple of Slicers which allow you to further filter the PT
    Attached Files Attached Files
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

+ 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. Retrieve Column Headers Dynamically - Based on column Values
    By akshaysudhir in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-12-2016, 05:42 AM
  2. Eliminate ties in column C by using the total sum of values in column A + B
    By Securitysports in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 11-04-2013, 11:44 AM
  3. Returning non-blank cell column/row headers to new array
    By jjkellog in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-19-2013, 10:45 AM
  4. [SOLVED] Cell Values Become Column Headers
    By nalani24 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-05-2013, 03:35 PM
  5. Replies: 2
    Last Post: 05-09-2012, 01:30 PM
  6. Returning selected column headers
    By risys82 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-28-2008, 12:46 PM
  7. Excel - returning column headers in a seperate column
    By ExcelConfused in forum Excel General
    Replies: 1
    Last Post: 03-28-2006, 09:55 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