Forum Discussion

Sandra Tibbs's avatar
Sandra Tibbs
Copper Contributor
Oct 11, 2023

Data Validation Criteria

I have the following formula in Cell B1:  =YEAR(NOW())-YEAR(A1)

The date in Cell A1 is: 05/05/2005

The results of my Cell B1 come up with the error:

I am trying to use the Data Validation to capture this error to indicate that the date has been entered incorrectly.  However, I am not sure how to test for this error.  Here is what I have tried:

I am in need of assistance to check for this error and pop up an error message.  I hope not to use Macros or VBA to test the error.

 

Thank you in advance.

 

2 Replies

  • Sandra Tibbs's avatar
    Sandra Tibbs
    Copper Contributor
    I found a solution. I used the validation criteria of Date is Less than today's date. This allows me to pick off the incorrect date entry in the cell.
  • JKPieterse's avatar
    JKPieterse
    Silver Contributor
    Select cell A1 and set validation for that cell. Make sure you choose Date in the Allow box. After that, set the other options appropriately.