+ Reply to Thread
Results 1 to 5 of 5

is date three weeks (or multiple of three weeks) from a set date.

  1. #1
    Forum Contributor
    Join Date
    09-05-2011
    Location
    Essex, England
    MS-Off Ver
    Excel 2003 Excel 2007
    Posts
    383

    is date three weeks (or multiple of three weeks) from a set date.

    Good Morning All,

    hopefully a simple one that is just escaping me right now.

    I'm looking for a method (in vba) to determine if a passed variable (date) is 3 weeks or multiple of 3 weeks (i.e. 6 weeks, 12 weeks) from a predefined date).

    i.e. set date = 05/09/2016, test 26/09/2016 should ring TRUE, as should 07/11/2016 but 31/10/2016 should flag FALSE.

    thank you in advance.

  2. #2
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: is date three weeks (or multiple of three weeks) from a set date.

    Check that test date - set date can be divided by 21 and the reminder is 0
    If you are pleased with a member's answer then use the Star icon to rate it.

  3. #3
    Forum Contributor
    Join Date
    09-05-2011
    Location
    Essex, England
    MS-Off Ver
    Excel 2003 Excel 2007
    Posts
    383

    Re: is date three weeks (or multiple of three weeks) from a set date.

    D'oh that is incredibly simple.

    thank you for the help. you wouldn't believe the complicated mumbo jumbo voodoo i've been trying.

  4. #4
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: is date three weeks (or multiple of three weeks) from a set date.

    Just keep in mind you should work with just the dates, not date and time

  5. #5
    Forum Contributor
    Join Date
    09-05-2011
    Location
    Essex, England
    MS-Off Ver
    Excel 2003 Excel 2007
    Posts
    383

    Re: is date three weeks (or multiple of three weeks) from a set date.

    Already factored time out as I was aware that'd throw a spanner in the works.

    one thing I did manage before going off the range a little.

+ 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] Macro that counts weeks from start date to end date
    By Tona in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-15-2016, 05:56 AM
  2. [SOLVED] VBA Date of Previous Weeks Monday From Current Date
    By hobbiton73 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-24-2014, 03:50 AM
  3. Userform Validation if date is within 2 weeks of todays date
    By Mackattack in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-19-2014, 07:50 AM
  4. Adding one TextBox with weeks to text box with date to give final Date
    By davidloops in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-21-2013, 08:25 PM
  5. Replies: 1
    Last Post: 01-08-2013, 09:30 AM
  6. [SOLVED] Calculate date based on number of weeks or months after start date
    By wotsup in forum Excel General
    Replies: 3
    Last Post: 08-17-2012, 06:00 AM
  7. Formulas - count the amount of working weeks from a date until present date
    By Andrew_Franklin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-09-2008, 09:23 AM

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