airtable

Exact match formula for Multiple select field when value has comma


I need a formula to check if there is exact matching for multiple select field when values can have comma. Here is a sample multiple select I can have:

I need to check if users selection is exactly 'c' and 'a,b'. All solutions I found (like using FIND) are not working with comma.


Solution

  • Answer can be found in airtable community.

    Here is filter:

    IF(
      AND(
        REGEX_MATCH("##"&REGEX_REPLACE({select},", ","##")&"##","##c##"),
        REGEX_MATCH("##"&REGEX_REPLACE({select},", ","##")&"##",'##"a,b"##'),
        LEN({select})=LEN('c, "a,b"')
      )
      ,1
    )