+ Reply to Thread
Results 1 to 4 of 4

How to compute if a date falls between two specified dates??

  1. #1
    Registered User
    Join Date
    11-22-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    23

    How to compute if a date falls between two specified dates??

    Hi Everyone!

    I have a worksheet which calculates productivity of resources. There is a cell in which user can input a date. Now I want to check whether the value user entered falls between a Start Date and End Date and if not then show an error message. Start Date and End Date are mentioned in two different cells in the same worksheet. Can anybody help me with a macro to achieve the same?

    Below is a sample excel given.

    Start Date 3/12/12
    End Date 05/06/13
    Date Task Hours
    03/12/12 Requirement Study 2
    5/04/13 Plan Preparation 4
    07/07/13 Review 5

    Now you can clearly see the in the last row the date is beyond the End Date mentioned in the above table..so in this case user will be prevented to enter the value and shown an error message "Wrong Input".

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: How to compute if a date falls between two specified dates??

    that facility is in data validation
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    11-22-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: How to compute if a date falls between two specified dates??

    Thanks for replying! Can you please provide the specific steps or formula to achieve this?

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: How to compute if a date falls between two specified dates??

    Data tab/data validation /allow date/ between put in the absolute values of the cells with the 2 dates in eg $b$1 $b$2. you can choose an input message and a message when the wrong date is entered
    Last edited by martindwilson; 12-12-2012 at 07:51 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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