+ Reply to Thread
Results 1 to 5 of 5

max order date that has 2 same dates and get the lowest value

  1. #1
    Registered User
    Join Date
    08-03-2019
    Location
    Bangkok Thailand
    MS-Off Ver
    2013
    Posts
    2

    Post max order date that has 2 same dates and get the lowest value

    scenario: Get the max order date, if it has same date. Get the lowest value from another cell.
    example:
    column A column B column C column D
    item1 red Jan 11, 2010 900
    item2 white Jan 12, 2010 200
    item3 green Jan 14, 2010 300
    item4 blue Jan 13, 2010 600
    item3 green Jan 14, 2010 50
    item3 green Jan 14, 2010 250

    output on should be: 50
    since the last date is Jan 14, 2010 but the value should be 50 since the lowest value for same date.
    =MAX(IF(A1=Sheet1!A1:A200,Sheet1!D1:D200,""))

    It works for some cells but some are not. There are items that the output is correct but sometimes it would get the largest value.

    Any ideas on how to modify the formula?

    Thank you in advance.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    81,238

    Re: max order date that has 2 same dates and get the lowest value

    Welcome to the forum.

    You need to build a MIN statement into your formula.

    Will you please attach a small sample Excel workbook? We are not able to work with or manipulate a picture of one and nobody wants to have to recreate your data from scratch.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired results are also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

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

    Re: max order date that has 2 same dates and get the lowest value

    One way, using this array formula:

    =MIN(IF($C$2:$C$100=MAX($C$2:$C$100),$D$2:$D$100))

    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...

    Next time please attach a sample sheet, as the forum messes up formatting. It's hard to see what's meant to be in which cell. Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    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 2403
    Posts
    44,100

    Re: max order date that has 2 same dates and get the lowest value

    Non-array version (just use enter):

    =AGGREGATE(15,6,$D$2:$D$7/($C$2:$C$7=AGGREGATE(14,6,$C$2:$C$7,1)),1)

  5. #5
    Registered User
    Join Date
    08-03-2019
    Location
    Bangkok Thailand
    MS-Off Ver
    2013
    Posts
    2

    Re: max order date that has 2 same dates and get the lowest value

    Thank you AliGW and Glenn Kennedy for the response and help. It took me awhile to respond since I just came back to work.

    Was about to post the sample excel sheet. Will try first the solution and was provided and will get back.

+ 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] Not returning a date in a lookup when dates are out of order
    By nappy1001 in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 04-10-2014, 11:23 AM
  2. Replies: 2
    Last Post: 03-16-2013, 05:19 AM
  3. Finding lowest date in a row of 4 dates
    By Lynn McCurdy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-11-2011, 12:27 PM
  4. Replies: 4
    Last Post: 11-06-2009, 01:10 PM
  5. Pivot Table - Dates not displayed in date Order - Why?
    By Badvgood in forum Excel General
    Replies: 2
    Last Post: 03-10-2007, 02:53 AM
  6. How do you sort a list of dates into date order
    By Tegwen in forum Excel General
    Replies: 2
    Last Post: 08-31-2005, 10:05 AM
  7. Replies: 1
    Last Post: 07-28-2005, 03:05 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