+ Reply to Thread
Results 1 to 14 of 14

Formula to find the earliest date in excel base on a given date and text

  1. #1
    Registered User
    Join Date
    10-26-2017
    Location
    Taguig, Philippines
    MS-Off Ver
    Microsoft Office Standard 2010
    Posts
    7

    Formula to find the earliest date in excel base on a given date and text

    Hello,

    I would like to ask if anyone can help me figure out the formula to easily capture the necessary information.

    This is what im trying to accomplish, in the attached file i would like to get the earliest date "payment run date (column E)" base on the contract end date (column D) considering the payment run date for US and CAN (column H and I).

    i was able to get the earliest date using =MIN(IF(I:I>D2,I:I)) , but having a hard time adding criteria to separate the payment run date for US and CAN data.

    In short, i want a formula to get the earliest payment run considering the contract end date while also considering the schedule of payment run per country.

    line #9 CAN should get 02/02/17 and not the 01/02/2017 which is for US.

    Bare with my grammar folks.


    Thank you
    Rikii
    Attached Files Attached Files

  2. #2
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Formula to find the earliest date in excel base on a given date and text

    Hi Rikii, welcome to the forum! This ARRAY FORMULA* is just a straight-forward extension of your approach:
    Please Login or Register  to view this content.
    While you can't use the AND function with arrays, you CAN multiply the conditional clauses to yield an array of 1s (TRUE) and 0s (FALSE). This is equivalent to ANDing them. NOTE: I highly recommend staying away from full-column references. They really slow down calculation.

    *Always press CTRL+SHIFT+ENTER to confirm entry after pasting or editing an ARRAY FORMULA in the Formula Bar.
    When copying the formula to other cells, make sure the copied cell is not part of the Paste Area.
    Last edited by leelnich; 10-26-2017 at 05:29 AM.
    Clicking the Add Reputation star below helpful posts is a great way to show your appreciation.
    Please mark your threads as SOLVED upon conclusion (Thread Tools above Post # 1). - Lee

  3. #3
    Registered User
    Join Date
    10-26-2017
    Location
    Taguig, Philippines
    MS-Off Ver
    Microsoft Office Standard 2010
    Posts
    7

    Re: Formula to find the earliest date in excel base on a given date and text

    Thank you leelnich, unfortunately its not working, see below. the result is 0..

    Country Task ID Client Reference Contract End Date Payment Run
    US 30827401 7530516561 01/30/17 0
    US 30478145 6917620582 11/30/17 0
    US 30651906 8250048543 09/30/17 0
    US 30827405 7530516544 11/30/17 0
    US 30729542 7987708586 11/30/17 0
    US 30710572 7498620338 11/30/17 0
    US 30729543 7987708659 11/30/17 0
    CAN 30827408 7530516192 01/30/17 0
    CAN 30817019 7858194911 11/30/17 0

  4. #4
    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,893

    Re: Formula to find the earliest date in excel base on a given date and text

    Attach your workbook.
    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.

  5. #5
    Registered User
    Join Date
    10-26-2017
    Location
    Taguig, Philippines
    MS-Off Ver
    Microsoft Office Standard 2010
    Posts
    7

    Re: Formula to find the earliest date in excel base on a given date and text

    already did. thanks

  6. #6
    Registered User
    Join Date
    10-26-2017
    Location
    Taguig, Philippines
    MS-Off Ver
    Microsoft Office Standard 2010
    Posts
    7

    Re: Formula to find the earliest date in excel base on a given date and text

    If anyone has much better formula please show me, i would really appreciate the help. thank you

  7. #7
    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,893

    Re: Formula to find the earliest date in excel base on a given date and text

    Please attach the version of the workbook showing that the suggestion in post #2 does not work for you.

    Also, please remember that those who help here do so voluntarily and of their own goodwill. They live in many different time zones and many will be out at work right now if they are not asleep on the other side of the globe. This is not a paid 'service': members will help when they are ready and able to do so, and not 'on demand'. Please do not try to put pressure of time on anyone here: if you get the help you need today, that's fine, but you really should not count on it. Thanks for your understanding and patience.

    From the forum rules (link in the main menu above):
    • If your question has not been answered within a day, consider adding another post with any additional information you believe is relevant. If you think your post is good as is, just reply to your own thread with the words "Bump no response", which will bring it to the top of the forum.

  8. #8
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Formula to find the earliest date in excel base on a given date and text

    It's an array formula, just as your original was. You must press CTRL+SHIFT+ENTER after pasting or editing in the formula bar to confirm. You should see curly brackets {} embrace the text, signifying successful array entry. Then copy down; you'll get the correct output.
    Last edited by leelnich; 10-26-2017 at 05:30 AM.

  9. #9
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: Formula to find the earliest date in excel base on a given date and text

    Lee has provided correct formula you would need to press control+shift+enter as it is an array formula.

    or can try non array formula

    E2
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  10. #10
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Formula to find the earliest date in excel base on a given date and text

    Hi Ankur, haven't heard from you in a while. Here's another non-array alternative:
    Please Login or Register  to view this content.
    The AGGREGATE() function can mimic other functions - SMALL() in this case - and ignore errors within the input array! So I divided each possible value by each test clause, returning 1 (TRUE) or 0 (FALSE) as divisors. VALUE/1 = VALUE , while VALUE/0 causes a #DIV/0! error, which is duly ignored by the function. Once all rows are processed, it returns the smallest "surviving" number.
    Last edited by leelnich; 10-26-2017 at 05:57 AM.

  11. #11
    Registered User
    Join Date
    10-26-2017
    Location
    Taguig, Philippines
    MS-Off Ver
    Microsoft Office Standard 2010
    Posts
    7

    Re: Formula to find the earliest date in excel base on a given date and text

    hi guys, i would like to apologies if i sounded demanding i didn't mean to.

    all these formulas are actually working, cant believe i wasted too much time figuring this by myself.

    You guys are awesome. you just save my life (and career) ...lol

    Special thanks to leelnich

  12. #12
    Registered User
    Join Date
    10-26-2017
    Location
    Taguig, Philippines
    MS-Off Ver
    Microsoft Office Standard 2010
    Posts
    7

    Re: Formula to find the earliest date in excel base on a given date and text

    Hi guys, its me again, sorry to bother you all.

    i have one last question though, is there a similar formula that i can use that is much faster to calculate?
    i mean in just a week or two, my excel will end up with 2000 or more lines.

    The formula is working, though when i tried to plot it it freezing my worksheet.


    Thank you

  13. #13
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: Formula to find the earliest date in excel base on a given date and text

    Try with dynamic range

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  14. #14
    Registered User
    Join Date
    10-26-2017
    Location
    Taguig, Philippines
    MS-Off Ver
    Microsoft Office Standard 2010
    Posts
    7

    Re: Formula to find the earliest date in excel base on a given date and text

    All of these formulas are working. I'll test which one is the faster to calculate.

    Thanks

+ 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. How to find Earliest Date
    By gaby58 in forum Excel General
    Replies: 11
    Last Post: 03-02-2017, 04:06 PM
  2. [SOLVED] Formula to subtract from 2 date cells and use the earliest date
    By DRail100 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-12-2015, 04:13 PM
  3. Find earliest date given a >= threshold
    By cblindsey in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-02-2014, 12:47 PM
  4. Excel find earliest date within 12 month period.
    By rkemplin in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-18-2012, 09:13 PM
  5. [SOLVED] Formula that displays the oldest date and earliest date
    By mrcois in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-20-2012, 12:22 AM
  6. Replies: 3
    Last Post: 12-01-2011, 05:27 PM
  7. Find out the earliest date
    By samirz10 in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 02-27-2009, 04:24 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