user20777937
user20777937

Reputation: 95

Conditional formatting in Google Sheets IF cell contains any spaces

I have a column set up as below:

ASIN <--(header)

ASIN1,ASIN2,ASIN3 <--- (first row)

I would like my staff to always enter ASINs separated with commas (as above) and not have spaces anywhere in the cell. I anticipate them to forget this at times so I would like to set up a conditional formatting rule where if the cell contains any spaces then it will automatically be flagged.

What formula would work here? The ASIN column range is E2:E so would like the formula to apply to each cell in this range.

Upvotes: 0

Views: 599

Answers (1)

Mart&#237;n
Mart&#237;n

Reputation: 10207

You can use this custom formula:

=REGEXMATCH(E2," ")

enter image description here

Or you can set a Data Validation rule so it flags with red OR directly prohibits the entry when it's not met. You can choose "Show a Warning" or "Reject the input":

=NOT(REGEXMATCH(E2," "))

enter image description here

Upvotes: 1

Related Questions