+ Reply to Thread
Results 1 to 8 of 8

How to alert when input duplicate specific name on the same date?

  1. #1
    Forum Contributor
    Join Date
    03-04-2015
    Location
    Jakarta
    MS-Off Ver
    15
    Posts
    154

    How to alert when input duplicate specific name on the same date?

    I want to make a schedule, three persons for a day. But one person just have one day on the same date.
    How to make an alert or validating if there is a duplicate specific name on the same date. Every name on the cell is separated by semicolon (.
    Look at the picture below:

    duplicate.jpg
    Last edited by putritersenyum; 03-15-2016 at 07:33 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    11-15-2010
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2003
    Posts
    538

    Re: How to alert when input duplicate specific name on the same date?

    Personally I would do this with VBA code which is more flexible and would be more compact to maintain. However if you want to do it on the sheet, here is an answer using helper columns. I didn't combine any of them, yet, which I just about always find to be the best approach when building long formulas from scratch. You can fold columns C:D into E:G, and then fold those into H:Q; you'll have less cells, though it will be visually more non-intuitive. You can also hide every column other than A:B and the last one, or you can move the others out of view or onto another sheet, even a hidden one.
    C2=SEARCH(";",$B2,1)
    D2=SEARCH(";",$B2,C2+1)
    E2=$A2 & "|" & TRIM(LEFT($B2,C2-1))
    F2=$A2 & "|" & TRIM(MID($B2,C2+1,D2-C2-1))
    G2=$A2 & "|" & TRIM(MID($B2,D2+1,999))
    H2=COUNTIF(E:E,E2)
    I2=COUNTIF(F:F,F2)
    J2=COUNTIF(G:G,G2)
    K2=COUNTIF(E:E,F2)
    L2=COUNTIF(F:F,G2)
    M2=COUNTIF(G:G,E2)
    N2=COUNTIF(E:E,G2)
    O2=COUNTIF(F:F,E2)
    P2=COUNTIF(G:G,F2)
    Q2=COUNTIF(H2:P2,">1")
    R2=IF(Q2>0,"DUPLICATE FOUND","ok")

    Then copy C2:R2 all the way down.

    This relies on there always being exactly 3 names, always separated by semicolons ";". If any of that is untrue this would need modification.

    Note the above is based on the data starting in row 2, not row 1; adjust appropriately.
    Last edited by Oppressed1; 03-16-2016 at 12:31 PM. Reason: added last paragraph
    Chip, if you can read this, you're STILL making the world a better place with your immeasurably valuable gifts. Every week, you continue to help me (and untold numbers of others) tremendously. Practically no alternative outlets can match your effectiveness, even over the vast number of topics you demystify and empower usage of. You were, and still are, amazing.

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,148

    Re: How to alert when input duplicate specific name on the same date?

    Simple UDF

    Please Login or Register  to view this content.
    With data in column A row 2 down

    in B2 =Check_Duplicates(A2)

    Copy down
    Last edited by JohnTopley; 03-16-2016 at 02:23 PM.

  4. #4
    Valued Forum Contributor
    Join Date
    11-15-2010
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2003
    Posts
    538

    Re: How to alert when input duplicate specific name on the same date?

    John the code shown as of edit time 1:23 PM (here) does not do what he asked for. For one thing it only checks the same row and it does nothing with date.

    At any rate, I did not use VBA though I said that I believed it was preferable because he put this question in the "formula and functions" section, though there would be no harm in you posting a good code solution. If you want to do that, I think you'll want to read the entire input into an array and work from "stored memory" rather than cells. The other route is with .Find which I gather is more efficient than most VBA operations.

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,148

    Re: How to alert when input duplicate specific name on the same date?

    VBA updated:

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by JohnTopley; 03-16-2016 at 04:16 PM.

  6. #6
    Forum Contributor
    Join Date
    03-04-2015
    Location
    Jakarta
    MS-Off Ver
    15
    Posts
    154

    Re: How to alert when input duplicate specific name on the same date?

    Thank you Oppressed1 and JohnTopley. I have try your methods. I have tried the Duplicate_Names.xlsm and then I try to Sheet2, but it just works for the last row (Duplicate name(s) Ed, Jimmy).

  7. #7
    Valued Forum Contributor
    Join Date
    11-15-2010
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2003
    Posts
    538

    Re: How to alert when input duplicate specific name on the same date?

    I didn't check the code or attachment but they appear to require that the input be sorted so check that. The formulas in my post tediously and exhaustively check every combination if that helps (if the data is not guaranteed to be sorted). (Of course that can be compactly done in code, too, which would be my choice.)

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,148

    Re: How to alert when input duplicate specific name on the same date?

    Worked OK for me. Post file which does not work.

    It assumes file is SORTED by date as pointed out earlier by Oppressed1
    Last edited by JohnTopley; 03-17-2016 at 10:25 AM.

+ 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. changed
    By putritersenyum in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-15-2016, 11:09 PM
  2. [SOLVED] How to prevent input duplicate name of the same date?
    By putritersenyum in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-15-2016, 07:03 PM
  3. [SOLVED] Count non-duplicate BOL #'s for a specific date
    By staljunk in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-05-2015, 02:49 PM
  4. [SOLVED] counting Duplicate values as one for a specific date
    By Shellybelly in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 06-06-2014, 11:06 AM
  5. Replies: 2
    Last Post: 03-09-2013, 10:14 PM
  6. macro to input data on a specific date
    By Ray in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-08-2006, 10:50 PM
  7. [SOLVED] How do I make a cell date specific to input a value on a specific.
    By ebuzz13 in forum Excel General
    Replies: 1
    Last Post: 01-18-2005, 02:06 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