+ Reply to Thread
Results 1 to 11 of 11

return the earliest 'Next Date' of an asset

  1. #1
    Registered User
    Join Date
    10-30-2019
    Location
    Burlingame, Ca
    MS-Off Ver
    MS Office Pro Plus 2016 & MS Office 365 ProPlus
    Posts
    23

    return the earliest 'Next Date' of an asset

    I have a worksheet (Office 365) where I need a formula to return the earliest 'Next Date' of an asset (Asset ID). In other words, if the asset id exist in a different row, then I want the earllest date next date of that particular asset. I tried the COUNTIF function (=IF(COUNTIF(B3:$B27,B3)>1,F4,""), but I don't think it's scalable as it makes reference to the next row, F4.

    In my searching for a solution, I found folks are using IF INDEX, MATCH functions but they all utilize a helper column. If at all possible, I'd like the formula not to have these as my full sheet already is populated all the way to the BB column (see sheet2). In here the Disired Date is the 'Expected LES LB PM Exp date'

    Any help is appreciated!
    Attached Files Attached Files
    Last edited by Pepe Le Mokko; 03-15-2020 at 04:05 AM. Reason: Title

  2. #2
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: IF MATCH and MIN or VLOOKUP- NEED HELP

    IF you have Office 365, you have the MINIFS function. You should be able to use something like

    =INDEX(return_values_range,MATCH(MINIFS(dates_range,dates_range,">"&current_date),dates_range,0))

  3. #3
    Registered User
    Join Date
    10-30-2019
    Location
    Burlingame, Ca
    MS-Off Ver
    MS Office Pro Plus 2016 & MS Office 365 ProPlus
    Posts
    23

    Re: IF MATCH and MIN or VLOOKUP- NEED HELP

    Hi hrlngrv,
    I may be doing this wrong...it didn't work. What am I doing wrong? And how does "&current_date" work?

    =INDEX(B3:B6,(MATCH(MINIFS(E3:E6,E3:E6,">"&3/13/2020),E3:E6,0)))

    This produced 7/3/2025 and not the desired date.
    Last edited by charliechaz; 03-13-2020 at 09:49 PM.

  4. #4
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: IF MATCH and MIN or VLOOKUP- NEED HELP

    Which cell contains the formula which doesn't work? I was vague before because it wasn't clear which cells I should be looking at in your sample workbook.

  5. #5
    Registered User
    Join Date
    10-30-2019
    Location
    Burlingame, Ca
    MS-Off Ver
    MS Office Pro Plus 2016 & MS Office 365 ProPlus
    Posts
    23

    Re: IF MATCH and MIN or VLOOKUP- NEED HELP

    No worries. Here is a pic:
    Attachment 667279

    The formula would go into F3:F7. The values in column G were the result of the formula.

    Thanks again
    Attached Images Attached Images

  6. #6
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: IF MATCH and MIN or VLOOKUP- NEED HELP

    Quote Originally Posted by charliechaz View Post
    . . .
    =INDEX(B3:B6,(MATCH(MINIFS(E3:E6,E3:E6,">"&3/13/2020),E3:E6,0)))
    . . .
    Does this go into Sheet1!F3 in your Sample Data.xlsx workbook attached above? If so, B3:B6 are in a column with the label Asset ID. MINIFS(E3:E6,E3:E6,">3/13/2020") correctly returns 4/24/2020 from cell E5. The MATCH call returns 3, and the INDEX call returns the value of cell B5, 45841. Formatted as a date, that's 3 Jul 2025.

    Do you want the asset ID from col B in col F? If not, what do you want in col F?

  7. #7
    Registered User
    Join Date
    10-30-2019
    Location
    Burlingame, Ca
    MS-Off Ver
    MS Office Pro Plus 2016 & MS Office 365 ProPlus
    Posts
    23

    Re: IF MATCH and MIN or VLOOKUP- NEED HELP

    The formula in column F (Desired Date) should look at column B (Asset ID), then, if the Asset ID is repeated in any row, then look at the 'Next Date' (column E) and get the earliest date (MIN) of the 2 rows. For example, in rows 3 and 4, the Asset ID of 43777 has 2 'Next Dates' values, 9/1/2020 and 6/6/2020, respectively. I want the formula (in column F) to search this asset ID in column B. If it finds the same value, then get the earliest date from column E. In this example, F3 and F4 should be 06/06/2020.

    The 'Desired Date', column F should be:
    F3 should be 6/06/2020
    F4 should be 6/06/2020
    F5 should be 02/18/2020
    F6 should be 02/18/2020
    Last edited by charliechaz; 03-14-2020 at 01:06 AM.

  8. #8
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: IF MATCH and MIN or VLOOKUP- NEED HELP

    I'm using your attached workbook from your original posting. That shows the following.

    excel-forum-2020-03-13-d.png

    Those dates differ from the dates you show in the screen fragment in #5. If you've updated the dates, update the sample workbook please. I charge for data entry, and I guarantee you can't afford my rate.

    ADDED: If you just want the earliest date for each asset ID,

    F3: =MINIFS(E$3:E$6,B$3:B$6,B3)

    and fill down.
    Last edited by hrlngrv; 03-14-2020 at 06:00 PM. Reason: addendum

  9. #9
    Registered User
    Join Date
    10-30-2019
    Location
    Burlingame, Ca
    MS-Off Ver
    MS Office Pro Plus 2016 & MS Office 365 ProPlus
    Posts
    23

    Re: IF MATCH and MIN or VLOOKUP- NEED HELP

    Thank you hrlngrv, that worked. FYI, I added EDATE to the mix as I needed to transform the date to the first of the following month.

    MINIFS(E$3:E$6,B$3:B$6,B3) returned 1/6/2020,
    EDATE(DATE(YEAR(MINIFS(E$3:E$6,B$3:B$6,B3)),MONTH(MINIFS(E$3:E$6,B$3:B$6,B3))+1,1),0) returned 2/1/2020.

    What do you think?

  10. #10
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: IF MATCH and MIN or VLOOKUP- NEED HELP

    Quote Originally Posted by charliechaz View Post
    . . . to the first of the following month. . . .
    EDATE(DATE(YEAR(MINIFS(E$3:E$6,B$3:B$6,B3)),MONTH(MINIFS(E$3:E$6,B$3:B$6,B3))+1,1),0) returned 2/1/2020.
    . . .
    Shorten that to

    =EOMONTH(MINIFS(E$3:E$6,B$3:B$6,B3),0)+1

  11. #11
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,453

    Re: return the earliest 'Next Date' of an asset

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however the thread title does not really convey what your request is about.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    I did it for you

+ 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: 1
    Last Post: 06-18-2015, 08:45 AM
  2. [SOLVED] Vlookup to Pivot Table, using Match function, returns error if can't find match value
    By AndrewHowarth in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-16-2015, 12:10 AM
  3. Replies: 2
    Last Post: 12-18-2014, 09:52 AM
  4. Replies: 3
    Last Post: 05-19-2014, 02:01 PM
  5. Replies: 4
    Last Post: 01-13-2014, 04:16 AM
  6. Replies: 13
    Last Post: 12-13-2012, 11:44 AM
  7. Replies: 2
    Last Post: 03-16-2012, 12:03 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