+ Reply to Thread
Results 1 to 10 of 10

Multiple Highest Numbers and Adjacent Cells

  1. #1
    Registered User
    Join Date
    09-16-2012
    Location
    Sydney
    MS-Off Ver
    Office 2003
    Posts
    47

    Multiple Highest Numbers and Adjacent Cells

    I've got a workbook where there are dates and amounts entered in one sheet called 'dates'. the amounts are in one column and the dates are in an adjacent column. For instance, A7 is 01/01/2015 and B7 is $100.00, A8 is 02/01/2015 and B8 is $50.00 and so on.

    On another sheet, I'm trying to display the highest amount and corresponding date. The only problem is I have more than one dates with the same highest amount. On this other sheet I have used the following:

    This is for displaying the dates and adjacent cells

    Please Login or Register  to view this content.
    This is for displaying the highest value

    Please Login or Register  to view this content.
    On the sheet, I'm trying to display the highest amount in one cell which works with the above formula. The corresponding date in another cell is also shown but only for the first instance. If there are two or more dates with same amount value, it only picks up the first date. I'm trying to include all dates which have the highest number. Just display the highest number once and in the cell underneath the corresponding date and any other dates which have this same highest value.

    For example, A1: Displays Highest Value A2: Displays Highest Value Date B2: Displays Highest Value Date (If Applicable) C2 Displays Highest Value Date (If Applicable) and so on. Like this A1: $100.00 B2: 01/01/2015 B3: 02/01/2015 B4: 03/01/2015. Please note, B3 and B4 are only shown if applicable. I know this can be done with LARGE but I just want them shown if they have the highest value.

    Any help would be appreciated.

  2. #2
    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: Multiple Highest Numbers and Adjacent Cells

    Hi,

    Please upload your workbook and manually add the results that you expect to see, clearly indicating which ranges are data and which are results.
    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.

  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 2403
    Posts
    44,201

    Re: Multiple Highest Numbers and Adjacent Cells

    Hopefully, this is what you need... If not, please post your worksheet.
    Attached Files Attached Files
    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
    Registered User
    Join Date
    09-16-2012
    Location
    Sydney
    MS-Off Ver
    Office 2003
    Posts
    47

    Re: Multiple Highest Numbers and Adjacent Cells

    Hi Richard and Glenn, Thank you for your responses. I'm sorry Glenn because I'm using Excel 2003 and I'm getting a 'Name Error' on
    some of the cells. I've created a workbook which includes three sheets. These are 'current results', 'dates' which is the source data,and 'desired results'. There is also some text to explain things. I hope this is ok. Thank you, JL
    Attached Files Attached Files

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

    Re: Multiple Highest Numbers and Adjacent Cells

    I didn't spot that you were on Excel 2003. It just needed a tweak to the error trapping bit. try this.
    Attached Files Attached Files
    Last edited by Glenn Kennedy; 01-10-2015 at 01:58 PM.

  6. #6
    Forum Contributor
    Join Date
    12-22-2012
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    205

    Re: Multiple Highest Numbers and Adjacent Cells

    Glenn,

    Very neat solution. I tried to follow your solution to better understand but got lost. I hope I'm not being too presumptuous but could you possibly explain the formula structure in more detail.

    Thks

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

    Re: Multiple Highest Numbers and Adjacent Cells

    It's returning the dates from column A that match the highest value ($100) found in column B. It looks at all the values in B and returns true or false, depending n whether the value = $100, or not. It then returns the row numbers corresponding to the dates. Six is then subtracted from the row numbers ('cos the data starts in row 7 - after the subtraction the numbers run from 1 - x, corresponding to their positon in the array). Where the first bit found TRUE, the number is kept, where the first bit found FALSE, FALSE is kept. The numbers remaining (9,14 & 24) are the ARRAY row numbers that meet the criterion (Amount = $100). Excel then returns the lowest date, corresponding to that row number, then the next lowest, etc, etc...

    Clear as mud??

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Multiple Highest Numbers and Adjacent Cells

    Try this...

    Enter this formula in D15:

    =IF(COLUMNS($D15:D15)>COUNTIF(Dates!$B7:$B30,MAX(Dates!$B7:$B30)),"",MAX(Dates!$B7:$B30))

    Enter this array formula** in D16:

    =IF(COUNT(D15),INDEX(Dates!$A:$A,SMALL(IF(Dates!$B7:$B30=$D15,ROW(Dates!$B7:$B30)),COLUMNS($D16:D16))),"")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Format as Date

    Select D15:D16 and copy across until you get blanks.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  9. #9
    Registered User
    Join Date
    09-16-2012
    Location
    Sydney
    MS-Off Ver
    Office 2003
    Posts
    47

    Re: Multiple Highest Numbers and Adjacent Cells

    Hi, Thank you so much Glenn and Tony. Both solutions worked perfectly and they were what I was needing. Thank you so much for your help with this. I hope that you have a great day. JL

  10. #10
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Multiple Highest Numbers and Adjacent Cells

    You're welcome. We appreciate the feedback!

+ 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] Get the difference between the lowest and highest numbers in a column of cells
    By jshaw82 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-13-2013, 01:40 PM
  2. [SOLVED] Associating names from multiple rows with highest numbers
    By damianberry in forum Excel General
    Replies: 8
    Last Post: 11-01-2012, 03:21 AM
  3. Replies: 8
    Last Post: 10-08-2012, 12:15 AM
  4. Replies: 3
    Last Post: 07-19-2012, 01:24 PM
  5. Replies: 2
    Last Post: 03-06-2012, 01:19 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