Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Validating a date field
I need Excel to validate that an entry in a date field is correct. Specifically, if someone includes the day of the week in an entry (e.g., Wed 02/16/05) I need Excel to display "You entered an incorrect date format. Enter the date as mm/dd/yy and do not include the day of the week." Can anyone tell me how to do that? Ken Elder Oklahoma City -- kenelder ------------------------------------------------------------------------ kenelder's Profile: http://www.excelforum.com/member.php...o&userid=20020 View this thread: http://www.excelforum.com/showthread...hreadid=346034 |
#2
|
|||
|
|||
This formula checks the entry in cell A2 to verify that it contains a
month, day, and year: =IF(AND(ISNUMBER(MONTH(A2)),ISNUMBER(DAY(A2)),ISNU MBER(YEAR(A2))),"OK","Invalid date entered") |
#3
|
|||
|
|||
Doesn't the formula below work for any number 1 and <2,958,465? =If(and(A21,A2<2958,465),"OK","Invalid date entered") should do the same thing =If(and(A2"b1",A2=<today(),"OK","Invalid date entered") might suit better, with b1 refers to the earliest date you allow and you can use =<today+90 for eaxample if you allow entries 90 days in advance, etc. -----Original Message----- This formula checks the entry in cell A2 to verify that it contains a month, day, and year: =IF(AND(ISNUMBER(MONTH(A2)),ISNUMBER(DAY(A2)),ISN UMBER (YEAR(A2))),"OK","Invalid date entered") . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Date issue between Windows and Macintosh version | Excel Discussion (Misc queries) | |||
How do I add a date field in a spreadsheet? | Excel Worksheet Functions | |||
Print Footer with Last Print Date field name | Excel Discussion (Misc queries) | |||
How can I format a cell so date field only displays the Month? | Excel Discussion (Misc queries) | |||
Using formulas to determine date in one cell based on date in anot | Excel Worksheet Functions |