1

I am trying to add two formulas in validation settings but getting syntax errors.

I have created a leave request list in SharePoint. My requirements are below:

If Half Day(Yes/No column) is equal to Yes, then AM or PM(choice column) should be mandatory. If Type Of Leave(Choice column) is equal to Time Off, then Number of Hours(Number Column) should be mandatory.

Need help to put the above two conditions in 1 formula. Sorry I am not a technical person so trying to work around the requirements here.

Also I don’t know how and where to enter code if that’s the solution. I was trying to enter formula. If that’s the solution, it’s the best. So if you can provide a step by step guide.

7
  • Can you add the formula you are using currently to your question? Commented Nov 22, 2022 at 3:15
  • =IF([Type of Leave]="Time Off",IF(ISBLANK([Number Of Hours]),FALSE,TRUE),TRUE)
    – Nik
    Commented Nov 22, 2022 at 6:37
  • Above is one formula I am using and it’s working… I don’t know how to add another one to this
    – Nik
    Commented Nov 22, 2022 at 6:37
  • check my answer given below. Let me know if it works. Commented Nov 22, 2022 at 6:44
  • Thank you so much… works perfectly fine… :)
    – Nik
    Commented Nov 22, 2022 at 6:54

1 Answer 1

1

Try using this formula in List validation settings:

=AND(IF([Type of Leave]="Time Off",IF(ISBLANK([Number Of Hours]),FALSE,TRUE),TRUE), IF([Half Day],IF(ISBLANK([AM or PM]),FALSE,TRUE),TRUE))

Follow my answer given in below thread to add formula in List validation settings: List validation to make multiple fields mandatory if dropdown meets condition

2
  • 1
    Amazing… works perfectly fine… Thank you so much 😊
    – Nik
    Commented Nov 22, 2022 at 6:54
  • You're welcome, glad it worked for you! Commented Nov 24, 2022 at 7:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.