+ Reply to Thread
Results 1 to 5 of 5

Validation- if date input is a Sunday

  1. #1
    Registered User
    Join Date
    08-21-2007
    Posts
    90

    Validation- if date input is a Sunday

    I would like to use Validation to verify that the date entered in cell "B3" is a Sunday.


    Or do I have to go at this some other way?
    Last edited by johnnywinter; 01-27-2009 at 01:14 PM. Reason: SOLVED

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492
    Not sure about DATA VALIDATION, but you could do it with CONDITIONAL FORMATTING....make the cell light up if it IS a SUNDAY.

    Highlight the cell, FORMAT > CONDITIONAL FORMATTING > Condition1 > Formula Is: =WEEKDAY(B3)=1

    ...and set your highlight color for when it is a Sunday, like Green if this is a good thing.

    Alternately, you could set it to turn red if it's any day other than Sunday with:

    =WEEKDAY(B3)<>1
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492
    I just experimented and the same formula works for DATA VALIDATION, too. Just choose "custom" and enter:

    =WEEKDAY(B3)=1

    You can customize the error message to indicate it's not a Sunday.

  4. #4
    Registered User
    Join Date
    08-21-2007
    Posts
    90
    My formula was close, but your's was perfect!

    It worked in Validation.

    Thank you

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492
    Awesome. If that takes care of your need, be sure to EDIT your original post (Go Advanced) and mark the PREFIX box [SOLVED]

+ 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