Column Validation - How to use column validation formula to check first two letters in a string are XX or YY?

Anonymous
2023-05-28T19:01:12+00:00

Hi!

I'm working on a SharePoint List and would like to use column validation to require the data the user submits starts with XX or YY. Looking at this video I found that I can validate the column ExampleColumn to ensure it starts with "XX" or it will throw an error using the formula =IF(LEFT(ExampleContent,2)="XX",TRUE,FALSE).

Now I'm looking to create a formula that checks if the first two letters in a string start with either XX or YY. Is this possible? My google/stackoverflow quest has left me defeated so I'm hoping someone could help.

Thanks in advance!

Microsoft 365 and Office | SharePoint | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2023-05-29T02:48:15+00:00

    Dear Ashley Albright,

    Good day! Thank you for posting to Microsoft Community. We are happy to help you.

    As per your description, it seems that you are trying to use column validation to ensure the column starts with "XX" or "YY" in SharePoint list.

    If the understanding above is right, please refer to below formula and hope it can help.

    =OR(LEFT(ExampleColumn,2)="XX",LEFT(ExampleColumn,2)="YY")

    And below attached are the screenshot of our test for your reference:

    Image

    Image

    If the understanding above is not consistent with yours, please feel free to post back and point that.

    Your understanding and patience will be highly appreciated. We hope that you are keeping safe and well!

    Thanks for your cooperation.

    Sincerely,

    Rhoda | Microsoft Community Moderator

    0 comments No comments