In googlesheets, how can I filter text that doesn't contain any puncuation marks?
- User
In googlesheets, how can I filter text that doesn't contain any puncuation marks?
- Assistant
To filter text that doesn't contain any punctuation marks in Google Sheets, you can use a regular expression with the FILTER function and REGEXMATCH or REGEXMATCH inside ARRAYFORMULA.
✅ Example Formula (Filtering Text Without Punctuation): Assume your data is in column A starting from A2. excelCopyEdit=FILTER(A2:A, NOT(REGEXMATCH(A2:A, "[[:punct:]]")))
🔍 Explanation:
REGEXMATCH(A2:A, "[[:punct:]]"): Checks if the text contains any punctuation (like ., ,, !, etc.).
NOT(...): Inverts it — i.e., selects rows that do not contain punctuation.
FILTER(...): Returns only the rows matching the condition.
💡 Tips:
[[:punct:]] is a POSIX character class for all punctuation.
This will exclude rows with even one punctuation mark.
Let me know if you want it to also exclude numbers or special symbols beyond punctuation!
- User
What did I do wrong?
- Assistant
You're close, but the issue is with how you're using the REGEXMATCH function inside the filter menu in Google Sheets — it doesn’t accept formulas like =REGEXMATCH(...) directly in the "Text does not contain" field.
✅ Here's how to fix it: Instead of:
Text does not contain =REGEXMATCH("[[:punct:]]")
You should use:
Custom formula is =NOT(REGEXMATCH(H2, "[[:punct:]]"))
📌 Steps:
Click the filter icon in the header.
Select Filter by condition.
Choose Custom formula is from the dropdown.
Enter: =NOT(REGEXMATCH(H2, "[[:punct:]]"))
Click OK.
🔁 Replace H2 with the correct reference for the first row of your filtered range.
❗Important:
Always use "Custom formula is" for expressions like REGEXMATCH.
Make sure the cell reference (like H2) matches the top cell of the column you're filtering.
Let me know if you'd like to filter multiple columns or exclude other character types too!