+ Reply to Thread
Results 1 to 5 of 5

Get highest value based on two columns

  1. #1
    Registered User
    Join Date
    11-03-2020
    Location
    Colombo, Sri Lanka
    MS-Off Ver
    2019
    Posts
    18

    Post Get highest value based on two columns

    Hello,

    I have a large Table of various data. Column B and C are text strings, and Column D is a number.

    How do I get the maximum value of Column D, if Column B ends with a particular phrase, and Column C is not a particular phrase.

    Please see attachment for an overview.

    Thank you.
    Attached Files Attached Files

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,496

    Re: Get highest value based on two columns

    this appears to work for what you want... =MAXIFS($E$2:$E$40,$B$2:$B$40,"2020 Jul",$C$2:$C$40,"<>"&"total")
    I don't like using table names because it makes it more difficult to debug (for me anyway) but this is it with the table names...
    =MAXIFS(Table1[Amount2],Table1[Month],"2020 Jul",Table1[Agent],"<>"&"total")
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: Get highest value based on two columns

    In I4

    =AGGREGATE(14,6,Table1[Amount2]/((RIGHT(Table1[Month],LEN($H$4))=$H$4)*(Table1[Agent]<>"TOTAL")),1)
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  4. #4
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Get highest value based on two columns

    Please try

    =MAX(INDEX((RIGHT(Table1[Month],3)=H4)*(Table1[Agent]<>"Total")*Table1[Amount2],))
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    11-03-2020
    Location
    Colombo, Sri Lanka
    MS-Off Ver
    2019
    Posts
    18

    Re: Get highest value based on two columns

    Quote Originally Posted by kvsrinivasamurthy View Post
    In I4

    =AGGREGATE(14,6,Table1[Amount2]/((RIGHT(Table1[Month],LEN($H$4))=$H$4)*(Table1[Agent]<>"TOTAL")),1)
    Thank you so much. This worked like magic.

    Sam Capricci and Bo_Ry, thank you guys too for taking the time to reply. I did not try Sam's method, as I don't have Office 2019, and I didnt try Bo's because I was more familiar with AGGREGATE and have used it in other parts of my sheet.
    Last edited by Rehman5000; 11-07-2020 at 01:20 AM.

+ 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: 3
    Last Post: 06-09-2016, 12:51 PM
  2. [SOLVED] Max formula to return total of highest, second highest and third highest value
    By JonWilf in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-06-2016, 08:20 AM
  3. [SOLVED] IF statement to return string based on highest value in range of columns
    By SeskaLien in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-15-2015, 10:10 PM
  4. 2 columns of data matching highest with highest
    By ronaldchristie in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-03-2012, 07:57 AM
  5. Replies: 3
    Last Post: 06-27-2012, 10:12 PM
  6. Summing Highest Values based on two columns
    By seashell in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-09-2012, 07:53 AM
  7. VBA code to find highest and 2nd highest number based in criteria
    By Michael007 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-25-2011, 08:38 AM

Tags for this Thread

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