+ Reply to Thread
Results 1 to 8 of 8

Find date end for unique value.

  1. #1
    Registered User
    Join Date
    06-26-2015
    Location
    Poland
    MS-Off Ver
    365
    Posts
    60

    Find date end for unique value.

    Hello,
    I'm trying to fill in column "Date_end" in this table:
    example.png

    Every Name will have same amount of rows (depends on month length), so I think that there is no need to check if Names match, Values and Date_start should be enough. Do you think that it's possible to do with formulas only or VBA is required? I'm also attaching file if someone would like to work with it. Thank you for any help.
    Attached Files Attached Files

  2. #2
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,222

    Re: Find date end for unique value.

    Please try at D2
    =IF(OR(B1=B2,B2=""),"",INDEX(C1:C20,MATCH("",INDEX(B2:B21&"",),)))

    Above will miss if Last name has same value with the next name.

    try this this

    =IF((A2<>A3)*(A3<>""),C2,IF(OR((B1=B2)*(A2=A1),B2=""),"",INDEX(C1:C20,MATCH("",INDEX(B2:B21&"",),))))
    Attached Files Attached Files
    Last edited by Bo_Ry; 05-20-2020 at 08:15 AM. Reason: correction Thanks to XLent

  3. #3
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,706

    Re: Find date end for unique value.

    edit: @Bo_Ry - I don't think the above will always generate the expected results

    I believe the below would mirror your expected results

    C3:
    =IF(OR(B2="";AND(A2=A1;B2=B1));"";IF(OR(A3<>A2;B3="");C2;LOOKUP(2;1/(A3:A$29=A2)/(B3:B$29=B2)/(B2:B$28=B2);C3:C$29)))
    copied down

    modify delimiter from ; to , pending your locale requirement [ presumed to be semi-colon ]
    Last edited by XLent; 05-20-2020 at 07:41 AM.

  4. #4
    Registered User
    Join Date
    06-26-2015
    Location
    Poland
    MS-Off Ver
    365
    Posts
    60

    Re: Find date end for unique value.

    Thank you both for help! I have a question to @Xlent:
    According to screen, I should copy formula into D2 instead of C3, right? I did that and It's almost perfect, but, my fault sorry, I didn't show in example that Values can repeat in same Name range. That resulted in errors:
    example2.png
    Any way to fix this?

  5. #5
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,706

    Re: Find date end for unique value.

    Quote Originally Posted by Pojzon View Post
    ...I have a question to @Xlent... I should copy formula into D2 instead of C3, right?
    Yes, sorry about that.

    ...It's almost perfect, but, my fault sorry, I didn't show in example that Values can repeat in same Name range.... Any way to fix this?
    Yes, minor change - highlighted in red below

    =IF(OR(B2="";AND(A2=A1;B2=B1));"";IF(OR(A3<>A2;B3<>B2);C2;LOOKUP(2;1/(A3:A$29=A2)/(B3:B$29=B2)/(B2:B$28=B2);C3:C$29)))

  6. #6
    Registered User
    Join Date
    06-26-2015
    Location
    Poland
    MS-Off Ver
    365
    Posts
    60

    Re: Find date end for unique value.

    Thank you, it fixed one problem, but I was hoping that it would work in that way:
    example3.png
    That it would see blank cells between Values, even tho these are both Value1. Right now it shows 2020-05-08 in both cases. Is that possible?

  7. #7
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,706

    Re: Find date end for unique value.

    perhaps:

    D2:
    =IF(OR(B2="";AND(A2=A1;B2=B1));"";IF(OR(A3<>A2;B3<>B2);C2;INDEX(C3:C$29;MATCH(1;INDEX(SIGN((A3:A$29<>A2)+(B3:B$29<>B2));0);0)-1)))
    copied down

    if that doesn't work - please post a further sample file with more scenarios.

  8. #8
    Registered User
    Join Date
    06-26-2015
    Location
    Poland
    MS-Off Ver
    365
    Posts
    60

    Re: Find date end for unique value.

    Amazing, seems to be working flawlessly. Thank you very much for help and sorry for being pain in the ***.

+ 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: 3
    Last Post: 06-28-2019, 08:46 AM
  2. Replies: 3
    Last Post: 10-29-2018, 04:12 PM
  3. Find Most Recent Date corresponding to Unique ID from Multiple Workbooks
    By NATANI in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-02-2018, 06:03 AM
  4. [SOLVED] Find Maximum date for Unique Values
    By MAHMUZ in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-01-2018, 12:13 PM
  5. [SOLVED] Unique Key find MAX Date w/out Going Over Another Date
    By mphillips in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-08-2016, 10:28 PM
  6. find date interval for unique id excel
    By quaye28 in forum Excel General
    Replies: 0
    Last Post: 10-13-2011, 10:07 AM
  7. [SOLVED] code not unique find latest date
    By Barbara Wiseman in forum Excel General
    Replies: 3
    Last Post: 12-11-2005, 04:55 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