Validation Date

H

housinglad

Hi

Is there anyway to validate a date to ensure that the date enetred in cell
B2 is a Monday?

Also how would it be coded to ensure that if a Monday was not entered then
it returned a error message.

Thanks
 
J

Jim Thomlinson

I would use a combination of Formulas and Conditional formatting to do that.

Assuming your date is in Cell A1. Select A1
Format | Conditonal Formatting... | Formula is:
=WEEKDAY(A1) <> 2
and select a pattern
In the adjacent cell B2 add the formula
=IF(WEEKDAY(A1) = 2, "", "Invalid Date")
 
H

housinglad

Thanks for that, but is there a way of doing it without writing the error
message in the adjacent box?
 
J

Jim Thomlinson

Another way would be to use
Data | Validation | Custom with a formula of
=WEEKDAY(A1) = 2

You may want to add an input and or error message to help the user.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top