Use a list instead for validation
You could make a list of the dates that are useful and include the term "N/A" in the list, then use that list for validation
Re: Use a list instead for validation
Nice idea, but not really feasible.
The user can input any date greater than or equal to 01/01/2001, so the "list" will very quickly become VERY big.
Sorry, didnt appreciate the scale of your problem
I was thinking you could make a list of the dates in a 65,536 row column but that would only give you about 179 years worth of dates, are you doing mortgages or something?
Until you find some VBA code somewhere... ;)
Put the criterion date in some cell and date format it as desired. Name this cell CDATE (for Criterion Date) via the Name Box.
Activate an empty cell where the date by user must be entered. Activate then Data|Validation. On Settings Dialog, choose Custom for "Allow" and enter the following formula.
=OR(AND(ISNUMBER(A1),A1>=CDATE+0,CELL("format",A1)=CELL("format",CDATE)),AND(ISTEXT(A1),A1="N/A"))
Keep Ignore Blank checked.
Do not format the cells where dates are to be entered, except for Center, Left Align or Right Align.
Copy down the empty cell (that now contains a data validation formula) as far as desired.
Hope this helps.
Aladin
=====================
You might be able to use a Custom validation
like the following:
=(B8="N/A")+AND(ISNUMBER(B8),IF(ISNUMBER(B8),AND(B8>0,B8=INT(B8))))
I think that this will do the trick. It has
the advantage of not needing a separate
criterion range.
You could substitute B8>0 for AND(B8>0,B8=INT(B8))
if you didn't mind times other than midnight.
(You can also include a maximum and minimum date;
I would use DATEVALUE for less brain damage
later on.)