+ Reply to Thread
Results 1 to 9 of 9

Data validation against a date: Specific Day of week

  1. #1
    Registered User
    Join Date
    09-07-2012
    Location
    Manhattan
    MS-Off Ver
    Excel 2007
    Posts
    12

    Data validation against a date: Specific Day of week

    I got to this page through Google search. I am trying to do a validation against a date, and would appreciate help with these questions (Novice Excel user ):
    Can a cell have a calendar button - for user to choose a date, and also have data validation? (so far I've played with validation, haven't found how to include calendar)
    I would like to validate that the chosen date is at least TODAY+14, but also is a Saturday - is there any validation which will provide this? Thanks for any assistance. CzR

  2. #2
    Registered User
    Join Date
    08-09-2012
    Location
    Hayes, VA
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: Data validation against a date: Specific Day of week

    I don't know how to do a dropdown calendar, but for the date and day, you could use

    =IF(AND(G4=TODAY()+14,TEXT(G4,"DDD")="SAT"),"True","False")

    (replace "G4" with the cell that contains the date you are checking (Today()+14)

  3. #3
    Valued Forum Contributor Melvinrobb's Avatar
    Join Date
    06-19-2012
    Location
    Manitoba, Canada
    MS-Off Ver
    Excel 2013
    Posts
    1,128

    Re: Data validation against a date: Specific Day of week

    Would the attached file work?
    Attached Files Attached Files
    Please click the * icon below if I have helped.

  4. #4
    Registered User
    Join Date
    09-07-2012
    Location
    Manhattan
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Data validation against a date: Specific Day of week

    Thanks Tridom - but with this
    {=IF(AND(G4=TODAY()+14,TEXT(G4,"DDD")="SAT"),"True","False")}
    I always get error message - even when I enter 9/29 or 10/6. It looked promising, tho truthfully I don't understand the parens after Today, the "TEXT".."DDD", and the "True" ,"False" at end of stment (tho that I can guess is setting results for prev statement). Much for me to learn abt excel.. hope I can use it past the creation of this form. Thanks again, and for quick response.
    Last edited by CzR852; 09-10-2012 at 01:02 PM. Reason: Clarify to which post it referred

  5. #5
    Registered User
    Join Date
    08-09-2012
    Location
    Hayes, VA
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: Data validation against a date: Specific Day of week

    9/29 is not a Saturday, hence the formaula should return false if you put that date into cell G4 (for this formula)

    10/6 is MORE THAN Today + 14 Days....again, the formula returns false.

    =Today() (has to have parens 'cause its a function) returns today's date.
    =TEXT(G4,"DDD") returns the 3 charectar day for the value in G4 and should ="SAT"
    =TEXT(G4,"DDD")+14 returns the 3-digit day for a day that is 14 dys from today
    "True" is returned if both values are TRUE and FALSE is returned if both values are false.

    Regarding 10/6....do you want it to return TRUE is the date is equal to or greater than today + 14 days and SAT? If so, change the formula to be =IF(AND(G4>=TODAY()+14,TEXT(G4,"DDD")="SAT"),"True","False")

    And- I don't know if you are using "{}" in your sheet or you just did that in thepost, but if you are using it on this formula, remove them. They are not needed.
    Last edited by tridom; 09-10-2012 at 02:00 PM.

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Data validation against a date: Specific Day of week

    Quote Originally Posted by CzR852 View Post
    ....at least TODAY+14, but also is a Saturday
    You can use WEEKDAY function to check it's a Saturday, (WEEKDAY returns 7 for a Sat)....and you don't really need an IF function, just an expression which will return TRUE or FALSE so this should do it for a date in A1, change as required

    =AND(WEEKDAY(A1)=7,A1>=TODAY()+14)
    Audere est facere

  7. #7
    Registered User
    Join Date
    09-07-2012
    Location
    Manhattan
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Data validation against a date: Specific Day of week

    Thanks much, folks for the quick responses. So far the one that works is the file provided MelvinRobb. Seems a lot of coding but I'm the copy/paste queen.

    Question to Daddylonglegs: Tried your formula (subst C24 -validated cell- for A2) but always popped the error no matter. So, to verify: Under data Validation
    Allow: DATE, Data: Equal to, Date: =AND(WEEKDAY(C24)=7,C24>=TODAY()+14)
    I got errors whether Data: Equal to or GT/EQ Is this the suggested method, or How? I was entering date as 9/29 {a Sat on my calendar}.

    But thanks, tridom for the breakdown of the formula. With any luck I'll get so good at Excel that I'll avoid all {CICS} system work and just code sheets
    Last edited by CzR852; 09-10-2012 at 02:55 PM. Reason: Clarity

  8. #8
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Data validation against a date: Specific Day of week

    Quote Originally Posted by CzR852 View Post
    So, to verify: Under data Validation
    Allow: DATE, Data: Equal to, Date: =AND(WEEKDAY(C24)=7,C24>=TODAY()+14)
    No, sorry, I didn't specify - it needs to be Allow: Custom, then you put that formula in the "Formula" box.....

  9. #9
    Registered User
    Join Date
    09-07-2012
    Location
    Manhattan
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Data validation against a date: Specific Day of week

    Hello, folks - I am picking this up again from last year b/c I've now got a deadline to finish this form. After searching through MS help and forums, I am asking your help to do this extended data validation.
    I used MelvinRobb's very cool example to create a list of Saturday dates I've namelisted as ProdDate.
    I also created a list called UnitDate and ModelDate using that methodology. What I'm trying to do is validate one cell that the user enters based on whether it's a valid Unit/Model/or Production date. The Unit/Model/or Production has been filled in on a prior cell and is involved in this validation.
    This is the validation I did on Cell F2 (in the sample I uploaded):
    IF(C2="Unit"),VLOoKUP=(F2,UnitDate),IF(C2="Model"),VLOoKUP=(F2,ModelDate),IF(AND(C2="PRODUCTION"),(E2<>RB100)),VLOOKUP=(F2,ProdDate),VLOOKUP=(F2,RB100Date)
    Btw - I've been creating this code in a notepad, and pasting it in.. but can't really arrow cursor through it without adding stuff I don't want. This Data validation box is really difficult to work with - suggestions would be appreciated.

    PS - I am complete newbie to forums, and cannot find the place to start a new post; however, this was part of my previous post (when apparently I figured out new thread thing). Please forgive my ignorance. CzR
    Attached Files Attached Files

+ 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