+ Reply to Thread
Results 1 to 9 of 9

Find earliest date before today based on criteria

  1. #1
    Registered User
    Join Date
    02-28-2018
    Location
    Aalborg, Denmark
    MS-Off Ver
    2007
    Posts
    7

    Find earliest date before today based on criteria

    I have a Excel file (giftcard) i need to return "earliest valid Giftcard nr." in column M.
    Column A= "Giftcard no"
    Column B= "Customer no"
    Column D= "Giftcard valid to date"

    A customer can have more then one (ex. customer no 0000208) "Giftcard".
    The "Giftcard" is valid if "Valid to" is today or after

    "Earliest valid giftcard no" need to be shown on all rows. If a "Giftcard" is before today or there is a earlier valid "Giftcard" it need to be shown in column M. So all giftcard with same "Customer no" has same "Ealiest valid giftcard no"
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Find earliest date before today based on criteria

    in M2
    =MIN(IF(C$2:C$6=C2,D$2:D$6))
    Array formula, use Ctrl-Shift-Enter

    and copy down the column

    There may be a non array method using LOOKUP but I cant get it to work at present
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    02-28-2018
    Location
    Aalborg, Denmark
    MS-Off Ver
    2007
    Posts
    7

    Re: Find earliest date before today based on criteria

    Thanks. in M2 it returns "earliest valid giftcard date". I need it to return the giftcard no.

    Array formula take a lot of resources when i have 1000+ row so it could be nice if there was a better way...

  4. #4
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Find earliest date before today based on criteria

    Just change D$2:D$6 to A$2:A$6

  5. #5
    Registered User
    Join Date
    02-28-2018
    Location
    Aalborg, Denmark
    MS-Off Ver
    2007
    Posts
    7

    Re: Find earliest date before today based on criteria

    It does not considerate if giftcard have expired (Date expire, before today)

  6. #6
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Find earliest date before today based on criteria

    Try

    =MIN(IF((C$2:C$6=C2)*(D$2:D$6>=TODAY()),D$2:D$6))
    Array formula, use Ctrl-Shift-Enter

    Still can't get the LOOKUP method to work, it may not be possible via LOOKUP.

  7. #7
    Registered User
    Join Date
    02-28-2018
    Location
    Aalborg, Denmark
    MS-Off Ver
    2007
    Posts
    7

    Re: Find earliest date before today based on criteria

    Thanks! it works

    Hope to find a way that is not that demanding

  8. #8
    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
    80,981

    Re: Find earliest date before today based on criteria

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    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.

  9. #9
    Forum Contributor
    Join Date
    07-06-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    192

    Re: Find earliest date before today based on criteria

    you can try this non array formula if you want..

    =AGGREGATE(15,6,$D$2:$D$6/($C$2:$C$6=C2)/($D$2:$D$6>=TODAY()),1)

+ 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: 2
    Last Post: 03-20-2015, 01:55 AM
  2. [SOLVED] Find earliest date in table with multiple criteria
    By BrotherNeptune in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-10-2015, 12:03 PM
  3. [SOLVED] Count Unique Values Based on Earliest Date Criteria
    By Aquamore in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-04-2014, 09:12 PM
  4. [SOLVED] Index match multiple criteria based on earliest date
    By dchubbock in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-28-2013, 07:18 PM
  5. Find earliest date based on specific criteria in other columns
    By cat2000 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-30-2011, 11:50 AM
  6. Find earliest date based on certain criteria
    By SeanKosmann in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 01-26-2010, 11:32 AM
  7. Find Earliest Date based on conditions
    By ShredDude in forum Excel General
    Replies: 6
    Last Post: 07-14-2007, 01:56 PM

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