+ Reply to Thread
Results 1 to 9 of 9

Get the highest value from the range (no VBA)

  1. #1
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,946

    Get the highest value from the range (no VBA)

    Hello Guys,

    I have 2 columns, one with names and second with attached to them dates.

    I want to have the highest value for each name (in workbook there is an example).

    Please find in attachment example workbook.

    Please help,
    Jacek Antek
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    07-12-2015
    Location
    Dubai,UAE
    MS-Off Ver
    Office 365
    Posts
    447

    Re: Get the highest value from the range (no VBA)

    =MAX(IF('Source Data'!A2:A14='Output data'!A2,'Source Data'!B2:B14))

    Entered as array formula

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Get the highest value from the range (no VBA)

    =MAX(IF('Source Data'!$A$2:$A$14=A2,'Source Data'!$B$2:$B$14))
    array enter this formul and copy down.

    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    Attached Files Attached Files
    Last edited by Glenn Kennedy; 05-04-2017 at 03:06 AM.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Get the highest value from the range (no VBA)

    chullan 88's formula will work with this dataset, by good luck. You need the lock the ranges as shown, using the $ signs....

  5. #5
    Forum Contributor
    Join Date
    07-12-2015
    Location
    Dubai,UAE
    MS-Off Ver
    Office 365
    Posts
    447

    Re: Get the highest value from the range (no VBA)

    Thanks Glenn for the correction..

    A non-array solution adapted from one of tigeravatar's old posts...

    =MAX(INDEX(('Source Data'!$A$2:$A$14='Output data'!A2)*'Source Data'!$B$2:$B$14,))

  6. #6
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,279

    Re: Get the highest value from the range (no VBA)

    Try also below.
    =IF(COUNTIF(Source_Data!$A$2:$A$14,Output_data!$A2),MAX(IF(Source_Data!$A$2:$A$14=Output_data!$A2,Source_Data!$B$2:$B$14)),"")
    Ensure Array formula [SHIFT+CTRL+ENTER]

    Copy paste down.


    atul


    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved".

  7. #7
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,946

    Re: Get the highest value from the range (no VBA)

    Hi Guys,

    thank you very much for your help!

    The best solution for me is from Glenn Kennedy.

    Question is how the array formula is working here.

    If i remove arrayformula from the first name it works.
    But for second name is not working.

    Best Wishes,
    Jacek Antek

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Get the highest value from the range (no VBA)

    If you don't set the array, Excel evaluates only the first line of the "IF" range (output A2). So Pawel = Pawel and it returns the correct MAX. On the second line (output a3) Pawel not equal to Lukasz, so it falls over and returns a value of zero, which in Excel date terms equals the 0th january 1900. Don't ask about the date, that's another story...

  9. #9
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,946

    Re: Get the highest value from the range (no VBA)

    Thank you Glenn for youe help and support, you are the best!

    Jacek

+ 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. Change code to take a random value in a range, instead of the highest value in the range
    By Martin Lorentzen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-13-2016, 06:21 AM
  4. Finding 2nd or 3rd highest value in range
    By jmhultin in forum Excel General
    Replies: 4
    Last Post: 03-11-2013, 06:38 AM
  5. Replies: 4
    Last Post: 10-08-2010, 04:18 AM
  6. I want vlookup to find a range, and return highest value in that range
    By crazie in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-05-2008, 01:20 PM
  7. How can i get the 3 highest in a range
    By Roy in forum Excel General
    Replies: 5
    Last Post: 06-07-2006, 08:35 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