Find Duplicates between Start and Stop Time

Kelly Moore
Kelly Moore ✭✭✭✭✭✭
edited 04/13/20 in Formulas and Functions

Hello Smart (sheet) Friends

To minimize data entry errors in a timesheet application where data is entered by a supervisor for a group of individuals, I would like to identify duplicates where an employee is assigned to a task (same or different) within the same time period the employee is assigned to another task. (hey smartsheet, we would love a time function!) All tasks stop and stop within the same 24 day.

If I was only looking for exact matches I believe the formula would be =IF(COUNTIFS([EMPLOYEE ID]:[EMPLOYEE ID], [EMPLOYEE ID]1, DATE:DATE, DATE1, [START TIME]:[START TIME], [START TIME]1, [END TIME]:[END TIME],[END TIME]1) = 1, 0, 1) . However, since I'm looking for matches within a time window, I'm unsure of the formula. I'm open to any suggestions and I can add any helper columns needed.

Thanks in advance for your time.

Kelly

Best Answers

«1

Answers

  • Kelly Moore
    Kelly Moore ✭✭✭✭✭✭

    Thanks so much Paul!

    I'll start working on it. Although I showed the time as 24hr, the users input time as 12hr am/pm clock. I'm going to strip the start time from Created. Unfortunately there are too many data touches to utilize Modified as the stop time. I plan to convert the data to 24hr clock as this will give them cleaner functionality for a sub routine they run - I'm reviewing some of your older posts to see if you have slick way of doing this vs a a horrible nested if.

    I really appreciate the time you took with the formulas and the explanations. You're one of the community rockstars.

    Kelly

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    I have some notes specifically regarding pulling from Created and Modified columns. I know you aren't using the Modified, but you may be able to at least get a good start on the created.


    HERE is a published link to my sheet using the Created and Modified column types.


    When your users enter times with am/pm, is the am/pm in the same cell as the time, and are they using colons consistently?

  • Kelly Moore
    Kelly Moore ✭✭✭✭✭✭
    edited 04/14/20

    Yes, time + am/pm are written together in a single cell. I'm not sure about the consistency of colons - I would assume inconsistent as currently this process only uses paper forms. Last week I requested scans of actual hand-written forms but with current work restrictions, the data is a bit more difficult to obtain.

    Ultimately the data from many forms (this started out with only two) are inputted manually to an Access database. The Access database will probably have to continue because of linkages to a multitude of other processes.

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    How is the data getting into Smartsheet from the Access database?

  • Kelly Moore
    Kelly Moore ✭✭✭✭✭✭

    It's the other way around. Smartsheet will replace the paper forms, thus eliminating the tremendous manual assimilation that is taking place. Smartsheet will be used to populate Access.

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    Ah. So what is the feasibility of using a form to input the data into Smartsheet?

    If you are able to use a form, then you could use a series of dropdowns to standardize the entry of data so that formulas for calculations wouldn't have to be nearly as complex.

    The form can be set to reload after each submission, so data entry would actually go relatively quickly in the event someone needs to add multiple rows.

  • Kelly Moore
    Kelly Moore ✭✭✭✭✭✭

    I welcome input. I have a form for starting the process. There is some basic data that I believe is known at that point. (waiting on the completed forms). My challenge is the additional data that is being collected throughout this process. It was easy with a paper form in a clipboard, to 'update' additional data, per employee id, for a group of people all day long. I'm not clear if the additional data is updated in one sitting, so an update request would suffice, or if they trickle in the information throughout the day. This might be too long a discussion for online.

  • Kelly Moore
    Kelly Moore ✭✭✭✭✭✭

    Does the DATEONLY function change the timezone of the datestamp? It changed the date. I haven't noticed it doing this before.


  • Kelly Moore
    Kelly Moore ✭✭✭✭✭✭

    I managed around the wrong date using this.

    =IF(LEN(Modified@row) = 17, RIGHT(Modified@row, 8), RIGHT(Modified@row, 7)). It looks at the datestamp and counts characters. If the time is a double-digit number, like 10, etc, the length will be 17 characters. If true, it extracts 8 characters from the right. Otherwise it extracts 7 characters.

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    Yes. That would essentially "remove" the date and give you the time.

  • Kelly Moore
    Kelly Moore ✭✭✭✭✭✭

    I thought the COUNTIFS duplicate formula worked, but it isn't working for me. In this table there are no duplicates however the checkbox field [Duplicates Detected] marked each row as duplicate (which triggered my conditional formatting). Start Time is hand entered in 12hr format to a form. AM/PM is selected from dropdown. In helper columns I strip Date and End Time , respectively, out of Created field. I converted time into decimal format (using Paul's technique Here). None of my start and end times cross midnight. I can't find my error.


  • Kelly Moore
    Kelly Moore ✭✭✭✭✭✭

    Thanks again Paul. It made me laugh (with a groan) that I missed the IF statement. It's just one of those days.

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!