Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Airtable Community
- Discussions
- Ask A Question
- Formulas
- Exact match formula for Multiple select field when...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Topic Labels:
Formulas

Solved

Jump to Solution

0
2253
8

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Comment Post Options

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Sep 12, 2023 12:28 AM

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:

- a
- b
- c
- a,b

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.

Solved! Go to Solution.

1 Solution

Accepted Solutions

Solved
See Solution in Thread

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Sep 13, 2023 12:01 AM

Ah, I see why the FIND function is not working.

Multi-select is difficult to process because it's just text.

How about this formula?

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

8 Replies 8

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Sep 12, 2023 05:25 AM

How about this formula.

```
IF(
AND(
FIND("a,b",{select}),
FIND("c",{select}),
LEN({select})=LEN('"a,b", c')
)
,1
)
```

also this formula

```
IF(
OR(
'"a,b", c'={select},
'c, "a,b"'={select}
)
,1
)
```

Hmmm, Is there any better way?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Sep 12, 2023 05:38 AM

Thanks for response @Sho , but this will not work, as in my case 2 of 4 items can be selected (or 1, or 3, or all 4) and

LEN({select})=LEN('"a,b", c')

will not be true, as for this sample {select} is 'a,b,c,"a,b"'

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Sep 12, 2023 04:06 PM

Did you try it?

"LEN()" part checks to see if any other options have been selected.

In the case of 'a,b,c, "a,b"'

```
IF(
AND(
FIND("a",{select}),
FIND("b",{select}),
FIND("c",{select}),
FIND("a,b",{select}),
LEN({select})=LEN('a, b, c, "a,b"')
)
,1
)
```

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Sep 12, 2023 10:47 PM

Of course I tried it.

Let me explain more visual way.

This is my multiple select:

You can see there are 4 options.

This is selection I want to check:

Hope this is more accurate description.

Solved
See Solution in Thread

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Sep 13, 2023 12:01 AM

Ah, I see why the FIND function is not working.

Multi-select is difficult to process because it's just text.

How about this formula?

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Sep 13, 2023 12:11 AM - edited Sep 13, 2023 12:12 AM

I removed **LEN** and looks like it works, will try some corner cases and will update here.

Here is formula I am trying

```
IF(
AND(
REGEX_MATCH("##"®EX_REPLACE({select},", ","##")&"##","##c##"),
REGEX_MATCH("##"®EX_REPLACE({select},", ","##")&"##",'##"a,b"##')
)
,1
)
```

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Sep 13, 2023 12:20 AM

OK if not a problem!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Sep 13, 2023 02:34 AM