Question

I'm having formula and logic trouble getting a list validation formula that will force the user to enter four dates in sequential order. I have Date1, Date2, Date3, and Date4. I also need to skip a calculation if a "later" date is blank.

I would be grateful for help. Thanks-

Was it helpful?

Solution

Try the following formula and see if that works.

=IF(AND(NOT(ISBLANK(Date1)),NOT(ISBLANK(Date2))),IF(DATEDIF(Date1,Date2,"D")=1,IF(AND(NOT(ISBLANK(Date2)),NOT(ISBLANK(Date3))),IF(DATEDIF(Date2,Date3,"D")=1,IF(AND(NOT(ISBLANK(Date3)),NOT(ISBLANK(Date4))),IF(DATEDIF(Date3,Date4,"D")=1,TRUE,FALSE),TRUE),FALSE),IF(AND(NOT(ISBLANK(Date3)),NOT(ISBLANK(Date4))),IF(DATEDIF(Date3,Date4,"D")=1,TRUE,FALSE),TRUE)),FALSE),IF(AND(NOT(ISBLANK(Date2)),NOT(ISBLANK(Date3))),IF(DATEDIF(Date2,Date3,"D")=1,IF(AND(NOT(ISBLANK(Date3)),NOT(ISBLANK(Date4))),IF(DATEDIF(Date3,Date4,"D")=1,TRUE,FALSE),TRUE),FALSE),IF(AND(NOT(ISBLANK(Date3)),NOT(ISBLANK(Date4))),IF(DATEDIF(Date3,Date4,"D")=1,TRUE,FALSE),TRUE)))

Screenshot showing valid entries

enter image description here

OTHER TIPS

I don't think it's possible to achieve your requirement by list validation.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top