+ Reply to Thread
Results 1 to 9 of 9

Data Validation to prevent time overlapping hours report

  1. #1
    Forum Contributor
    Join Date
    05-28-2020
    Location
    Poland
    MS-Off Ver
    O365,
    Posts
    120

    Data Validation to prevent time overlapping hours report

    Hi everyone,

    I am trying to figure out, how to setup data validation on such way, that if a time entry crosses into an already existing time lapse an error/warning is shown.

    Because I am in Europe, I use European formats

    Example:

    Date from until
    29.10.2021 13:00 14:30
    30.10.2021 09:45 10:30

    As we can see in the example on the 29th of October the starting time is 1pm until 2:30 pm while the second example is on 30th October from 9:45am until 10:30am.

    If possible, I would like to have the mentioned data validation to prevent, that I record time, which has been already booked.

    For example, if I would enter on 29th October to work from 14:00 until 15:00 (2am - 3pm), the system should warn me, because I have already an entry on the specific date from 1pm until 2:30pm and therefore it is overlapping.

    I found an article but it is somehow not working on my side using the following formula:

    Please Login or Register  to view this content.
    Unfortunately, being a greenhorn and not often here, I am not allowed to add the at sign, which is in the code

    Therefore I replaced the at sign and just wrote at, sorry for that!

    Please Login or Register  to view this content.
    When I try to use this formula, I can try to enter any starting time, I get the error window, whereas I understand, that 24hrs are somehow already occupied (no clue what I am doing wrong). I also tried to convert the date from European into US and combine date with time but it didn't like that either.

    Maybe there is a simpler way to solve the issue and I do not need to use the function with indirect and could use something else?

    It wouldn't be the end of the world, if there is no solution for it but it would be a "nice to have".

    Thank you very much for any help or suggestions,

    Mike

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Data Validation to prevent time overlapping hours report

    Your formula is referring to table headings that are not in your example. Please attach an actual Excel file so we can work on the real thing. See yellow banner at the top of the page. Even greenhorns are allowed to attach files
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    05-28-2020
    Location
    Poland
    MS-Off Ver
    O365,
    Posts
    120

    Re: Data Validation to prevent time overlapping hours report

    OK,
    let me try

    Hopefully the attachment is good enough

    Column A is the date
    Column B starting time
    Column C ending time
    Column D which Customer (not needed regarding my question, will be used for reporting)
    Column E Calculation how much time was used and also an experiment

    Thanx a million for the help
    Attached Files Attached Files

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Data Validation to prevent time overlapping hours report

    The first problem is that your date column is not actually dates. This format is recognized as a string. I have converted them to dates for you. The display format is the same.

    You had the right idea but table references cannot be used in data validation rules. I wrote it to use the cell references. See attached and please test to make sure this is what you want.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    05-28-2020
    Location
    Poland
    MS-Off Ver
    O365,
    Posts
    120

    Re: Data Validation to prevent time overlapping hours report

    Good morning,

    Thank you very much for helping out. Ups, sorry that was my mistake regarding the formatting!

    I have downloaded your updated version but I am doing something wrong, because filling out the next row, nothing is happening.
    While filling out row 7, there was no warning, that I entered time period, which is overlapping with the time period
    of row 6.
    (See attachment)

    When I try to look at your result and I go onto Data and from there into Data Validation, it is empty, I do not see any formula. Am I looking at the wrong place or did something go wrong here?

    I see, that your file is slightly bigger than mine but I do not understand, where I have to look or what I need to do, to make it run?
    What I am doing wrong?

    Thank you so much for the help,

    Mike
    Attached Files Attached Files

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Data Validation to prevent time overlapping hours report

    In my test the data validation in the table automatically extended to new rows when added. It doesn't seem to work in the file you attached. I extended the data validation down 100 rows. You will have to extend it down as many rows as you think you will have.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    05-28-2020
    Location
    Poland
    MS-Off Ver
    O365,
    Posts
    120

    Re: Data Validation to prevent time overlapping hours report

    Hello again,

    sorry for my late reply but had several duties yesterday and this morning and therefore was not able to reply.

    The formula is working and I would like to thank you for that. Need to study it to understand what it is doing but it is working and that is the most important.

    Have a fantastic week,

    Thanx again,

    Mike

  8. #8
    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
    81,007

    Re: Data Validation to prevent time overlapping hours report

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of all those who offered help.
    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.

  9. #9
    Forum Contributor
    Join Date
    05-28-2020
    Location
    Poland
    MS-Off Ver
    O365,
    Posts
    120

    Re: Data Validation to prevent time overlapping hours report

    Done, thank you... you were 1 minute ahead of me

+ 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. [SOLVED] VBA to Prevent Data Entry in Cell with Data Validation List - Two Criteria Validation
    By AliGW in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 05-25-2019, 11:48 AM
  2. How To Prevent Tables from Overlapping
    By Yanezez in forum Excel General
    Replies: 1
    Last Post: 10-01-2015, 12:31 PM
  3. Replies: 1
    Last Post: 10-10-2014, 09:53 AM
  4. Conditional Data Validation - set many constraints in overlapping columns
    By EXLwiz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-17-2014, 06:50 AM
  5. Prevent XY Scatter Plot Lines From Overlapping
    By jeffe333 in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 11-11-2013, 06:59 PM
  6. Replies: 2
    Last Post: 06-25-2013, 04:31 PM
  7. How to Prevent Overlapping Stacks
    By robertguy in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 07-27-2007, 04:11 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