+ Reply to Thread
Results 1 to 3 of 3

preventing overlapping date ranges

  1. #1
    Registered User
    Join Date
    03-01-2011
    Location
    Hyderabad,India
    MS-Off Ver
    Excel 2003
    Posts
    2

    Question preventing overlapping date ranges

    Hi,
    I am new to the forum! my friends talk a lot about this and glad to be in the forum using Office 2007.

    My question---
    I work in a manufacturing company which makes different sizes of Nuts on many machines. One machine can do only one size of Nuts for a particular period and can be molded for another variant.I manage an excel sheet defining the date ranges of the machine utility for a particular Nut, this allows us to mark our next point for another size.

    The problem is.. after fixing dates for a process on a machine, I many time loose track of the previous marked dates and issue new dates for the same machine that is usually overlapping and lately found out.

    Please help me with a solution ~~~ which does not allow overlapping of dates on a particular machine unless the previous dates alloted be changed.

    Machines Start date End date
    Machine 1 1/25/2011 2/7/2011
    Machine 2 1/2/2011 1/25/2011
    Machine 3 1/2/2011 1/25/2011
    Machine 1 2/19/2011 3/22/2011
    Machine 1 1/27/2011 2/11/2011

    I use the Table feature of Excel 2007 for this data
    Attached Files Attached Files

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: overlapping date ranges

    If I understand correctly, you can apply Data Validation through the Data menu.

    The only caveat is that data validation rules don't seem to get auto-applied in Tables as you insert new rows. So you will have to preselect the range starting at B2 and ending in column C at a row you think the data should never reach.

    Then go to Data and select Data validation from the Data Validation drop down.

    Then select Custom from the Allow menu and enter formula:

    =COUNTIFS($A$2:$A2,$A3,$B$2:$B2,"<="&B3,$C$2:$C2,">="&B3)=0

    The validation won't apply to already completed cells, but if you insert a new row and begin entering data, you should get an error if the data overlaps another already entered date range for that machine. You will get a popup error message (which you can customize through Data validation windows).
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    03-01-2011
    Location
    Hyderabad,India
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: overlapping date ranges

    Quote Originally Posted by NBVC View Post
    If I understand correctly, you can apply Data Validation through the Data menu.

    The only caveat is that data validation rules don't seem to get auto-applied in Tables as you insert new rows. So you will have to preselect the range starting at B2 and ending in column C at a row you think the data should never reach.

    Then go to Data and select Data validation from the Data Validation drop down.

    Then select Custom from the Allow menu and enter formula:

    =COUNTIFS($A$2:$A2,$A3,$B$2:$B2,"<="&B3,$C$2:$C2,">="&B3)=0

    The validation won't apply to already completed cells, but if you insert a new row and begin entering data, you should get an error if the data overlaps another already entered date range for that machine. You will get a popup error message (which you can customize through Data validation windows).
    Thank you very much!
    Can you please help me with an example sheet.??

    Also, I should not be able to enter any dates on that machine when there is overlapping before or after unless I select for a new dates or change the previous entry.

    Can a VBA code be formulated for this! this work will be a treasure to me.

    Thanks in advance.
    Last edited by xlfan; 03-01-2011 at 10:14 PM. Reason: additional comments

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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