In Google Sheets, the dropdown cell store its value as a comma-separated list of string.
To check if a dropdown cell has value "A" and "B" selected, use the following formula :
=IF(REGEXMATCH(D2;"[\s]?A[,]?") * REGEXMATCH(D2;"[\s]?B[,]?");"YES";"NOPE")
The regex matches a string, prefixed by an optional space, and suffixed by an optional comma.
Examples :
- if only A is selected, the cell value is
A
. - if A and B are selected, the cell value is
A, B
.